Bug 1370192: P1. Remove usage of DirectShowDecoder. r=cpearce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 05 Jun 2017 12:59:46 +0200
changeset 412980 6b5ca49920b5f8982a97259e11eac4c11c4660cc
parent 412979 1330312e91c96fea39eb4881672c5f9a7776bef1
child 412981 037c44d17f4d67058b1b45c9055234512a4a2d5a
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1370192
milestone55.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 1370192: P1. Remove usage of DirectShowDecoder. r=cpearce MozReview-Commit-ID: A3IOOIKR187
dom/media/DecoderTraits.cpp
dom/media/ThreadPoolCOMListener.h
dom/media/test/manifest.js
dom/media/test/test_can_play_type_mpeg.html
modules/libpref/init/all.js
--- a/dom/media/DecoderTraits.cpp
+++ b/dom/media/DecoderTraits.cpp
@@ -17,20 +17,16 @@
 #include "WebMDecoder.h"
 #include "WebMDemuxer.h"
 
 #ifdef MOZ_ANDROID_OMX
 #include "AndroidMediaDecoder.h"
 #include "AndroidMediaReader.h"
 #include "AndroidMediaPluginHost.h"
 #endif
-#ifdef MOZ_DIRECTSHOW
-#include "DirectShowDecoder.h"
-#include "DirectShowReader.h"
-#endif
 #ifdef MOZ_FMP4
 #include "MP4Decoder.h"
 #include "MP4Demuxer.h"
 #endif
 #include "MediaFormatReader.h"
 
 #include "MP3Decoder.h"
 #include "MP3Demuxer.h"
@@ -141,19 +137,16 @@ CanHandleCodecsType(const MediaContainer
   if (ADTSDecoder::IsSupportedType(aType)) {
     return CANPLAY_YES;
   }
   if (FlacDecoder::IsSupportedType(aType)) {
     return CANPLAY_YES;
   }
 
   MediaCodecs supportedCodecs;
-#ifdef MOZ_DIRECTSHOW
-  DirectShowDecoder::GetSupportedCodecs(aType, &supportedCodecs);
-#endif
 #ifdef MOZ_ANDROID_OMX
   if (MediaDecoder::IsAndroidMediaPluginEnabled()) {
     EnsureAndroidMediaPluginHost()->FindDecoder(aType, &supportedCodecs);
   }
 #endif
   if (supportedCodecs.IsEmpty()) {
     return CANPLAY_MAYBE;
   }
@@ -206,21 +199,16 @@ CanHandleMediaType(const MediaContainerT
     return CANPLAY_MAYBE;
   }
   if (ADTSDecoder::IsSupportedType(mimeType)) {
     return CANPLAY_MAYBE;
   }
   if (FlacDecoder::IsSupportedType(mimeType)) {
     return CANPLAY_MAYBE;
   }
-#ifdef MOZ_DIRECTSHOW
-  if (DirectShowDecoder::GetSupportedCodecs(mimeType, nullptr)) {
-    return CANPLAY_MAYBE;
-  }
-#endif
 #ifdef MOZ_ANDROID_OMX
   if (MediaDecoder::IsAndroidMediaPluginEnabled() &&
       EnsureAndroidMediaPluginHost()->FindDecoder(mimeType, nullptr)) {
     return CANPLAY_MAYBE;
   }
 #endif
   return CANPLAY_NO;
 }
@@ -309,25 +297,16 @@ InstantiateDecoder(const MediaContainerT
   }
 #endif
 
   if (WebMDecoder::IsSupportedType(aType)) {
     decoder = new WebMDecoder(aOwner);
     return decoder.forget();
   }
 
-#ifdef MOZ_DIRECTSHOW
-  // Note: DirectShow should come before WMF, so that we prefer DirectShow's
-  // MP3 support over WMF's.
-  if (DirectShowDecoder::GetSupportedCodecs(aType, nullptr)) {
-    decoder = new DirectShowDecoder(aOwner);
-    return decoder.forget();
-  }
-#endif
-
   if (IsHttpLiveStreamingType(aType)) {
     // We don't have an HLS decoder.
     Telemetry::Accumulate(Telemetry::MEDIA_HLS_DECODER_SUCCESS, false);
   }
 
   return nullptr;
 }
 
@@ -382,23 +361,17 @@ DecoderTraits::CreateReader(const MediaC
   if (MediaDecoder::IsAndroidMediaPluginEnabled() &&
       EnsureAndroidMediaPluginHost()->FindDecoder(aType, nullptr)) {
     decoderReader = new AndroidMediaReader(aDecoder, aType);
   } else
 #endif
   if (WebMDecoder::IsSupportedType(aType)) {
     decoderReader =
       new MediaFormatReader(aDecoder, new WebMDemuxer(aDecoder->GetResource()));
-  } else
-#ifdef MOZ_DIRECTSHOW
-  if (DirectShowDecoder::GetSupportedCodecs(aType, nullptr)) {
-    decoderReader = new DirectShowReader(aDecoder);
-  } else
-#endif
-  if (false) {} // dummy if to take care of the dangling else
+  }
 
   return decoderReader;
 }
 
 /* static */
 bool DecoderTraits::IsSupportedInVideoDocument(const nsACString& aType)
 {
   // Forbid playing media in video documents if the user has opted
@@ -421,15 +394,12 @@ bool DecoderTraits::IsSupportedInVideoDo
     (MediaDecoder::IsAndroidMediaPluginEnabled() && IsAndroidMediaType(*type)) ||
 #endif
 #ifdef MOZ_FMP4
     MP4Decoder::IsSupportedType(*type, /* DecoderDoctorDiagnostics* */ nullptr) ||
 #endif
     MP3Decoder::IsSupportedType(*type) ||
     ADTSDecoder::IsSupportedType(*type) ||
     FlacDecoder::IsSupportedType(*type) ||
-#ifdef MOZ_DIRECTSHOW
-    DirectShowDecoder::GetSupportedCodecs(*type, nullptr) ||
-#endif
     false;
 }
 
 } // namespace mozilla
--- a/dom/media/ThreadPoolCOMListener.h
+++ b/dom/media/ThreadPoolCOMListener.h
@@ -8,18 +8,18 @@
 #define MSCOMInitThreadPoolListener_h_
 
 #include "nsIThreadPool.h"
 #include <objbase.h>
 
 namespace mozilla {
 
 // Thread pool listener which ensures that MSCOM is initialized and
-// deinitialized on the thread pool thread. We may call into WMF or
-// DirectShow on this thread, so we need MSCOM working.
+// deinitialized on the thread pool thread. We may call into WMF on this thread,
+// so we need MSCOM working.
 class MSCOMInitThreadPoolListener final : public nsIThreadPoolListener {
   ~MSCOMInitThreadPoolListener() {}
   public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSITHREADPOOLLISTENER
 };
 
 } // namespace mozilla
--- a/dom/media/test/manifest.js
+++ b/dom/media/test/manifest.js
@@ -258,20 +258,20 @@ var gPlayTests = [
   // Test playback of a MP4 file with a non-zero start time (and audio starting
   // a second later).
   { name:"bipbop-lateaudio.mp4", type:"video/mp4" },
 
   { name:"small-shot.m4a", type:"audio/mp4", duration:0.29 },
   { name:"small-shot.mp3", type:"audio/mpeg", duration:0.27 },
   { name:"owl.mp3", type:"audio/mpeg", duration:3.343 },
   // owl.mp3 as above, but with something funny going on in the ID3v2 tag
-  // that causes DirectShow to fail.
+  // that caused DirectShow to fail.
   { name:"owl-funny-id3.mp3", type:"audio/mpeg", duration:3.343 },
   // owl.mp3 as above, but with something even funnier going on in the ID3v2 tag
-  // that causes DirectShow to fail.
+  // that caused DirectShow to fail.
   { name:"owl-funnier-id3.mp3", type:"audio/mpeg", duration:3.343 },
   // One second of silence with ~140KB of ID3 tags. Usually when the first MP3
   // frame is at such a high offset into the file, MP3FrameParser will give up
   // and report that the stream is not MP3. However, it does not count ID3 tags
   // in that offset. This test case makes sure that ID3 exclusion holds.
   { name:"huge-id3.mp3", type:"audio/mpeg", duration:1.00 },
   // A truncated VBR MP3 with just enough frames to keep most decoders happy.
   // The Xing header reports the length of the file to be around 10 seconds, but
--- a/dom/media/test/test_can_play_type_mpeg.html
+++ b/dom/media/test/test_can_play_type_mpeg.html
@@ -157,18 +157,17 @@ function IsJellyBeanOrLater() {
 var haveMp4 = getPref("media.wmf.enabled") ||
               IsMacOSSnowLeopardOrLater() ||
               (IsSupportedAndroid() &&
                (IsJellyBeanOrLater() || getPref("media.plugins.enabled"))) ||
               (IsLinux() && getPref("media.ffmpeg.enabled"));
 
 check_mp4(document.getElementById('v'), haveMp4);
 
-var haveMp3 = getPref("media.directshow.enabled") ||
-              getPref("media.wmf.enabled") ||
+var haveMp3 = getPref("media.wmf.enabled") ||
               (IsLinux() && getPref("media.ffmpeg.enabled")) ||
               (IsSupportedAndroid() &&
                ((IsJellyBeanOrLater() && getPref("media.android-media-codec.enabled")) ||
                 getPref("media.plugins.enabled"))) ||
               getPref("media.apple.mp3.enabled");
 check_mp3(document.getElementById('v'), haveMp3);
 
 mediaTestCleanup();
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -349,19 +349,16 @@ pref("media.wakelock_timeout", 2000);
 
 // Whether we should play videos opened in a "video document", i.e. videos
 // opened as top-level documents, as opposed to inside a media element.
 pref("media.play-stand-alone", true);
 
 pref("media.hardware-video-decoding.enabled", true);
 pref("media.hardware-video-decoding.force-enabled", false);
 
-#ifdef MOZ_DIRECTSHOW
-pref("media.directshow.enabled", true);
-#endif
 #ifdef MOZ_FMP4
 pref("media.mp4.enabled", true);
 // Specifies whether the PDMFactory can create a test decoder that
 #endif
 // just outputs blank frames/audio instead of actually decoding. The blank
 // decoder works on all platforms.
 pref("media.use-blank-decoder", false);
 #ifdef MOZ_WMF