Bug 1505284 - P1. Use ffmpeg decoder for h264 in low latency mode. r=padenot
☠☠ backed out by eb6978b08417 ☠ ☠
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 20 Nov 2018 17:44:03 +0000
changeset 503774 05fd5592620612161cebe518f6ec446ec28ecf3e
parent 503773 b245aba69d768056a73019c5ceb1ab39fb543fbd
child 503775 1d3eb26cfeac0fd13ab376ab86cc1b2ccd1fdc82
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1505284
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1505284 - P1. Use ffmpeg decoder for h264 in low latency mode. r=padenot Differential Revision: https://phabricator.services.mozilla.com/D12431
dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
--- a/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
+++ b/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
@@ -2,20 +2,21 @@
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __FFmpegDecoderModule_h__
 #define __FFmpegDecoderModule_h__
 
-#include "PlatformDecoderModule.h"
+#include "FFmpegAudioDecoder.h"
 #include "FFmpegLibWrapper.h"
-#include "FFmpegAudioDecoder.h"
 #include "FFmpegVideoDecoder.h"
+#include "PlatformDecoderModule.h"
+#include "VPXDecoder.h"
 #include "mozilla/StaticPrefs.h"
 
 namespace mozilla {
 
 template <int V>
 class FFmpegDecoderModule : public PlatformDecoderModule {
  public:
   static already_AddRefed<PlatformDecoderModule> Create(
@@ -32,18 +33,22 @@ class FFmpegDecoderModule : public Platf
       const CreateDecoderParams& aParams) override {
     // Temporary - forces use of VPXDecoder when alpha is present.
     // Bug 1263836 will handle alpha scenario once implemented. It will shift
     // the check for alpha to PDMFactory but not itself remove the need for a
     // check.
     if (aParams.VideoConfig().HasAlpha()) {
       return nullptr;
     }
-    if (aParams.mOptions.contains(CreateDecoderParams::Option::LowLatency) &&
+    if (VPXDecoder::IsVPX(aParams.mConfig.mMimeType) &&
+        aParams.mOptions.contains(CreateDecoderParams::Option::LowLatency) &&
         !StaticPrefs::MediaFfmpegLowLatencyEnabled()) {
+      // We refuse to create a decoder with low latency enabled if it's VP8 or
+      // VP9 unless specifically allowed: this will fallback to libvpx later.
+      // decoder
       return nullptr;
     }
     RefPtr<MediaDataDecoder> decoder = new FFmpegVideoDecoder<V>(
         mLib, aParams.mTaskQueue, aParams.VideoConfig(),
         aParams.mKnowsCompositor, aParams.mImageContainer,
         aParams.mOptions.contains(CreateDecoderParams::Option::LowLatency));
     return decoder.forget();
   }