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