xref: /OK3568_Linux_fs/external/rockit/tgi/sdk/include/RTMediaMetaKeys.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Copyright 2018 Rockchip Electronics Co. LTD
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  * author: martin.cheng@rock-chips.com
17  *   date: 20181226
18  * Module: audio/video/subtitle track's kKeys for metadata.
19  */
20 
21 #ifndef INCLUDE_RT_MEDIA_RTMEDIAMETAKEYS_H_
22 #define INCLUDE_RT_MEDIA_RTMEDIAMETAKEYS_H_
23 
24 enum {
25     /* media format features */
26     kKeyFormatDuration   = MKTAG('f', 'd', 'u', 'r'),  // UINT64
27     kKeyFormatEOS        = MKTAG('f', 'e', 'o', 's'),
28     kKeyFormatUri        = MKTAG('f', 'u', 'r', 'i'),
29     kKeyUriHeaders       = MKTAG('u', 'r', 'h', 'd'),
30     kKeyProtocol         = MKTAG('p', 't', 'c', 'l'),
31     kKeyTimeBaseNum      = MKTAG('t', 'i', 'b', 'n'),
32     kKeyTimeBaseDen      = MKTAG('t', 'i', 'b', 'd'),
33     kKeyPlaySpeed        = MKTAG('p', 'l', 's', 'p'),  // float
34     kKeyStartTime        = MKTAG('s', 't', 't', 'm'),  // INT64
35 
36     /* common track features*/
37     kKeyCodecType        = MKTAG('c', 't', 'y', 'p'),
38     kKeyCodecID          = MKTAG('c', 'c', 'i', 'd'),
39     kKeyCodecOriginID    = MKTAG('c', 'o', 'i', 'd'),
40     kKeyCodecProfile     = MKTAG('c', 'p', 'r', 'o'),
41     kKeyCodecLevel       = MKTAG('c', 'l', 'e', 'v'),
42     kKeyCodecFormat      = MKTAG('c', 'f', 'o', 'r'),
43     kKeyCodecTag         = MKTAG('c', 't', 'a', 'g'),
44     kKeyCodecBitrate     = MKTAG('c', 'b', 'i', 't'),  // INT64
45     kKeyCodecExtraData   = MKTAG('v', 'd', 'a', 't'),  // void *
46     kKeyCodecExtraSize   = MKTAG('v', 's', 'i', 'z'),  // INT32
47     kKeyCodecError       = MKTAG('c', 'e', 'r', 'r'),
48 
49     /* video track features*/
50     kKeyVCodecWidth          = MKTAG('v', 'w', 'i', 'd'),
51     kKeyVCodecHeight         = MKTAG('v', 'h', 'e', 'i'),
52     kKeyVCodecVideoDelay     = MKTAG('v', 'v', 'd', 'e'),  // INT32
53     kKeyVCodecFrameRate      = MKTAG('v', 'f', 'r', 'a'),  // INT32 23.976 x 1000
54     kKeyVCodecFieldOrder     = MKTAG('v', 'f', 'i', 'e'),  // INT32
55     kKeyVCodecColorRange     = MKTAG('v', 'c', 'r', 'a'),  // INT32
56     kKeyVCodecColorPrimary   = MKTAG('v', 'c', 'p', 'r'),  // INT32
57     kKeyVCodecColorTransfer  = MKTAG('v', 'c', 't', 'r'),  // INT32
58     kKeyVCodecColorSpace     = MKTAG('v', 'c', 's', 'p'),  // INT32
59     kKeyVCodecChromaLocation = MKTAG('v', 'c', 'l', 'o'),  // INT32
60     kKeyVCodecBufferCount    = MKTAG('v', 'c', 'b', 'c'),  // INT32
61     kKeyVCodecBufferSize     = MKTAG('v', 'c', 'b', 's'),  // INT32
62 
63     /* video extra features*/
64     kKeyVCodecGopSize        = MKTAG('g', 'p', 's', 'z'),  // INT32 encoder feature
65     kKeyVCodecMaxBFrames     = MKTAG('m', 'b', 'f', 'm'),  // INT32 encoder feature
66     kKeyVCodecRCMode         = MKTAG('v', 'r', 'c', 'm'),  // INT32 encoder feature
67     kKeyVCodecQP             = MKTAG('v', 'c', 'q', 'p'),  // INT32 encoder feature
68     kKeyVCodecSurfaceCB      = MKTAG('v', 'c', 's', 'b'),  // void *
69     kKeyVCodecRotation       = MKTAG('v', 'r', 't', 'e'),  // INT32
70     kKeyVCodecFlagExtractor  = MKTAG('v', 'c', 'f', 'e'),  // INT32
71     kKeyVMaxInputBufferCnt   = MKTAG('v', 'x', 'i', 'b'),  // INT32
72     kKeyVMaxOutputBufferCnt  = MKTAG('v', 'x', 'o', 'b'),  // INT32
73     kKeyVMinOutputBufferCnt  = MKTAG('v', 'n', 'o', 'b'),  // INT32
74 
75     /* audio track features*/
76     kKeyACodecChanneLayout      = MKTAG('a', 'c', 'l', 't'),
77     kKeyACodecChannels          = MKTAG('a', 'd', 'h', 's'),
78     kKeyACodecSampleRate        = MKTAG('a', 's', 'r', 'e'),
79     kKeyACodecBlockAlign        = MKTAG('a', 'e', 'b', 'n'),
80     kKeyACodecFrameSize         = MKTAG('a', 'd', 'f', 'e'),
81     kKeyACodecInitialPadding    = MKTAG('a', 's', 'r', 'g'),
82     kKeyACodecTrailinglPadding  = MKTAG('a', 'e', 't', 'p'),
83     kKeyACodecBitPerCodedSample = MKTAG('a', 'b', 'p', 'c'),
84     kKeyAUseSoftVol             = MKTAG('a', 'u', 's', 'd'),
85     kKeyAudioFormat             = MKTAG('a', 'f', 'm', 't'),
86     kkeyAudioAECTrans           = MKTAG('a', 'a', 't', 's'),
87 
88     /* subtitle track features */
89     kKeySCodecLanguage      = MKTAG('s', 'l', 'a', 'n'),  // char*
90     kKeySCodecEncoding      = MKTAG('s', 'e', 'n', 'g'),  // INT32
91     kKeyCharsetName         = MKTAG('s', 'c', 's', 'n'),  // char*
92     kKeySSourceFrom         = MKTAG('s', 'f', 'r', 'm'),  // INT32
93     kKeySubVisible          = MKTAG('s', 'v', 'b', 'l'),  // INT32
94 
95     /* RTFrame */
96     kKeyFrameType        = MKTAG('f', 't', 'y', 'e'),   // INT32
97     kKeyFieldOrder       = MKTAG('f', 'f', 'o', 'r'),   // INT32
98     kKeyFrameW           = MKTAG('f', 'w', 'i', 'd'),   // INT32
99     kKeyFrameH           = MKTAG('f', 'h', 'e', 'i'),   // INT32
100     kKeyFramePts         = MKTAG('f', 'p', 't', 's'),   // INT64 AVPacket pts
101     kKeyFrameDts         = MKTAG('f', 'd', 't', 's'),   // INT64 AVPacket dts
102     kKeyFrameEOS         = MKTAG('p', 'e', 'o', 's'),   // INT32 EOS
103     kKeyFrameDuration    = MKTAG('d', 'u', 'r', 't'),   // INT32
104     kKeyFrameError       = MKTAG('f', 'e', 'r', 'r'),   // INT32 Frame Error
105     kKeyFrameSequence    = MKTAG('f', 's', 'e', 'q'),   // INT32 Frame Sequence
106     kKeyDisplayW         = MKTAG('d', 'w', 'i', 'd'),   // INT32
107     kKeyDisplayH         = MKTAG('d', 'h', 'e', 'i'),   // INT32
108 
109     /* RTPacket */
110     kKeyPacketPtr        = MKTAG('a', 'v', 'p', 't'),   // AVPacket
111     kKeyPacketPts        = MKTAG('p', 'p', 't', 's'),   // INT64 AVPacket dts
112     kKeyPacketDts        = MKTAG('p', 'd', 't', 's'),   // INT64 AVPacket pts
113     kKeyPacketPos        = MKTAG('p', 'p', 'o', 's'),   // INT64 AVPacket pos
114     kKeyPacketSize       = MKTAG('p', 's', 'i', 'z'),   // INT32 AVPacket size
115     kKeyPacketFlag       = MKTAG('p', 'f', 'l', 'g'),   // INT32 AVPacket flag
116     kKeyPacketIndex      = MKTAG('p', 'i', 'd', 'x'),   // INT32 AVPacket index
117     kKeyPacketData       = MKTAG('p', 'd', 'a', 't'),   // AVPacket data
118     kKeyPacketEOS        = MKTAG('p', 'e', 'o', 's'),   // INT32 EOS
119     kKeyPacketIsExtra    = MKTAG('p', 'i', 'e', 'e'),   // INT32 is extradata
120     kKeyPacketSerial     = MKTAG('p', 's', 'e', 'r'),   // INT32 AVPacket serial
121     kKeyPacketDuration   = MKTAG('p', 'd', 'u', 'r'),   // INT32 AVPacket duration
122     // memory features
123     kKeyMemAlign            = MKTAG('m', 'e', 'a', 'l'),  // INT32
124     kKeyMemMapFlags         = MKTAG('m', 'm', 'f', 'g'),  // INT32
125     kKeyMemHeapFlags        = MKTAG('m', 'h', 'f', 'g'),  // INT32
126     kKeyMemUsage            = MKTAG('m', 'e', 'u', 's'),  // INT32
127 
128     /* command options */
129     kKeySeekTimeUs          = MKTAG('s', 't', 'u', 's'),  // INT64
130     kKeySeekMode            = MKTAG('s', 'm', 'o', 'd'),  // INT32
131 
132     /* media cache options */
133     kKeyMaxCacheSize        = MKTAG('m', 'c', 's', 'z'),  // INT32
134     kKeyHighCacheUs         = MKTAG('h', 'c', 'u', 's'),  // INT64
135     kKeyLowCacheUs          = MKTAG('l', 'c', 'u', 's'),  // INT64
136     kKeyResumeCacheUs       = MKTAG('r', 'c', 'u', 's'),  // INT64
137     kKeyAudioBitrate        = MKTAG('a', 'b', 't', 'r'),  // INT32
138     kKeyVideoBitrate        = MKTAG('v', 'b', 't', 'r'),  // INT32
139 
140     /*audio setting features*/
141     kKeyASettingDecoderPtr  = MKTAG('a', 's', 'd', 'p'),  // void *
142     kKeyASettingBistreamPtr = MKTAG('a', 's', 'b', 'r'),  // void *
143     kKeyACodecOutputMode    = MKTAG('a', 'c', 'o', 'm'),  // INT32
144     kKeyACodecBufferDelay   = MKTAG('a', 'c', 'd', 't'),  // INT32
145 
146     /*video setting features*/
147     kKeyVSettingResolutionPtr  = MKTAG('v', 's', 'r', 'p'),  // void *
148     kKeyVSettingBitdepth       = MKTAG('v', 's', 'b', 'h'),  // INT32
149     kKeyVSettingHdr            = MKTAG('v', 's', 'h', 'r'),  // INT32
150     kKeyVSettingCodecPtr       = MKTAG('v', 's', 'c', 't'),  // void *
151 
152     /* tracks infor for cache features*/
153     kKeyTrackNum               = MKTAG('t', 'n', 'u', 'm'),  // INT32 the default number of tracks
154     kKeyTrackCacheSize         = MKTAG('t', 'c', 's', 'z'),  // INT32 the max cache size of every track
155 
156     /* user's invoke/getparameter/setparameter command*/
157     kUserInvokeCmd             = MKTAG('u', 'c', 'm', 'd'),
158     kUserInvokeTracksCount     = MKTAG('t', 'c', 'n', 't'),
159     kUserInvokeTracksInfor     = MKTAG('t', 'i', 'n', 'f'),
160     kUserInvokeTracksIdx       = MKTAG('t', 'i', 'd', 'x'),
161     kUserInvokeGetSelectTrack  = MKTAG('t', 's', 'l', 'e'),
162     kUserInvokeVideoScallingMode  = MKTAG('v', 's', 'm', 'd'),
163     kUserInvokeSetPlaybackRate = MKTAG('i', 'p', 'b', 'r'),   // float
164 
165     /* user's notify command*/
166     kUserNotifyPts             = MKTAG('u', 'n', 'p', 's'),
167     kUserNotifySize            = MKTAG('u', 'n', 's', 'e'),
168     kUserNotifyData            = MKTAG('u', 'n', 'd', 'a'),
169     kKeyDataSource             = MKTAG('v', 'd', 's', 'c'),
170     /* post-processing */
171     kKeyIepI4O2                = MKTAG('f', 'i', 'i', 't'),     // INT32 is iep I4O2
172 
173     /* for android media */
174     kKeyFrameIndex             = MKTAG('f', 'i', 'd', 'x'),     // INT32
175 
176     /* setting command */
177     kKeySettingQueryCmd        = MKTAG('s', 'q', 'u', 'y'),
178 
179     /* meta data retriever*/
180     kRetrieverKey              = MKTAG('r', 'k', 'e', 'y'),
181     kRetrieverFrameAtTime      = MKTAG('r', 'f', 'a', 't'),
182     kRetrieverFrameOption      = MKTAG('r', 'f', 'f', 'o'),
183     kRetrieverDstColorFormat   = MKTAG('r', 'd', 'c', 'f'),
184     kRetrieverFrameMetaOnly    = MKTAG('r', 'f', 'm', 'o'),
185     kRetrieverFrameNumber      = MKTAG('r', 'f', 'n', 'u'),
186     kRetrieverReadMaxTime      = MKTAG('r', 'r', 'm', 't'),
187     kRetrieverAlbumArtData     = MKTAG('r', 'a', 'a', 'd'),
188     kRetrieverAlbumArtDataSize = MKTAG('r', 'a', 'a', 's'),
189     kRetrieverCallbackContext  = MKTAG('r', 'c', 'b', 'c'),
190     kRetrieverBufferAddress    = MKTAG('r', 'b', 'a', 'r'),
191 
192     kRetrieverKeyMIMEType      = MKTAG('r', 'm', 'i', 't'),
193     kRetrieverKeyCDTrackNumber = MKTAG('r', 'c', 't', 'n'),
194     kRetrieverKeyDiscNumber    = MKTAG('r', 'd', 'i', 'n'),
195     kRetrieverKeyAlbum         = MKTAG('r', 'a', 'l', 'b'),
196     kRetrieverKeyArtist        = MKTAG('r', 'a', 'r', 't'),
197     kRetrieverKeyAlbumArtist   = MKTAG('r', 'a', 'a', 't'),
198     kRetrieverKeyAuthor        = MKTAG('r', 'a', 'u', 't'),
199     kRetrieverKeyComposer      = MKTAG('r', 'c', 'o', 'm'),
200     kRetrieverKeyDate          = MKTAG('r', 'd', 'a', 't'),
201     kRetrieverKeyGenre         = MKTAG('r', 'g', 'e', 'n'),
202     kRetrieverKeyTitle         = MKTAG('r', 't', 'i', 't'),
203     kRetrieverKeyYear          = MKTAG('r', 'y', 'e', 'r'),
204     kRetrieverKeyWriter        = MKTAG('r', 'w', 'r', 'i'),
205     kRetrieverKeyCompilation   = MKTAG('r', 'c', 'p', 'l'),
206     kRetrieverKeyLocation      = MKTAG('r', 'l', 'o', 'c'),
207     kRetrieverKeyDuration      = MKTAG('r', 'd', 'u', 'r'),
208 
209     /* for new pipeline */
210     kKeyPipeInvokeCmd          = MKTAG('p', 'c', 'm', 'd'),    // const char *
211     kKeyTaskNodeId             = MKTAG('t', 'n', 'i', 'd'),    // INT32
212     kKeyMediaConfig            = MKTAG('m', 'c', 'f', 'g'),    // INT32
213 };
214 
215 enum {
216     /* user-level configuration for Media(AV) development and debugging */
217     kKeyUserMediaSync          =  MKTAG('u', 'r', 'm', 's'),    // UINT32
218     kKeyUserMediaLastFrame     =  MKTAG('u', 'm', 'l', 'f'),    // UINT32
219     kKeyUserMediaSyncNone      =  MKTAG('u', 'm', 's', 'n'),    // UINT32
220 
221     /* user-level configuration for audio development and debugging */
222     kKeyUserAudioCodecNone     =  MKTAG('u', 'a', 'c', 'n'),    // UINT32
223 
224     /* user-level configuration for video development and debugging */
225     kKeyUserVideoCodecPrior    =  MKTAG('u', 'v', 'c', 'p'),    // UINT32
226     kKeyUserVideoCodecNone     =  MKTAG('u', 'v', 'h', 'n'),    // UINT32
227     kKeyUserVideoRefFrameMIN   =  MKTAG('u', 'v', 'r', 'f'),    // UINT32
228     kKeyUserVideoRefFrameIN    =  MKTAG('u', 'v', 'f', 'i'),    // UINT32
229     kKeyUserVideoRefFrameNum   =  MKTAG('u', 'v', 'f', 'o'),    // UINT32
230 
231     /* system-level persistent configuration */
232     kKeySysVideoDecoderSupport    =  MKTAG('s', 'v', 'd', 's'),    // UINT32
233     kKeySysVideoEncoderSupport    =  MKTAG('s', 'v', 'e', 's'),    // UINT32
234     kKeySysAudioOutputMode        =  MKTAG('s', 'a', 'o', 'm'),    // UINT32
235     kKeySysChipName               =  MKTAG('s', 'c', 'p', 'n'),    // UINT32
236 };
237 
238 enum {
239     kKeyReadSize = MKTAG('r', 'd', 's', 'z'),
240 };
241 
242 enum {
243     kKeyTestInt32   = MKTAG('t', 'i', '3', '2'),
244     kKeyTestInt64   = MKTAG('t', 'i', '6', '4'),
245     kKeyTestString  = MKTAG('t', 's', 't', 'r'),
246     kKeyTestFloat   = MKTAG('t', 'f', 'l', 't'),
247     kKeyTestPtr     = MKTAG('t', 'p', 't', 'r'),
248     kKeyTestNone    = MKTAG('t', 'n', 'o', 'e'),
249 };
250 
251 #endif  // INCLUDE_RT_MEDIA_RTMEDIAMETAKEYS_H_
252 
253 
254