Bug 1493198 - P5. Don't restrict high bit depth images on Windows r=bryce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 26 Sep 2018 15:01:57 +0000
changeset 496759 32bb9ea9e273fa55241bcd2d9b2c399bc7f5b2bc
parent 496758 ca2d75deffe675929d377270dd65619ae1af91c7
child 496760 85c961f8eea04ad5471087e9f81cc9429b41bb2f
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbryce
bugs1493198
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 1493198 - P5. Don't restrict high bit depth images on Windows r=bryce Both D3D11 compositor and WebRender now supports 10/12 bits images. Depends on D6688 Differential Revision: https://phabricator.services.mozilla.com/D6695
dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
+++ b/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
@@ -76,25 +76,20 @@ public:
     AVCodecID codec = audioCodec != AV_CODEC_ID_NONE ? audioCodec : videoCodec;
     return !!FFmpegDataDecoder<V>::FindAVCodec(mLib, codec);
   }
 
 protected:
   bool SupportsColorDepth(gfx::ColorDepth aColorDepth,
                           DecoderDoctorDiagnostics* aDiagnostics) const override
   {
-    // We don't support bitDepth > 8 when compositor backend is D3D11.
-    // But we don't have KnowsCompositor or any object
-    // that we can ask for the layersbackend type.
-    // We should remove this restriction until
-    // we solve the D3D11 compositor backend issue.
-#if defined(XP_LINUX) || defined(XP_MACOSX)
+#if defined(MOZ_WIDGET_ANDROID)
+    return aColorDepth == gfx::ColorDepth::COLOR_8;
+#endif
     return true;
-#endif
-    return aColorDepth == gfx::ColorDepth::COLOR_8;
   }
 
 private:
   FFmpegLibWrapper* mLib;
 };
 
 } // namespace mozilla
 
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -232,32 +232,16 @@ FFmpegVideoDecoder<LIBAV_VER>::DoDecode(
 
   if (!decoded) {
     if (aGotFrame) {
       *aGotFrame = false;
     }
     return NS_OK;
   }
 
-  if ((mCodecContext->pix_fmt == AV_PIX_FMT_YUV420P10LE ||
-       mCodecContext->pix_fmt == AV_PIX_FMT_YUV444P10LE
-#if LIBAVCODEC_VERSION_MAJOR >= 57
-       || mCodecContext->pix_fmt == AV_PIX_FMT_YUV444P12LE
-#endif
-       ) &&
-      (!mImageAllocator || (mImageAllocator->GetCompositorBackendType()
-                            != layers::LayersBackend::LAYERS_BASIC &&
-                            mImageAllocator->GetCompositorBackendType()
-                            != layers::LayersBackend::LAYERS_OPENGL &&
-                            mImageAllocator->GetCompositorBackendType()
-                            != layers::LayersBackend::LAYERS_D3D11))) {
-    return MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
-                       RESULT_DETAIL("unsupported format type (hdr)"));
-  }
-
   // If we've decoded a frame then we need to output it
   int64_t pts = mPtsContext.GuessCorrectPts(mFrame->pkt_pts, mFrame->pkt_dts);
   // Retrieve duration from dts.
   // We use the first entry found matching this dts (this is done to
   // handle damaged file with multiple frames with the same dts)
 
   int64_t duration;
   if (!mDurationMap.Find(mFrame->pkt_dts, duration)) {