Bug 1215089 - P10: Enable 10/12 bits video with OGL compositor. r?mattwoodrow draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Sat, 30 Sep 2017 01:22:40 +0200
changeset 675227 48dddd4f477b6806eea211a9a9ef6a88d8516da4
parent 675226 3988cc3d26297556ae3e5e27af7dcea0aee1e1cf
child 675228 0517aa68e7ba8b64dd56d0b499e64b0fc407d3fa
push id83072
push userbmo:jyavenard@mozilla.com
push dateThu, 05 Oct 2017 01:30:32 +0000
reviewersmattwoodrow
bugs1215089
milestone58.0a1
Bug 1215089 - P10: Enable 10/12 bits video with OGL compositor. r?mattwoodrow MozReview-Commit-ID: AOSZla0ZX4S
dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -300,18 +300,20 @@ FFmpegVideoDecoder<LIBAV_VER>::DoDecode(
   }
 
   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 || (mImageAllocator->GetCompositorBackendType()
+                            != layers::LayersBackend::LAYERS_BASIC &&
+                            mImageAllocator->GetCompositorBackendType()
+                            != layers::LayersBackend::LAYERS_OPENGL))) {
     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