blob: 40f166dfb592f744e281ae890dab65050a6b9930
1 | /* |
2 | * Copyright (C) 2012 The Android Open Source Project |
3 | * |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with the License. |
6 | * You may obtain a copy of the License at |
7 | * |
8 | * http://www.apache.org/licenses/LICENSE-2.0 |
9 | * |
10 | * Unless required by applicable law or agreed to in writing, software |
11 | * distributed under the License is distributed on an "AS IS" BASIS, |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | * See the License for the specific language governing permissions and |
14 | * limitations under the License. |
15 | */ |
16 | |
17 | #ifndef AM_META_DATA_EXT_H_ |
18 | |
19 | #define AM_META_DATA_EXT_H_ |
20 | |
21 | #include <sys/types.h> |
22 | |
23 | #include <stdint.h> |
24 | |
25 | #include <utils/RefBase.h> |
26 | #include <utils/KeyedVector.h> |
27 | #include <utils/String8.h> |
28 | |
29 | namespace android { |
30 | |
31 | // The following keys map to int32_t data unless indicated otherwise. |
32 | enum { |
33 | // DRM information to implement secure pipeline |
34 | kKeyDrmID = 'drID', // raw data |
35 | |
36 | // kKeyFrameRate already exists, but we want a real number like 29.97. |
37 | kKeyFrameRateQ16 = 'frQF', // int32_t (video frame rate fps in Q16) |
38 | // Key to store codec specific data. |
39 | kKeyCodecSpecific = 'cosp', // raw data |
40 | // Keys for WMA codec initialization parameters. |
41 | kKeyWMABlockAlign = 'blkA', // int32_t |
42 | kKeyWMABitsPerSample = 'btSp', // int32_t |
43 | kKeyWMAFormatTag = 'foTg', // int32_t |
44 | |
45 | // Key to pass native window to OMX components. |
46 | kKeyNativeWindow = 'nawi', // pointer |
47 | |
48 | // Key to pass CryptoInfo to player. |
49 | kKeyCryptoInfo = 'cryi', // pointer |
50 | |
51 | // Key to adjust the timing of video/audio format change notification. |
52 | kKeyFormatChangeTime = 'fctu', // int64_t (usecs) |
53 | |
54 | // Keys to pass the original PTS and DTS to the decoder component. |
55 | kKeyPTSFromContainer = 'ptsC', // int64_t (usecs) |
56 | kKeyDTSFromContainer = 'dtsC', // int64_t (usecs) |
57 | kKeyMediaTimeOffset = 'mOfs', // int64_t (usecs) |
58 | |
59 | // Keys to support various PCM formats. |
60 | kKeyPCMBitsPerSample = 'Pbps', // int32_t |
61 | kKeyPCMDataEndian = 'Pend', // int32_t (OMX_ENDIANTYPE) |
62 | kKeyPCMDataSigned = 'Psgn', // int32_t (OMX_NUMERICALDATATYPE) |
63 | |
64 | // Keys to inner subtitle support |
65 | kKeyStreamTimeBaseNum = 'tiBS', //int32_t stream time base num |
66 | kKeyStreamTimeBaseDen = 'tiDS', //int32_t stream time base den |
67 | kKeyStreamStartTime = 'stTS', //int64_t stream start time |
68 | kKeyStreamCodecID = 'cIDS', //int32_t stream codec id |
69 | kKeyStreamCodecTag = 'cTgS', //int32_t stream codec tag |
70 | kKeyPktSize = 'sizP', // int32_t avPacket size |
71 | kKeyPktPts = 'ptsP', // int64_t avPacket pts |
72 | kKeyPktDts = 'dtsP', // int64_t avPacket dts |
73 | kKeyPktDuration = 'durP', // int32_t avPacket duration |
74 | kKeyPktConvergenceDuration = 'cduP', // int64_t avPacket convergence duration |
75 | kKeyPktFirstVPts = 'VPts', // int64_t first video pts |
76 | |
77 | |
78 | // audio profile |
79 | kKeyAudioProfile = 'aprf', // int32_t |
80 | kKeyExtraData = 'exda', |
81 | kKeyExtraDataSize = 'edsz', |
82 | kKeyCodecID = 'cdid', |
83 | |
84 | //amffmpeg extended types |
85 | kKeyProgramName = 'proN', // cstring |
86 | kKeyProgramNum = 'PrgN', // int32_t |
87 | kKeyIsMVC = 'mvc ', // bool (int32_t) |
88 | kKey4kOSD = '4OSD', // bool (int32_t) |
89 | KKeyIsDV = 'isDV', // bool (int32_t) |
90 | kKeyIsFLV = 'isFV', // bool (int32_t) |
91 | |
92 | kKeyBlockAlign = 'bagn', |
93 | kKeyAudioFlag ='aufg', // audio info reported from decoder to indicate special info |
94 | kKeyDtsDecoderVer ='dtsV', |
95 | kKeyDts958Fs ='dtsF', |
96 | kKeyDts958PktSize ='dtsP', |
97 | kKeyDts958PktType ='dtsT', |
98 | kKeyDtsPcmSampsInFrmMaxFs='dtsS', |
99 | |
100 | |
101 | }; |
102 | |
103 | |
104 | namespace media { |
105 | |
106 | typedef int32_t Type; |
107 | |
108 | // Amplayer extended types. |
109 | static const int kAmlTypeBase = 8192; //extend first id. |
110 | static const Type kAudioTrackNum = kAmlTypeBase + 1; // Integer |
111 | static const Type kVideoTrackNum = kAmlTypeBase + 2; // Integer |
112 | static const Type kInnerSubtitleNum = kAmlTypeBase + 3; // Integer |
113 | static const Type kAudioCodecAllInfo = kAmlTypeBase + 4; // String |
114 | static const Type kVideoCodecAllInfo = kAmlTypeBase + 5; // String |
115 | static const Type kInnerSubtitleAllInfo = kAmlTypeBase + 6; // String |
116 | static const Type kStreamType = kAmlTypeBase + 7; // String |
117 | static const Type kPlayerType = kAmlTypeBase + 8; // Integer |
118 | |
119 | } // namespace android::media |
120 | |
121 | |
122 | } // namespace android |
123 | |
124 | #endif // AM_META_DATA_EXT_H_ |
125 |