1 // This Source Code Form is subject to the terms of the Mozilla Public
2 // License, v. 2.0. If a copy of the MPL was not distributed with this
3 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
9 #ifndef MP4PARSE_CAPI_H
10 #define MP4PARSE_CAPI_H
12 // THIS FILE IS AUTOGENERATED BY mp4parse_capi/build.rs - DO NOT EDIT
19 MP4_PARSE_ENCRYPTION_SCHEME_TYPE_NONE
,
20 MP4_PARSE_ENCRYPTION_SCHEME_TYPE_CENC
,
21 MP4_PARSE_ENCRYPTION_SCHEME_TYPE_CBC1
,
22 MP4_PARSE_ENCRYPTION_SCHEME_TYPE_CENS
,
23 MP4_PARSE_ENCRYPTION_SCHEME_TYPE_CBCS
,
24 } Mp4ParseEncryptionSchemeType
;
27 MP4PARSE_CODEC_UNKNOWN
,
43 MP4PARSE_STATUS_OK
= 0,
44 MP4PARSE_STATUS_BAD_ARG
= 1,
45 MP4PARSE_STATUS_INVALID
= 2,
46 MP4PARSE_STATUS_UNSUPPORTED
= 3,
47 MP4PARSE_STATUS_EOF
= 4,
48 MP4PARSE_STATUS_IO
= 5,
49 MP4PARSE_STATUS_OOM
= 6,
53 MP4PARSE_TRACK_TYPE_VIDEO
= 0,
54 MP4PARSE_TRACK_TYPE_AUDIO
= 1,
55 MP4PARSE_TRACK_TYPE_METADATA
= 2,
58 typedef struct Mp4parseParser Mp4parseParser
;
61 uint64_t fragment_duration
;
62 } Mp4parseFragmentInfo
;
65 uint64_t start_offset
;
67 int64_t start_composition
;
68 int64_t end_composition
;
76 const Mp4parseIndice
*indices
;
80 Mp4parseByteData data
;
84 Mp4ParseEncryptionSchemeType scheme_type
;
88 uint8_t crypt_byte_block
;
89 uint8_t skip_byte_block
;
90 Mp4parseByteData constant_iv
;
94 Mp4parseCodec codec_type
;
99 uint16_t extended_profile
;
100 Mp4parseByteData codec_specific_config
;
101 Mp4parseByteData extra_data
;
102 Mp4parseSinfInfo protected_data
;
103 } Mp4parseTrackAudioSampleInfo
;
106 uint32_t sample_info_count
;
107 const Mp4parseTrackAudioSampleInfo
*sample_info
;
108 } Mp4parseTrackAudioInfo
;
111 Mp4parseTrackType track_type
;
118 Mp4parseCodec codec_type
;
119 uint16_t image_width
;
120 uint16_t image_height
;
121 Mp4parseByteData extra_data
;
122 Mp4parseSinfInfo protected_data
;
123 } Mp4parseTrackVideoSampleInfo
;
126 uint32_t display_width
;
127 uint32_t display_height
;
129 uint32_t sample_info_count
;
130 const Mp4parseTrackVideoSampleInfo
*sample_info
;
131 } Mp4parseTrackVideoInfo
;
134 intptr_t (*read
)(uint8_t*, uintptr_t, void*);
138 // THIS FILE IS AUTOGENERATED BY mp4parse_capi/build.rs - DO NOT EDIT
141 * Free an `Mp4parseParser*` allocated by `mp4parse_new()`.
143 void mp4parse_free(Mp4parseParser
*parser
);
146 * Fill the supplied `Mp4parseFragmentInfo` with metadata from fragmented file.
148 Mp4parseStatus
mp4parse_get_fragment_info(Mp4parseParser
*parser
, Mp4parseFragmentInfo
*info
);
150 Mp4parseStatus
mp4parse_get_indice_table(Mp4parseParser
*parser
,
152 Mp4parseByteData
*indices
);
155 * Get 'pssh' system id and 'pssh' box content for eme playback.
157 * The data format of the `info` struct passed to gecko is:
159 * - system id (16 byte uuid)
160 * - pssh box size (32-bit native endian)
161 * - pssh box content (including header)
163 Mp4parseStatus
mp4parse_get_pssh_info(Mp4parseParser
*parser
, Mp4parsePsshInfo
*info
);
166 * Fill the supplied `Mp4parseTrackAudioInfo` with metadata for `track`.
168 Mp4parseStatus
mp4parse_get_track_audio_info(Mp4parseParser
*parser
,
169 uint32_t track_index
,
170 Mp4parseTrackAudioInfo
*info
);
173 * Return the number of tracks parsed by previous `mp4parse_read()` call.
175 Mp4parseStatus
mp4parse_get_track_count(const Mp4parseParser
*parser
, uint32_t *count
);
178 * Fill the supplied `Mp4parseTrackInfo` with metadata for `track`.
180 Mp4parseStatus
mp4parse_get_track_info(Mp4parseParser
*parser
,
181 uint32_t track_index
,
182 Mp4parseTrackInfo
*info
);
185 * Fill the supplied `Mp4parseTrackVideoInfo` with metadata for `track`.
187 Mp4parseStatus
mp4parse_get_track_video_info(Mp4parseParser
*parser
,
188 uint32_t track_index
,
189 Mp4parseTrackVideoInfo
*info
);
192 * A fragmented file needs mvex table and contains no data in stts, stsc, and stco boxes.
194 Mp4parseStatus
mp4parse_is_fragmented(Mp4parseParser
*parser
,
196 uint8_t *fragmented
);
199 * Allocate an `Mp4parseParser*` to read from the supplied `Mp4parseIo`.
201 Mp4parseParser
*mp4parse_new(const Mp4parseIo
*io
);
204 * Run the `Mp4parseParser*` allocated by `mp4parse_new()` until EOF or error.
206 Mp4parseStatus
mp4parse_read(Mp4parseParser
*parser
);
208 // THIS FILE IS AUTOGENERATED BY mp4parse_capi/build.rs - DO NOT EDIT
210 #endif /* MP4PARSE_CAPI_H */