Bug 1495025 - P6. Remove now unused paramater. r=bryce
☠☠ backed out by a22ea1fdf4cb ☠ ☠
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 04 Oct 2018 09:47:59 +0000
changeset 439547 263d4f72217465543fc7e0ecda66b8db2cd5a1d9
parent 439546 528dbc463c225f21580d651431c08b63913f2da7
child 439548 3fad68f9222d3902c97529961530db6cc9250630
push id34778
push usernbeleuzu@mozilla.com
push dateThu, 04 Oct 2018 15:22:02 +0000
treeherdermozilla-central@01634947caab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbryce
bugs1495025
milestone64.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 1495025 - P6. Remove now unused paramater. r=bryce Depends on D7316 Differential Revision: https://phabricator.services.mozilla.com/D7491
dom/media/platforms/wmf/MFTDecoder.cpp
dom/media/platforms/wmf/MFTDecoder.h
dom/media/platforms/wmf/WMFAudioMFTManager.cpp
dom/media/platforms/wmf/WMFVideoMFTManager.cpp
--- a/dom/media/platforms/wmf/MFTDecoder.cpp
+++ b/dom/media/platforms/wmf/MFTDecoder.cpp
@@ -94,17 +94,16 @@ MFTDecoder::SetMediaTypes(IMFMediaType* 
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
   GUID currentSubtype = {0};
   hr = aOutputType->GetGUID(MF_MT_SUBTYPE, &currentSubtype);
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
   hr = SetDecoderOutputType(currentSubtype,
                             aOutputType,
-                            true /* match all attributes */,
                             std::move(aCallback));
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
   hr = mDecoder->GetInputStreamInfo(0, &mInputStreamInfo);
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
   hr = SendMFTMessage(MFT_MESSAGE_NOTIFY_BEGIN_STREAMING, 0);
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
@@ -121,37 +120,35 @@ MFTDecoder::GetAttributes()
   MOZ_ASSERT(mscom::IsCurrentThreadMTA());
   RefPtr<IMFAttributes> attr;
   HRESULT hr = mDecoder->GetAttributes(getter_AddRefs(attr));
   NS_ENSURE_TRUE(SUCCEEDED(hr), nullptr);
   return attr.forget();
 }
 
 HRESULT
-MFTDecoder::FindDecoderOutputType(bool aMatchAllAttributes)
+MFTDecoder::FindDecoderOutputType()
 {
   MOZ_ASSERT(mscom::IsCurrentThreadMTA());
   MOZ_ASSERT(mOutputType, "SetDecoderTypes must have been called once");
 
-  return FindDecoderOutputTypeWithSubtype(mOutputSubType, aMatchAllAttributes);
+  return FindDecoderOutputTypeWithSubtype(mOutputSubType);
 }
 
 HRESULT
-MFTDecoder::FindDecoderOutputTypeWithSubtype(const GUID& aSubType,
-                                             bool aMatchAllAttributes)
+MFTDecoder::FindDecoderOutputTypeWithSubtype(const GUID& aSubType)
 {
   return SetDecoderOutputType(
-    aSubType, nullptr, aMatchAllAttributes, [](IMFMediaType*) { return S_OK; });
+    aSubType, nullptr, [](IMFMediaType*) { return S_OK; });
 }
 
 HRESULT
 MFTDecoder::SetDecoderOutputType(
   const GUID& aSubType,
   IMFMediaType* aTypeToUse,
-  bool aMatchAllAttributes,
   std::function<HRESULT(IMFMediaType*)>&& aCallback)
 {
   MOZ_ASSERT(mscom::IsCurrentThreadMTA());
   NS_ENSURE_TRUE(mDecoder != nullptr, E_POINTER);
 
   if (!aTypeToUse) {
     aTypeToUse = mOutputType;
   }
@@ -161,24 +158,17 @@ MFTDecoder::SetDecoderOutputType(
   RefPtr<IMFMediaType> outputType;
   UINT32 typeIndex = 0;
   while (SUCCEEDED(mDecoder->GetOutputAvailableType(
     0, typeIndex++, getter_AddRefs(outputType)))) {
     GUID outSubtype = {0};
     HRESULT hr = outputType->GetGUID(MF_MT_SUBTYPE, &outSubtype);
     NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
-    BOOL resultMatch = aSubType == outSubtype;
-
-    if (resultMatch && aMatchAllAttributes) {
-      hr = aTypeToUse->Compare(outputType, MF_ATTRIBUTES_MATCH_OUR_ITEMS,
-                               &resultMatch);
-      NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
-    }
-    if (resultMatch == TRUE) {
+    if (aSubType == outSubtype) {
       hr = aCallback(outputType);
       NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
       hr = mDecoder->SetOutputType(0, outputType, 0);
       NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
       hr = mDecoder->GetOutputStreamInfo(0, &mOutputStreamInfo);
       NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
--- a/dom/media/platforms/wmf/MFTDecoder.h
+++ b/dom/media/platforms/wmf/MFTDecoder.h
@@ -82,26 +82,24 @@ public:
 
   // Sends a flush message to the MFT. This causes it to discard all
   // input data. Use before seeking.
   HRESULT Flush();
 
   // Sends a message to the MFT.
   HRESULT SendMFTMessage(MFT_MESSAGE_TYPE aMsg, ULONG_PTR aData);
 
-  HRESULT FindDecoderOutputTypeWithSubtype(const GUID& aSubType,
-                                           bool aMatchAllAttributes);
-  HRESULT FindDecoderOutputType(bool aMatchAllAttributes);
+  HRESULT FindDecoderOutputTypeWithSubtype(const GUID& aSubType);
+  HRESULT FindDecoderOutputType();
 private:
   // Will search a suitable MediaType using aTypeToUse if set, if not will
   // use the current mOutputType.
   HRESULT SetDecoderOutputType(
     const GUID& aSubType,
     IMFMediaType* aTypeToUse,
-    bool aMatchAllAttributes,
     std::function<HRESULT(IMFMediaType*)>&& aCallback);
   HRESULT CreateOutputSample(RefPtr<IMFSample>* aOutSample);
 
   MFT_INPUT_STREAM_INFO mInputStreamInfo;
   MFT_OUTPUT_STREAM_INFO mOutputStreamInfo;
 
   RefPtr<IMFTransform> mDecoder;
 
--- a/dom/media/platforms/wmf/WMFAudioMFTManager.cpp
+++ b/dom/media/platforms/wmf/WMFAudioMFTManager.cpp
@@ -232,17 +232,17 @@ WMFAudioMFTManager::Output(int64_t aStre
   HRESULT hr;
   int typeChangeCount = 0;
   while (true) {
     hr = mDecoder->Output(&sample);
     if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT) {
       return hr;
     }
     if (hr == MF_E_TRANSFORM_STREAM_CHANGE) {
-      hr = mDecoder->FindDecoderOutputType(false /* check all attribute */);
+      hr = mDecoder->FindDecoderOutputType();
       NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
       hr = UpdateOutputType();
       NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
       // Catch infinite loops, but some decoders perform at least 2 stream
       // changes on consecutive calls, so be permissive.
       // 100 is arbitrarily > 2.
       NS_ENSURE_TRUE(typeChangeCount < 100, MF_E_TRANSFORM_STREAM_CHANGE);
       ++typeChangeCount;
--- a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
+++ b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
@@ -1082,22 +1082,21 @@ WMFVideoMFTManager::Output(int64_t aStre
       // Video stream output type change, probably geometric aperture change or
       // pixel type.
       // We must reconfigure the decoder output type.
 
       // Attempt to find an appropriate OutputType, trying in order:
       // if HW accelerated: NV12, P010, P016
       // if SW: YV12, P010, P016
       if (FAILED((hr = (mDecoder->FindDecoderOutputTypeWithSubtype(
-                    mUseHwAccel ? MFVideoFormat_NV12 : MFVideoFormat_YV12,
-                    false)))) &&
+                    mUseHwAccel ? MFVideoFormat_NV12 : MFVideoFormat_YV12)))) &&
           FAILED((hr = mDecoder->FindDecoderOutputTypeWithSubtype(
-                    MFVideoFormat_P010, false))) &&
+                    MFVideoFormat_P010))) &&
           FAILED((hr = mDecoder->FindDecoderOutputTypeWithSubtype(
-                    MFVideoFormat_P016, false)))) {
+                    MFVideoFormat_P016)))) {
         LOG("No suitable output format found");
         return hr;
       }
 
       RefPtr<IMFMediaType> outputType;
       hr = mDecoder->GetOutputMediaType(outputType);
       NS_ENSURE_TRUE(SUCCEEDED(hr), hr);