Bug 1328038 - Refuse to play High 4:4:4 Predictive Profile. r=JamesCheng, a=jcristau
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 03 Jan 2017 06:58:09 +1100
changeset 353676 877cfd319e73a837731275d3cd4675bc27f9b0d8
parent 353675 f273dcc18ec664cb58443c4d3bb02fd147aa4c6c
child 353677 832fbf29c8a4aa40a4c7c3be8fa687c7e8763be5
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersJamesCheng, jcristau
bugs1328038
milestone52.0a2
Bug 1328038 - Refuse to play High 4:4:4 Predictive Profile. r=JamesCheng, a=jcristau It is not supported by Windows WMF. MozReview-Commit-ID: 2OyjC0qGwD4
dom/media/platforms/PDMFactory.cpp
dom/media/platforms/wrappers/H264Converter.cpp
--- a/dom/media/platforms/PDMFactory.cpp
+++ b/dom/media/platforms/PDMFactory.cpp
@@ -122,22 +122,25 @@ public:
     AddToCheckList(
       [mimeType, extraData]() {
         if (MP4Decoder::IsH264(mimeType)) {
           mp4_demuxer::SPSData spsdata;
           // WMF H.264 Video Decoder and Apple ATDecoder
           // do not support YUV444 format.
           // For consistency, all decoders should be checked.
           if (mp4_demuxer::H264::DecodeSPSFromExtraData(extraData, spsdata) &&
-              spsdata.chroma_format_idc == PDMFactory::kYUV444) {
-            return CheckResult(SupportChecker::Reason::kVideoFormatNotSupported,
-                               MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
-                                           RESULT_DETAIL("Decoder may not have the capability to handle"
-                                                         " the requested video format"
-                                                         " with YUV444 chroma subsampling.")));
+              (spsdata.profile_idc == 244 /* Hi444PP */ ||
+               spsdata.chroma_format_idc == PDMFactory::kYUV444)) {
+            return CheckResult(
+              SupportChecker::Reason::kVideoFormatNotSupported,
+              MediaResult(
+                NS_ERROR_DOM_MEDIA_FATAL_ERR,
+                RESULT_DETAIL("Decoder may not have the capability to handle"
+                              " the requested video format"
+                              " with YUV444 chroma subsampling.")));
           }
         }
         return CheckResult(SupportChecker::Reason::kSupported);
       });
     }
   }
 
   SupportChecker::CheckResult
--- a/dom/media/platforms/wrappers/H264Converter.cpp
+++ b/dom/media/platforms/wrappers/H264Converter.cpp
@@ -176,17 +176,18 @@ H264Converter::CreateDecoder(DecoderDoct
     return NS_ERROR_NOT_INITIALIZED;
   }
   UpdateConfigFromExtraData(mCurrentConfig.mExtraData);
 
   mp4_demuxer::SPSData spsdata;
   if (mp4_demuxer::H264::DecodeSPSFromExtraData(mCurrentConfig.mExtraData, spsdata)) {
     // Do some format check here.
     // WMF H.264 Video Decoder and Apple ATDecoder do not support YUV444 format.
-    if (spsdata.chroma_format_idc == 3 /*YUV444*/) {
+    if (spsdata.profile_idc == 244 /* Hi444PP */ ||
+        spsdata.chroma_format_idc == PDMFactory::kYUV444) {
       mLastError = NS_ERROR_FAILURE;
       if (aDiagnostics) {
         aDiagnostics->SetVideoNotSupported();
       }
       return NS_ERROR_FAILURE;
     }
   } else {
     // SPS was invalid.