From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- dom/media/gmp/GMPTypes.ipdlh | 116 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 dom/media/gmp/GMPTypes.ipdlh (limited to 'dom/media/gmp/GMPTypes.ipdlh') diff --git a/dom/media/gmp/GMPTypes.ipdlh b/dom/media/gmp/GMPTypes.ipdlh new file mode 100644 index 0000000000..6cb37b6068 --- /dev/null +++ b/dom/media/gmp/GMPTypes.ipdlh @@ -0,0 +1,116 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +include "GMPMessageUtils.h"; + +using cdm::EncryptionScheme from "GMPSanitizedExports.h"; +using GMPBufferType from "gmp-video-codec.h"; + +namespace mozilla { +namespace gmp { + +// GMP processes are associated with a specific node ID, so all GMP requests +// which have the same node ID will use the same GMP process. Depending on the +// use case, the node ID may be represented by a string (such as when used for +// WebRTC) or by this structure, which is populated according to the origin +// initiating the request. This structure will eventually be converted to a +// string representing a node ID. For this structure, the process ensures the +// strings are unique for the combination of origin, top level origin and GMP +// name. +struct NodeIdParts { + nsString mOrigin; + nsString mTopLevelOrigin; + nsString mGMPName; +}; + +// A NodeIdVariant should contain either +// - A string representing an already computed node ID. +// - A NodeIdParts representing a node ID that still needs to be computed by +// processing those parts. +// This union is used to simplify passing of node ID information. Some +// GMP use cases can hard code their node ID, while others need to compute +// the node ID later. This lets us avoid having overloads to handle +// the two different paths. +union NodeIdVariant { + nsCString; + NodeIdParts; +}; + +struct GMPVideoEncodedFrameData { + uint32_t mEncodedWidth; + uint32_t mEncodedHeight; + uint64_t mTimestamp; // microseconds + uint64_t mDuration; // microseconds + uint32_t mFrameType; + uint32_t mSize; + GMPBufferType mBufferType; + Shmem mBuffer; + bool mCompleteFrame; +}; + +struct GMPPlaneData { + int32_t mSize; + int32_t mStride; + Shmem mBuffer; +}; + +struct GMPVideoi420FrameData { + GMPPlaneData mYPlane; + GMPPlaneData mUPlane; + GMPPlaneData mVPlane; + int32_t mWidth; + int32_t mHeight; + uint64_t mTimestamp; // microseconds + uint64_t? mUpdatedTimestamp; // microseconds + uint64_t mDuration; // microseconds +}; + +struct CDMInputBuffer { + Shmem mData; + uint8_t[] mKeyId; + uint8_t[] mIV; + int64_t mTimestamp; + int64_t mDuration; + uint32_t[] mClearBytes; + uint32_t[] mCipherBytes; + uint8_t mCryptByteBlock; + uint8_t mSkipByteBlock; + EncryptionScheme mEncryptionScheme; +}; + +struct CDMVideoDecoderConfig { + uint32_t mCodec; + uint32_t mProfile; + uint32_t mFormat; + int32_t mImageWidth; + int32_t mImageHeight; + uint8_t[] mExtraData; + EncryptionScheme mEncryptionScheme; +}; + +struct CDMKeyInformation { + uint8_t[] mKeyId; + uint32_t mStatus; + uint32_t mSystemCode; +}; + +struct CDMVideoPlane { + uint32_t mPlaneOffset; + uint32_t mStride; +}; + +struct CDMVideoFrame { + uint32_t mFormat; + int32_t mImageWidth; + int32_t mImageHeight; + CDMVideoPlane mYPlane; + CDMVideoPlane mUPlane; + CDMVideoPlane mVPlane; + int64_t mTimestamp; + int64_t mDuration; +}; + +} // namespace gmp +} // namespace mozilla -- cgit v1.2.3