Bug 1521370 - Remove unused method. r=mattwoodrow
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 13 Mar 2019 01:50:41 +0000
changeset 524658 15e52cb0872dd7b926fa48b6714076e3ca583b8c
parent 524657 6ee4b21eb0e0fef64130e6377d1d54c3b7721fb4
child 524659 ee3013ee7a6d5ed6025796836a81c7fdda7014b7
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1521370
milestone67.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 1521370 - Remove unused method. r=mattwoodrow Differential Revision: https://phabricator.services.mozilla.com/D22624
dom/media/platforms/wmf/MFTDecoder.cpp
dom/media/platforms/wmf/MFTDecoder.h
--- a/dom/media/platforms/wmf/MFTDecoder.cpp
+++ b/dom/media/platforms/wmf/MFTDecoder.cpp
@@ -30,50 +30,16 @@ MFTDecoder::Create(const GUID& aMFTClsID
   hr = CoCreateInstance(
       aMFTClsID, nullptr, CLSCTX_INPROC_SERVER,
       IID_PPV_ARGS(static_cast<IMFTransform**>(getter_AddRefs(mDecoder))));
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
   return S_OK;
 }
 
-// Helper function to create a COM object instance from a DLL.
-static HRESULT CreateCOMObjectFromDll(HMODULE aDLL, const CLSID& aCLSId,
-                                      const IID& aIID, void** aObject) {
-  if (!aDLL || !aObject) {
-    return E_INVALIDARG;
-  }
-  using GetClassObject =
-      HRESULT(WINAPI*)(const CLSID& clsid, const IID& iid, void** object);
-
-  GetClassObject getClassObject = reinterpret_cast<GetClassObject>(
-      GetProcAddress(aDLL, "DllGetClassObject"));
-  NS_ENSURE_TRUE(getClassObject, E_FAIL);
-
-  RefPtr<IClassFactory> factory;
-  HRESULT hr = getClassObject(
-      aCLSId,
-      IID_PPV_ARGS(static_cast<IClassFactory**>(getter_AddRefs(factory))));
-  NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
-
-  hr = factory->CreateInstance(NULL, aIID, aObject);
-  return hr;
-}
-
-HRESULT
-MFTDecoder::Create(HMODULE aDecoderDLL, const GUID& aMFTClsID) {
-  // Create the IMFTransform to do the decoding.
-  HRESULT hr = CreateCOMObjectFromDll(
-      aDecoderDLL, aMFTClsID,
-      IID_PPV_ARGS(static_cast<IMFTransform**>(getter_AddRefs(mDecoder))));
-  NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
-
-  return S_OK;
-}
-
 HRESULT
 MFTDecoder::SetMediaTypes(IMFMediaType* aInputType, IMFMediaType* aOutputType,
                           std::function<HRESULT(IMFMediaType*)>&& aCallback) {
   MOZ_ASSERT(mscom::IsCurrentThreadMTA());
 
   // Set the input type to the one the caller gave us...
   HRESULT hr = mDecoder->SetInputType(0, aInputType, 0);
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
--- a/dom/media/platforms/wmf/MFTDecoder.h
+++ b/dom/media/platforms/wmf/MFTDecoder.h
@@ -23,17 +23,16 @@ class MFTDecoder final {
   MFTDecoder();
 
   // Creates the MFT. First thing to do as part of setup.
   //
   // Params:
   //  - aMFTClsID the clsid used by CoCreateInstance to instantiate the
   //    decoder MFT.
   HRESULT Create(const GUID& aMFTClsID);
-  HRESULT Create(HMODULE aDecoderDLL, const GUID& aMFTClsID);
 
   // Sets the input and output media types. Call after Init().
   //
   // Params:
   //  - aInputType needs at least major and minor types set.
   //  - aOutputType needs at least major and minor types set.
   //    This is used to select the matching output type out
   //    of all the available output types of the MFT.