summaryrefslogtreecommitdiffstats
path: root/dom/media/gmp/GMPTypes.ipdlh
blob: 44df5fc3d720bfe962e7bf91972bdffd0d4a2518 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/* -*- 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/. */

using GMPBufferType from "gmp-video-codec.h";
using GMPAudioCodecType from "gmp-audio-codec.h";
using GMPMediaKeyStatus from "gmp-decryption.h";

namespace mozilla {
namespace gmp {

struct GMPDecryptionData {
  uint8_t[] mKeyId;
  uint8_t[] mIV;
  uint16_t[] mClearBytes;
  uint32_t[] mCipherBytes;
  nsCString[] mSessionIds;
};

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;
  GMPDecryptionData mDecryptionData;
};

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 mDuration; // microseconds
};

struct GMPAudioCodecData
{
  GMPAudioCodecType mCodecType;
  uint32_t mChannelCount;
  uint32_t mBitsPerChannel;
  uint32_t mSamplesPerSecond;

  uint8_t[] mExtraData;
};

struct GMPAudioEncodedSampleData
{
  uint8_t[] mData;
  uint64_t mTimeStamp; // microseconds.
  GMPDecryptionData mDecryptionData;
  uint32_t mChannelCount;
  uint32_t mSamplesPerSecond;
};

struct GMPAudioDecodedSampleData
{
  int16_t[] mData;
  uint64_t mTimeStamp; // microseconds.
  uint32_t mChannelCount;
  uint32_t mSamplesPerSecond;
};

struct GMPKeyInformation {
  uint8_t[] keyId;
  GMPMediaKeyStatus status;
};

}
}