include/mp4v2/track_prop.h Source File
track_prop.h
1 #ifndef MP4V2_TRACK_PROP_H
2 #define MP4V2_TRACK_PROP_H
3 
4 /**************************************************************************/
11 /* specific track properties */
12 
13 MP4V2_EXPORT
14 bool MP4HaveTrackAtom(
15  MP4FileHandle hFile,
16  MP4TrackId trackId,
17  const char* atomname );
18 
46 MP4V2_EXPORT
47 const char* MP4GetTrackType(
48  MP4FileHandle hFile,
49  MP4TrackId trackId );
50 
51 MP4V2_EXPORT
52 const char* MP4GetTrackMediaDataName(
53  MP4FileHandle hFile,
54  MP4TrackId trackId );
55 
56 /*
57  * MP4GetTrackMediaDataOriginalFormat is to be used to get the original
58  * MediaDataName if a track has been encrypted.
59  */
60 
61 MP4V2_EXPORT
62 bool MP4GetTrackMediaDataOriginalFormat(
63  MP4FileHandle hFile,
64  MP4TrackId trackId,
65  char* originalFormat,
66  uint32_t buflen );
67 
68 MP4V2_EXPORT
69 MP4Duration MP4GetTrackDuration(
70  MP4FileHandle hFile,
71  MP4TrackId trackId );
72 
84 MP4V2_EXPORT
86  MP4FileHandle hFile,
87  MP4TrackId trackId );
88 
107 MP4V2_EXPORT
109  MP4FileHandle hFile,
110  MP4TrackId trackId,
111  uint32_t value );
112 
122 MP4V2_EXPORT
124  MP4FileHandle hFile,
125  MP4TrackId trackId,
126  char* code );
127 
137 MP4V2_EXPORT
139  MP4FileHandle hFile,
140  MP4TrackId trackId,
141  const char* code );
142 
152 MP4V2_EXPORT
154  MP4FileHandle hFile,
155  MP4TrackId trackId,
156  char** name );
157 
168 MP4V2_EXPORT
170  MP4FileHandle hFile,
171  MP4TrackId trackId,
172  const char* name );
173 
174 MP4V2_EXPORT
175 uint8_t MP4GetTrackAudioMpeg4Type(
176  MP4FileHandle hFile,
177  MP4TrackId trackId );
178 
179 MP4V2_EXPORT
180 uint8_t MP4GetTrackEsdsObjectTypeId(
181  MP4FileHandle hFile,
182  MP4TrackId trackId );
183 
184 /* returns MP4_INVALID_DURATION if track samples do not have a fixed duration */
185 MP4V2_EXPORT
186 MP4Duration MP4GetTrackFixedSampleDuration(
187  MP4FileHandle hFile,
188  MP4TrackId trackId );
189 
190 MP4V2_EXPORT
191 uint32_t MP4GetTrackBitRate(
192  MP4FileHandle hFile,
193  MP4TrackId trackId );
194 
195 MP4V2_EXPORT
196 bool MP4GetTrackVideoMetadata(
197  MP4FileHandle hFile,
198  MP4TrackId trackId,
199  uint8_t** ppConfig,
200  uint32_t* pConfigSize );
201 
202 MP4V2_EXPORT
203 bool MP4GetTrackESConfiguration(
204  MP4FileHandle hFile,
205  MP4TrackId trackId,
206  uint8_t** ppConfig,
207  uint32_t* pConfigSize );
208 
209 MP4V2_EXPORT
210 bool MP4SetTrackESConfiguration(
211  MP4FileHandle hFile,
212  MP4TrackId trackId,
213  const uint8_t* pConfig,
214  uint32_t configSize );
215 
216 /* h264 information routines */
217 
239 MP4V2_EXPORT
241  uint8_t** pSeqHeaders,
242  uint32_t* pSeqHeaderSize,
243  uint8_t** pPictHeader,
244  uint32_t* pPictHeaderSize );
245 
246 MP4V2_EXPORT
247 bool MP4GetTrackH264ProfileLevel(
248  MP4FileHandle hFile,
249  MP4TrackId trackId,
250  uint8_t* pProfile,
251  uint8_t* pLevel );
252 
253 MP4V2_EXPORT
254 bool MP4GetTrackH264SeqPictHeaders(
255  MP4FileHandle hFile,
256  MP4TrackId trackId,
257  uint8_t*** pSeqHeaders,
258  uint32_t** pSeqHeaderSize,
259  uint8_t*** pPictHeader,
260  uint32_t** pPictHeaderSize );
261 
262 MP4V2_EXPORT
263 bool MP4GetTrackH264LengthSize(
264  MP4FileHandle hFile,
265  MP4TrackId trackId,
266  uint32_t* pLength );
267 
268 MP4V2_EXPORT
269 MP4SampleId MP4GetTrackNumberOfSamples(
270  MP4FileHandle hFile,
271  MP4TrackId trackId );
272 
273 MP4V2_EXPORT
274 uint16_t MP4GetTrackVideoWidth(
275  MP4FileHandle hFile,
276  MP4TrackId trackId );
277 
278 MP4V2_EXPORT
279 uint16_t MP4GetTrackVideoHeight(
280  MP4FileHandle hFile,
281  MP4TrackId trackId );
282 
283 MP4V2_EXPORT
284 double MP4GetTrackVideoFrameRate(
285  MP4FileHandle hFile,
286  MP4TrackId trackId );
287 
288 MP4V2_EXPORT
289 int MP4GetTrackAudioChannels(
290  MP4FileHandle hFile,
291  MP4TrackId trackId );
292 
293 MP4V2_EXPORT
294 bool MP4IsIsmaCrypMediaTrack(
295  MP4FileHandle hFile,
296  MP4TrackId trackId );
297 
298 /* generic track properties */
299 
300 MP4V2_EXPORT
301 bool MP4HaveTrackAtom(
302  MP4FileHandle hFile,
303  MP4TrackId trackId,
304  const char* atomName );
305 
306 MP4V2_EXPORT
307 bool MP4GetTrackIntegerProperty(
308  MP4FileHandle hFile,
309  MP4TrackId trackId,
310  const char* propName,
311  uint64_t* retvalue );
312 
313 MP4V2_EXPORT
314 bool MP4GetTrackFloatProperty(
315  MP4FileHandle hFile,
316  MP4TrackId trackId,
317  const char* propName,
318  float* ret_value );
319 
320 MP4V2_EXPORT
321 bool MP4GetTrackStringProperty(
322  MP4FileHandle hFile,
323  MP4TrackId trackId,
324  const char* propName,
325  const char** retvalue );
326 
327 MP4V2_EXPORT
328 bool MP4GetTrackBytesProperty(
329  MP4FileHandle hFile,
330  MP4TrackId trackId,
331  const char* propName,
332  uint8_t** ppValue,
333  uint32_t* pValueSize );
334 
335 MP4V2_EXPORT
336 bool MP4SetTrackIntegerProperty(
337  MP4FileHandle hFile,
338  MP4TrackId trackId,
339  const char* propName,
340  int64_t value );
341 
342 MP4V2_EXPORT
343 bool MP4SetTrackFloatProperty(
344  MP4FileHandle hFile,
345  MP4TrackId trackId,
346  const char* propName,
347  float value );
348 
349 MP4V2_EXPORT
350 bool MP4SetTrackStringProperty(
351  MP4FileHandle hFile,
352  MP4TrackId trackId,
353  const char* propName,
354  const char* value );
355 
356 MP4V2_EXPORT
357 bool MP4SetTrackBytesProperty(
358  MP4FileHandle hFile,
359  MP4TrackId trackId,
360  const char* propName,
361  const uint8_t* pValue,
362  uint32_t valueSize);
363 
366 #endif /* MP4V2_TRACK_PROP_H */
MP4GetTrackTimeScale
uint32_t MP4GetTrackTimeScale(MP4FileHandle hFile, MP4TrackId trackId)
Get the time scale of a track.
MP4GetTrackType
const char * MP4GetTrackType(MP4FileHandle hFile, MP4TrackId trackId)
Get the track type.
MP4GetTrackLanguage
bool MP4GetTrackLanguage(MP4FileHandle hFile, MP4TrackId trackId, char *code)
Get ISO-639-2/T language code of a track.
MP4FreeH264SeqPictHeaders
void MP4FreeH264SeqPictHeaders(uint8_t **pSeqHeaders, uint32_t *pSeqHeaderSize, uint8_t **pPictHeader, uint32_t *pPictHeaderSize)
Frees the memory allocated by MP4GetTrackH264SeqPictHeaders.
MP4SetTrackName
bool MP4SetTrackName(MP4FileHandle hFile, MP4TrackId trackId, const char *name)
Set track name.
MP4SetTrackLanguage
bool MP4SetTrackLanguage(MP4FileHandle hFile, MP4TrackId trackId, const char *code)
Set ISO-639-2/T language code of a track.
MP4SetTrackTimeScale
bool MP4SetTrackTimeScale(MP4FileHandle hFile, MP4TrackId trackId, uint32_t value)
Set the time scale of a track.
MP4GetTrackName
bool MP4GetTrackName(MP4FileHandle hFile, MP4TrackId trackId, char **name)
Get track name.