Bug 1215089: P2. Add mDepth member to YCbCr data structure. r?mattwoodrow draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 29 Jun 2017 23:09:20 +0200
changeset 607750 447a15709f5cad45d971a6b27ce3d89185624326
parent 607749 3cb4bc588b3f2e3182bc03627235ef2c86c9dfd8
child 607751 3c2d7fca564d85a7bc20f14586dafcffd3ad5644
push id68099
push userbmo:jyavenard@mozilla.com
push dateWed, 12 Jul 2017 20:25:16 +0000
reviewersmattwoodrow
bugs1215089
milestone56.0a1
Bug 1215089: P2. Add mDepth member to YCbCr data structure. r?mattwoodrow MozReview-Commit-ID: BNLawJOfj3w
dom/media/MediaData.cpp
dom/media/MediaData.h
gfx/layers/ImageContainer.h
--- a/dom/media/MediaData.cpp
+++ b/dom/media/MediaData.cpp
@@ -268,16 +268,17 @@ ConstructPlanarYCbCrData(const VideoInfo
   data.mCbCrStride = Cb.mStride;
   data.mCbSkip = Cb.mSkip;
   data.mCrSkip = Cr.mSkip;
   data.mPicX = aPicture.x;
   data.mPicY = aPicture.y;
   data.mPicSize = aPicture.Size();
   data.mStereoMode = aInfo.mStereoMode;
   data.mYUVColorSpace = aBuffer.mYUVColorSpace;
+  data.mDepth = aBuffer.mDepth;
   return data;
 }
 
 /* static */ bool
 VideoData::SetVideoDataToImage(PlanarYCbCrImage* aVideoImage,
                                const VideoInfo& aInfo,
                                const YCbCrBuffer &aBuffer,
                                const IntRect& aPicture,
--- a/dom/media/MediaData.h
+++ b/dom/media/MediaData.h
@@ -463,16 +463,17 @@ public:
       uint32_t mHeight;
       uint32_t mStride;
       uint32_t mOffset;
       uint32_t mSkip;
     };
 
     Plane mPlanes[3];
     YUVColorSpace mYUVColorSpace = YUVColorSpace::BT601;
+    uint32_t mDepth = 8;
   };
 
   class Listener
   {
   public:
     virtual void OnSentToCompositor() = 0;
     virtual ~Listener() { }
   };
--- a/gfx/layers/ImageContainer.h
+++ b/gfx/layers/ImageContainer.h
@@ -728,29 +728,31 @@ struct PlanarYCbCrData {
   int32_t mCbSkip;
   int32_t mCrSkip;
   // Picture region
   uint32_t mPicX;
   uint32_t mPicY;
   gfx::IntSize mPicSize;
   StereoMode mStereoMode;
   YUVColorSpace mYUVColorSpace;
+  uint32_t mDepth;
 
   gfx::IntRect GetPictureRect() const {
     return gfx::IntRect(mPicX, mPicY,
                      mPicSize.width,
                      mPicSize.height);
   }
 
   PlanarYCbCrData()
     : mYChannel(nullptr), mYStride(0), mYSize(0, 0), mYSkip(0)
     , mCbChannel(nullptr), mCrChannel(nullptr)
     , mCbCrStride(0), mCbCrSize(0, 0) , mCbSkip(0), mCrSkip(0)
     , mPicX(0), mPicY(0), mPicSize(0, 0), mStereoMode(StereoMode::MONO)
     , mYUVColorSpace(YUVColorSpace::BT601)
+    , mDepth(8)
   {}
 };
 
 /****** Image subtypes for the different formats ******/
 
 /**
  * We assume that the image data is in the REC 470M color space (see
  * Theora specification, section 4.3.1).