Bug 1186845 - Let MP4Decoder handle 3GPP files if Gonk PDM is available. r=cpearce
authorJohn Lin <jolin@mozilla.com>
Mon, 17 Aug 2015 15:12:43 -0700
changeset 290704 1d3817f7fff6193fd03f5a5c0a319aa7115dd430
parent 290703 fa26923ada0a34cc2dbb93ed4946b017d78a7b3a
child 290705 dd56d26a2ec98bdede7f31cf13cbf6145b2efa35
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1186845
milestone43.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 1186845 - Let MP4Decoder handle 3GPP files if Gonk PDM is available. r=cpearce
dom/media/fmp4/MP4Decoder.cpp
--- a/dom/media/fmp4/MP4Decoder.cpp
+++ b/dom/media/fmp4/MP4Decoder.cpp
@@ -9,16 +9,17 @@
 #include "MediaFormatReader.h"
 #include "MP4Demuxer.h"
 #include "mozilla/Preferences.h"
 #include "nsCharSeparatedTokenizer.h"
 #ifdef MOZ_EME
 #include "mozilla/CDMProxy.h"
 #endif
 #include "mozilla/Logging.h"
+#include "nsMimeTypes.h"
 
 #ifdef XP_WIN
 #include "mozilla/WindowsVersion.h"
 #endif
 #ifdef MOZ_WIDGET_ANDROID
 #include "nsIGfxInfo.h"
 #include "AndroidBridge.h"
 #endif
@@ -136,16 +137,22 @@ MP4Decoder::CanHandleMediaType(const nsA
   if (aType.EqualsASCII("audio/mp4") || aType.EqualsASCII("audio/x-m4a")) {
     return MP4Decoder::CanCreateAACDecoder() &&
            (aCodecs.IsEmpty() ||
             IsSupportedAudioCodec(aCodecs,
                                   aOutContainsAAC,
                                   aOutContainsMP3));
   }
 
+#ifdef MOZ_GONK_MEDIACODEC
+  if (aType.EqualsASCII(VIDEO_3GPP)) {
+    return Preferences::GetBool("media.fragmented-mp4.gonk.enabled", false);
+  }
+#endif
+
   if (!aType.EqualsASCII("video/mp4") ||
       !MP4Decoder::CanCreateH264Decoder()) {
     return false;
   }
 
   // Verify that all the codecs specifed are ones that we expect that
   // we can play.
   nsCharSeparatedTokenizer tokenizer(aCodecs, ',');