Bug 1397141 - part3 : remove the minimum resolution checking. draft
authorAlastor Wu <alwu@mozilla.com>
Mon, 11 Sep 2017 17:44:27 +0800
changeset 662297 7513820494d34d219baa4c0f708f5aeef4b62f32
parent 662296 14c91d03ff823dad77bf8789ae43345a14cac1a6
child 662298 812c2d117fdd6adc2af0338867e4ceb3c6baa76d
push id79016
push useralwu@mozilla.com
push dateMon, 11 Sep 2017 10:00:32 +0000
bugs1397141, 1392143
milestone57.0a1
Bug 1397141 - part3 : remove the minimum resolution checking. After bug1392143, we won't enable HW decoding for the resolution < 132 pixels. In addition, software decoder doesn't have the minimum resolution limitation, so we can remove this constraint. MozReview-Commit-ID: 7MiLpwjiq3s
dom/media/platforms/wmf/WMFVideoMFTManager.cpp
--- a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
+++ b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
@@ -554,41 +554,30 @@ WMFVideoMFTManager::InitializeDXVA()
   mDXVA2Manager = event->mDXVA2Manager;
 
   return mDXVA2Manager != nullptr;
 }
 
 MediaResult
 WMFVideoMFTManager::ValidateVideoInfo()
 {
-  // The WMF H.264 decoder is documented to have a minimum resolution
-  // 48x48 pixels. We've observed the decoder working for output smaller than
-  // that, but on some output it hangs in IMFTransform::ProcessOutput(), so
-  // we just reject streams which are less than the documented minimum.
+  // The WMF H.264 decoder is documented to have a minimum resolution 48x48 pixels
+  // for hw decoder, but we won't enable hw decoding for the resolution < 132 pixels.
+  // Software decoder doesn't have the minimum limitation, but it still has
+  // maximum resolution limitation.
   // https://msdn.microsoft.com/en-us/library/windows/desktop/dd797815(v=vs.85).aspx
   const bool Is4KCapable = IsWin8OrLater() || IsWin7H264Decoder4KCapable();
-  static const int32_t MIN_H264_FRAME_DIMENSION = 48;
   static const int32_t MAX_H264_FRAME_WIDTH = Is4KCapable ? 4096 : 1920;
   static const int32_t MAX_H264_FRAME_HEIGHT = Is4KCapable ? 2304 : 1088;
 
   if (mStreamType != H264 ||
       gfxPrefs::PDMWMFAllowUnsupportedResolutions()) {
     return MediaResult(NS_OK);
   }
 
-  // TODO : remove minimum resolution check in following patch.
-  if (mStreamType == H264 &&
-      (mVideoInfo.mImage.width < MIN_H264_FRAME_DIMENSION ||
-       mVideoInfo.mImage.height < MIN_H264_FRAME_DIMENSION)) {
-    mIsValid = false;
-    return MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
-                       RESULT_DETAIL("Can't decode H.264 stream with width or "
-                                     "height less than 48 pixels."));
-  }
-
   if (mVideoInfo.mImage.width > MAX_H264_FRAME_WIDTH  ||
       mVideoInfo.mImage.height > MAX_H264_FRAME_HEIGHT) {
     mIsValid = false;
     return MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
                        RESULT_DETAIL("Can't decode H.264 stream because its "
                                      "resolution is out of the maximum limitation"));
   }