summaryrefslogtreecommitdiff
path: root/dom/media/MediaData.h
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/MediaData.h')
-rw-r--r--dom/media/MediaData.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/dom/media/MediaData.h b/dom/media/MediaData.h
index dc93c84872..02a7162f42 100644
--- a/dom/media/MediaData.h
+++ b/dom/media/MediaData.h
@@ -474,6 +474,17 @@ public:
int64_t aTimecode,
const IntRect& aPicture);
+ static already_AddRefed<VideoData> CreateAndCopyData(const VideoInfo& aInfo,
+ ImageContainer* aContainer,
+ int64_t aOffset,
+ int64_t aTime,
+ int64_t aDuration,
+ const YCbCrBuffer &aBuffer,
+ const YCbCrBuffer::Plane &aAlphaPlane,
+ bool aKeyframe,
+ int64_t aTimecode,
+ const IntRect& aPicture);
+
static already_AddRefed<VideoData> CreateAndCopyIntoTextureClient(const VideoInfo& aInfo,
int64_t aOffset,
int64_t aTime,
@@ -622,15 +633,22 @@ private:
class MediaRawData : public MediaData {
public:
MediaRawData();
- MediaRawData(const uint8_t* aData, size_t mSize);
+ MediaRawData(const uint8_t* aData, size_t aSize);
+ MediaRawData(const uint8_t* aData, size_t aSize,
+ const uint8_t* aAlphaData, size_t aAlphaSize);
// Pointer to data or null if not-yet allocated
const uint8_t* Data() const { return mBuffer.Data(); }
+ // Pointer to alpha data or null if not-yet allocated
+ const uint8_t* AlphaData() const { return mAlphaBuffer.Data(); }
// Size of buffer.
size_t Size() const { return mBuffer.Length(); }
+ size_t AlphaSize() const { return mAlphaBuffer.Length(); }
size_t ComputedSizeOfIncludingThis() const
{
- return sizeof(*this) + mBuffer.ComputedSizeOfExcludingThis();
+ return sizeof(*this)
+ + mBuffer.ComputedSizeOfExcludingThis()
+ + mAlphaBuffer.ComputedSizeOfExcludingThis();
}
// Access the buffer as a Span.
operator Span<const uint8_t>() { return MakeSpan(Data(), Size()); }
@@ -661,6 +679,7 @@ protected:
private:
friend class MediaRawDataWriter;
AlignedByteBuffer mBuffer;
+ AlignedByteBuffer mAlphaBuffer;
CryptoSample mCryptoInternal;
MediaRawData(const MediaRawData&); // Not implemented
};