Bug 1208348 - Backout 9f73b03732fc
authorChris Pearce <cpearce@mozilla.com>
Mon, 28 Sep 2015 17:11:24 +1300
changeset 264606 fe8c6a231e794a389ec7690de476cf16a8b68555
parent 264605 005e98e2c5c9e04d7bb8b982a00b6f8d7a0ebe9f
child 264607 ac303706f7148c8cfd830d9bf3c4e7064641e00f
push id65691
push usercpearce@mozilla.com
push dateMon, 28 Sep 2015 04:11:37 +0000
treeherdermozilla-inbound@fe8c6a231e79 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1208348
milestone44.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 1208348 - Backout 9f73b03732fc
dom/media/directshow/DirectShowDecoder.cpp
dom/media/directshow/DirectShowUtils.cpp
dom/media/directshow/DirectShowUtils.h
--- a/dom/media/directshow/DirectShowDecoder.cpp
+++ b/dom/media/directshow/DirectShowDecoder.cpp
@@ -40,18 +40,17 @@ DirectShowDecoder::GetSupportedCodecs(co
 
   return false;
 }
 
 /* static */
 bool
 DirectShowDecoder::IsEnabled()
 {
-  return CanDecodeMP3UsingDirectShow() &&
-         Preferences::GetBool("media.directshow.enabled");
+  return Preferences::GetBool("media.directshow.enabled");
 }
 
 DirectShowDecoder::DirectShowDecoder()
 {
   MOZ_COUNT_CTOR(DirectShowDecoder);
 }
 
 DirectShowDecoder::~DirectShowDecoder()
--- a/dom/media/directshow/DirectShowUtils.cpp
+++ b/dom/media/directshow/DirectShowUtils.cpp
@@ -203,18 +203,20 @@ CreateAndAddFilter(IGraphBuilder* aGraph
   }
 
   filter.forget(aOutFilter);
 
   return S_OK;
 }
 
 HRESULT
-CreateMP3DMOWrapperFilter(IBaseFilter **aOutFilter)
+AddMP3DMOWrapperFilter(IGraphBuilder* aGraph,
+                       IBaseFilter **aOutFilter)
 {
+  NS_ENSURE_TRUE(aGraph, E_POINTER);
   NS_ENSURE_TRUE(aOutFilter, E_POINTER);
   HRESULT hr;
 
   // Create the wrapper filter.
   nsRefPtr<IBaseFilter> filter;
   hr = CoCreateInstance(CLSID_DMOWrapperFilter,
                         nullptr,
                         CLSCTX_INPROC_SERVER,
@@ -238,73 +240,28 @@ CreateMP3DMOWrapperFilter(IBaseFilter **
   if (FAILED(hr)) {
     // Can't instantiate MP3 DMO. It doesn't exist on Windows XP, we're
     // probably hitting that. Don't log warning to console, this is an
     // expected error.
     WARN("dmoWrapper Init failed, hr=%x", hr);
     return hr;
   }
 
-  return S_OK;
-}
-
-HRESULT
-AddMP3DMOWrapperFilter(IGraphBuilder* aGraph,
-                       IBaseFilter **aOutFilter)
-{
-  NS_ENSURE_TRUE(aGraph, E_POINTER);
-  NS_ENSURE_TRUE(aOutFilter, E_POINTER);
-  HRESULT hr;
-
-  // Create the wrapper filter.
-  nsRefPtr<IBaseFilter> filter;
-  hr = CreateMP3DMOWrapperFilter(getter_AddRefs(filter));
-  NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
-
   // Add the wrapper filter to graph.
   hr = aGraph->AddFilter(filter, L"MP3 Decoder DMO");
   if (FAILED(hr)) {
     WARN("AddFilter failed, hr=%x", hr);
     return hr;
   }
 
   filter.forget(aOutFilter);
 
   return S_OK;
 }
 
-bool
-CanDecodeMP3UsingDirectShow()
-{
-  nsRefPtr<IBaseFilter> filter;
-
-  // Can we create the MP3 demuxer filter?
-  if (FAILED(CoCreateInstance(CLSID_MPEG1Splitter,
-                              nullptr,
-                              CLSCTX_INPROC_SERVER,
-                              IID_IBaseFilter,
-                              getter_AddRefs(filter)))) {
-    return false;
-  }
-
-  // Can we create either the WinXP MP3 decoder filter or the MP3 DMO decoder?
-  if (FAILED(CoCreateInstance(CLSID_MPEG_LAYER_3_DECODER_FILTER,
-                              nullptr,
-                              CLSCTX_INPROC_SERVER,
-                              IID_IBaseFilter,
-                              getter_AddRefs(filter))) &&
-      FAILED(CreateMP3DMOWrapperFilter(getter_AddRefs(filter)))) {
-    return false;
-  }
-
-  // Else, we can create all of the components we need. Assume
-  // DirectShow is going to work...
-  return true;
-}
-
 // Match a pin by pin direction and connection state.
 HRESULT
 MatchUnconnectedPin(IPin* aPin,
                     PIN_DIRECTION aPinDir,
                     bool *aOutMatches)
 {
   NS_ENSURE_TRUE(aPin, E_POINTER);
   NS_ENSURE_TRUE(aOutMatches, E_POINTER);
--- a/dom/media/directshow/DirectShowUtils.h
+++ b/dom/media/directshow/DirectShowUtils.h
@@ -110,16 +110,11 @@ inline double
 RefTimeToSeconds(const REFERENCE_TIME aRefTime)
 {
   return double(aRefTime) / 10000000;
 }
 
 const char*
 GetDirectShowGuidName(const GUID& aGuid);
 
-// Returns true if we can instantiate an MP3 demuxer and decoder filters.
-// Use this to detect whether MP3 support is installed.
-bool
-CanDecodeMP3UsingDirectShow();
-
 } // namespace mozilla
 
 #endif