| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * ISO Media common code | ||
| 3 | * copyright (c) 2001 Fabrice Bellard | ||
| 4 | * copyright (c) 2002 Francois Revol <revol@free.fr> | ||
| 5 | * copyright (c) 2006 Baptiste Coudurier <baptiste.coudurier@free.fr> | ||
| 6 | * | ||
| 7 | * This file is part of FFmpeg. | ||
| 8 | * | ||
| 9 | * FFmpeg is free software; you can redistribute it and/or | ||
| 10 | * modify it under the terms of the GNU Lesser General Public | ||
| 11 | * License as published by the Free Software Foundation; either | ||
| 12 | * version 2.1 of the License, or (at your option) any later version. | ||
| 13 | * | ||
| 14 | * FFmpeg is distributed in the hope that it will be useful, | ||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 17 | * Lesser General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU Lesser General Public | ||
| 20 | * License along with FFmpeg; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef AVFORMAT_ISOM_H | ||
| 25 | #define AVFORMAT_ISOM_H | ||
| 26 | |||
| 27 | #include <stddef.h> | ||
| 28 | #include <stdint.h> | ||
| 29 | |||
| 30 | #include "libavutil/encryption_info.h" | ||
| 31 | #include "libavutil/mastering_display_metadata.h" | ||
| 32 | #include "libavutil/ambient_viewing_environment.h" | ||
| 33 | #include "libavutil/spherical.h" | ||
| 34 | #include "libavutil/stereo3d.h" | ||
| 35 | |||
| 36 | #include "avio.h" | ||
| 37 | #include "internal.h" | ||
| 38 | #include "dv.h" | ||
| 39 | |||
| 40 | /* isom.c */ | ||
| 41 | extern const AVCodecTag ff_mp4_obj_type[]; | ||
| 42 | extern const AVCodecTag ff_codec_movvideo_tags[]; | ||
| 43 | extern const AVCodecTag ff_codec_movaudio_tags[]; | ||
| 44 | extern const AVCodecTag ff_codec_movsubtitle_tags[]; | ||
| 45 | extern const AVCodecTag ff_codec_movdata_tags[]; | ||
| 46 | |||
| 47 | int ff_mov_iso639_to_lang(const char lang[4], int mp4); | ||
| 48 | int ff_mov_lang_to_iso639(unsigned code, char to[4]); | ||
| 49 | |||
| 50 | struct AVAESCTR; | ||
| 51 | |||
| 52 | /* the QuickTime file format is quite convoluted... | ||
| 53 | * it has lots of index tables, each indexing something in another one... | ||
| 54 | * Here we just use what is needed to read the chunks | ||
| 55 | */ | ||
| 56 | |||
| 57 | typedef struct MOVTimeToSample { | ||
| 58 | unsigned int count; | ||
| 59 | unsigned int duration; | ||
| 60 | int offset; | ||
| 61 | } MOVTimeToSample; | ||
| 62 | |||
| 63 | typedef struct MOVStts { | ||
| 64 | unsigned int count; | ||
| 65 | unsigned int duration; | ||
| 66 | } MOVStts; | ||
| 67 | |||
| 68 | typedef struct MOVCtts { | ||
| 69 | unsigned int count; | ||
| 70 | int offset; | ||
| 71 | } MOVCtts; | ||
| 72 | |||
| 73 | typedef struct MOVStsc { | ||
| 74 | int first; | ||
| 75 | int count; | ||
| 76 | int id; | ||
| 77 | } MOVStsc; | ||
| 78 | |||
| 79 | typedef struct MOVElst { | ||
| 80 | int64_t duration; | ||
| 81 | int64_t time; | ||
| 82 | float rate; | ||
| 83 | } MOVElst; | ||
| 84 | |||
| 85 | typedef struct MOVDref { | ||
| 86 | uint32_t type; | ||
| 87 | char *path; | ||
| 88 | char *dir; | ||
| 89 | char volume[28]; | ||
| 90 | char filename[64]; | ||
| 91 | int16_t nlvl_to, nlvl_from; | ||
| 92 | } MOVDref; | ||
| 93 | |||
| 94 | typedef struct MOVAtom { | ||
| 95 | uint32_t type; | ||
| 96 | int64_t size; /* total size (excluding the size and type fields) */ | ||
| 97 | } MOVAtom; | ||
| 98 | |||
| 99 | struct MOVParseTableEntry; | ||
| 100 | |||
| 101 | typedef struct MOVFragment { | ||
| 102 | int found_tfhd; | ||
| 103 | unsigned track_id; | ||
| 104 | uint64_t base_data_offset; | ||
| 105 | uint64_t moof_offset; | ||
| 106 | uint64_t implicit_offset; | ||
| 107 | unsigned stsd_id; | ||
| 108 | unsigned duration; | ||
| 109 | unsigned size; | ||
| 110 | unsigned flags; | ||
| 111 | } MOVFragment; | ||
| 112 | |||
| 113 | typedef struct MOVTrackExt { | ||
| 114 | unsigned track_id; | ||
| 115 | unsigned stsd_id; | ||
| 116 | unsigned duration; | ||
| 117 | unsigned size; | ||
| 118 | unsigned flags; | ||
| 119 | } MOVTrackExt; | ||
| 120 | |||
| 121 | typedef struct MOVSbgp { | ||
| 122 | unsigned int count; | ||
| 123 | unsigned int index; | ||
| 124 | } MOVSbgp; | ||
| 125 | |||
| 126 | typedef struct MOVEncryptionIndex { | ||
| 127 | // Individual encrypted samples. If there are no elements, then the default | ||
| 128 | // settings will be used. | ||
| 129 | unsigned int nb_encrypted_samples; | ||
| 130 | AVEncryptionInfo **encrypted_samples; | ||
| 131 | |||
| 132 | uint8_t* auxiliary_info_sizes; | ||
| 133 | size_t auxiliary_info_sample_count; | ||
| 134 | uint8_t auxiliary_info_default_size; | ||
| 135 | uint64_t* auxiliary_offsets; ///< Absolute seek position | ||
| 136 | size_t auxiliary_offsets_count; | ||
| 137 | } MOVEncryptionIndex; | ||
| 138 | |||
| 139 | typedef struct MOVFragmentStreamInfo { | ||
| 140 | int id; | ||
| 141 | int64_t sidx_pts; | ||
| 142 | int64_t first_tfra_pts; | ||
| 143 | int64_t tfdt_dts; | ||
| 144 | int64_t next_trun_dts; | ||
| 145 | // Index of the first sample/trun in the fragment. | ||
| 146 | int index_base; | ||
| 147 | int index_entry; | ||
| 148 | MOVEncryptionIndex *encryption_index; | ||
| 149 | int stsd_id; // current fragment stsd_id | ||
| 150 | } MOVFragmentStreamInfo; | ||
| 151 | |||
| 152 | typedef struct MOVFragmentIndexItem { | ||
| 153 | int64_t moof_offset; | ||
| 154 | int headers_read; | ||
| 155 | int current; | ||
| 156 | int nb_stream_info; | ||
| 157 | MOVFragmentStreamInfo * stream_info; | ||
| 158 | } MOVFragmentIndexItem; | ||
| 159 | |||
| 160 | typedef struct MOVFragmentIndex { | ||
| 161 | int allocated_size; | ||
| 162 | int complete; | ||
| 163 | int current; | ||
| 164 | int nb_items; | ||
| 165 | MOVFragmentIndexItem * item; | ||
| 166 | } MOVFragmentIndex; | ||
| 167 | |||
| 168 | typedef struct MOVIndexRange { | ||
| 169 | int64_t start; | ||
| 170 | int64_t end; | ||
| 171 | } MOVIndexRange; | ||
| 172 | |||
| 173 | typedef struct MOVStreamContext { | ||
| 174 | AVIOContext *pb; | ||
| 175 | int refcount; | ||
| 176 | int pb_is_copied; | ||
| 177 | int id; ///< AVStream id | ||
| 178 | int ffindex; ///< AVStream index | ||
| 179 | int next_chunk; | ||
| 180 | unsigned int chunk_count; | ||
| 181 | int64_t *chunk_offsets; | ||
| 182 | unsigned int tts_count; | ||
| 183 | unsigned int tts_allocated_size; | ||
| 184 | MOVTimeToSample *tts_data; | ||
| 185 | unsigned int stts_count; | ||
| 186 | unsigned int stts_allocated_size; | ||
| 187 | MOVStts *stts_data; | ||
| 188 | unsigned int sdtp_count; | ||
| 189 | uint8_t *sdtp_data; | ||
| 190 | unsigned int ctts_count; | ||
| 191 | unsigned int ctts_allocated_size; | ||
| 192 | MOVCtts *ctts_data; | ||
| 193 | unsigned int stsc_count; | ||
| 194 | MOVStsc *stsc_data; | ||
| 195 | unsigned int stsc_index; | ||
| 196 | int stsc_sample; | ||
| 197 | unsigned int stps_count; | ||
| 198 | unsigned *stps_data; ///< partial sync sample for mpeg-2 open gop | ||
| 199 | MOVElst *elst_data; | ||
| 200 | unsigned int elst_count; | ||
| 201 | int tts_index; | ||
| 202 | int tts_sample; | ||
| 203 | unsigned int sample_size; ///< may contain value calculated from stsd or value from stsz atom | ||
| 204 | unsigned int stsz_sample_size; ///< always contains sample size from stsz atom | ||
| 205 | unsigned int sample_count; | ||
| 206 | unsigned int *sample_sizes; | ||
| 207 | int keyframe_absent; | ||
| 208 | unsigned int keyframe_count; | ||
| 209 | int *keyframes; | ||
| 210 | int time_scale; | ||
| 211 | int64_t time_offset; ///< time offset of the edit list entries | ||
| 212 | int64_t min_corrected_pts; ///< minimum Composition time shown by the edits excluding empty edits. | ||
| 213 | int current_sample; | ||
| 214 | int64_t current_index; | ||
| 215 | MOVIndexRange* index_ranges; | ||
| 216 | MOVIndexRange* current_index_range; | ||
| 217 | unsigned int bytes_per_frame; | ||
| 218 | unsigned int samples_per_frame; | ||
| 219 | int dv_audio_container; | ||
| 220 | int pseudo_stream_id; ///< -1 means demux all ids | ||
| 221 | int16_t audio_cid; ///< stsd audio compression id | ||
| 222 | unsigned drefs_count; | ||
| 223 | MOVDref *drefs; | ||
| 224 | int dref_id; | ||
| 225 | unsigned tref_flags; | ||
| 226 | int tref_id; | ||
| 227 | int timecode_track; | ||
| 228 | int width; ///< tkhd width | ||
| 229 | int height; ///< tkhd height | ||
| 230 | int h_spacing; ///< pasp hSpacing | ||
| 231 | int v_spacing; ///< pasp vSpacing | ||
| 232 | int dts_shift; ///< dts shift when ctts is negative | ||
| 233 | uint32_t palette[256]; | ||
| 234 | int has_palette; | ||
| 235 | int64_t data_size; | ||
| 236 | uint32_t tmcd_flags; ///< tmcd track flags | ||
| 237 | uint8_t tmcd_nb_frames; ///< tmcd number of frames per tick / second | ||
| 238 | int64_t track_end; ///< used for dts generation in fragmented movie files | ||
| 239 | int start_pad; ///< amount of samples to skip due to enc-dec delay | ||
| 240 | unsigned int rap_group_count; | ||
| 241 | MOVSbgp *rap_group; | ||
| 242 | unsigned int sync_group_count; | ||
| 243 | MOVSbgp *sync_group; | ||
| 244 | uint8_t *sgpd_sync; | ||
| 245 | uint32_t sgpd_sync_count; | ||
| 246 | int32_t *sample_offsets; | ||
| 247 | int sample_offsets_count; | ||
| 248 | int *open_key_samples; | ||
| 249 | int open_key_samples_count; | ||
| 250 | uint32_t min_sample_duration; | ||
| 251 | |||
| 252 | int nb_frames_for_fps; | ||
| 253 | int64_t duration_for_fps; | ||
| 254 | |||
| 255 | /** extradata array (and size) for multiple stsd */ | ||
| 256 | uint8_t **extradata; | ||
| 257 | int *extradata_size; | ||
| 258 | int last_stsd_index; | ||
| 259 | int stsd_count; | ||
| 260 | int stsd_version; | ||
| 261 | |||
| 262 | int32_t *display_matrix; | ||
| 263 | AVStereo3D *stereo3d; | ||
| 264 | size_t stereo3d_size; | ||
| 265 | AVSphericalMapping *spherical; | ||
| 266 | size_t spherical_size; | ||
| 267 | AVMasteringDisplayMetadata *mastering; | ||
| 268 | size_t mastering_size; | ||
| 269 | AVContentLightMetadata *coll; | ||
| 270 | size_t coll_size; | ||
| 271 | AVAmbientViewingEnvironment *ambient; | ||
| 272 | size_t ambient_size; | ||
| 273 | |||
| 274 | uint32_t format; | ||
| 275 | |||
| 276 | int has_sidx; // If there is an sidx entry for this stream. | ||
| 277 | struct { | ||
| 278 | struct AVAESCTR* aes_ctr; | ||
| 279 | struct AVAES *aes_ctx; | ||
| 280 | unsigned int per_sample_iv_size; // Either 0, 8, or 16. | ||
| 281 | AVEncryptionInfo *default_encrypted_sample; | ||
| 282 | MOVEncryptionIndex *encryption_index; | ||
| 283 | } cenc; | ||
| 284 | |||
| 285 | struct IAMFDemuxContext *iamf; | ||
| 286 | int iamf_stream_offset; | ||
| 287 | } MOVStreamContext; | ||
| 288 | |||
| 289 | typedef struct HEIFItemRef { | ||
| 290 | uint32_t type; | ||
| 291 | int item_id; | ||
| 292 | } HEIFItemRef; | ||
| 293 | |||
| 294 | typedef struct HEIFItem { | ||
| 295 | AVStream *st; | ||
| 296 | HEIFItemRef *iref_list; | ||
| 297 | int nb_iref_list; | ||
| 298 | char *name; | ||
| 299 | int item_id; | ||
| 300 | int64_t extent_length; | ||
| 301 | int64_t extent_offset; | ||
| 302 | int width; | ||
| 303 | int height; | ||
| 304 | int rotation; | ||
| 305 | int hflip; | ||
| 306 | int vflip; | ||
| 307 | int type; | ||
| 308 | int is_idat_relative; | ||
| 309 | uint8_t *icc_profile; | ||
| 310 | size_t icc_profile_size; | ||
| 311 | } HEIFItem; | ||
| 312 | |||
| 313 | typedef struct HEIFGrid { | ||
| 314 | HEIFItem *item; | ||
| 315 | HEIFItem **tile_item_list; | ||
| 316 | int16_t *tile_id_list; | ||
| 317 | unsigned *tile_idx_list; | ||
| 318 | int nb_tiles; | ||
| 319 | } HEIFGrid; | ||
| 320 | |||
| 321 | typedef struct MOVContext { | ||
| 322 | const AVClass *class; ///< class for private options | ||
| 323 | AVFormatContext *fc; | ||
| 324 | int time_scale; | ||
| 325 | int64_t duration; ///< duration of the longest track | ||
| 326 | int found_moov; ///< 'moov' atom has been found | ||
| 327 | int found_iloc; ///< 'iloc' atom has been found | ||
| 328 | int found_iinf; ///< 'iinf' atom has been found | ||
| 329 | int found_mdat; ///< 'mdat' atom has been found | ||
| 330 | int found_hdlr_mdta; ///< 'hdlr' atom with type 'mdta' has been found | ||
| 331 | int trak_index; ///< Index of the current 'trak' | ||
| 332 | char **meta_keys; | ||
| 333 | unsigned meta_keys_count; | ||
| 334 | DVDemuxContext *dv_demux; | ||
| 335 | AVFormatContext *dv_fctx; | ||
| 336 | int isom; ///< 1 if file is ISO Media (mp4/3gp) | ||
| 337 | MOVFragment fragment; ///< current fragment in moof atom | ||
| 338 | MOVTrackExt *trex_data; | ||
| 339 | unsigned trex_count; | ||
| 340 | int itunes_metadata; ///< metadata are itunes style | ||
| 341 | int handbrake_version; | ||
| 342 | int *chapter_tracks; | ||
| 343 | unsigned int nb_chapter_tracks; | ||
| 344 | int use_absolute_path; | ||
| 345 | int ignore_editlist; | ||
| 346 | int advanced_editlist; | ||
| 347 | int advanced_editlist_autodisabled; | ||
| 348 | int ignore_chapters; | ||
| 349 | int seek_individually; | ||
| 350 | int64_t next_root_atom; ///< offset of the next root atom | ||
| 351 | int export_all; | ||
| 352 | int export_xmp; | ||
| 353 | int *bitrates; ///< bitrates read before streams creation | ||
| 354 | int bitrates_count; | ||
| 355 | int moov_retry; | ||
| 356 | int use_mfra_for; | ||
| 357 | int has_looked_for_mfra; | ||
| 358 | int use_tfdt; | ||
| 359 | MOVFragmentIndex frag_index; | ||
| 360 | int atom_depth; | ||
| 361 | unsigned int aax_mode; ///< 'aax' file has been detected | ||
| 362 | uint8_t file_key[20]; | ||
| 363 | uint8_t file_iv[20]; | ||
| 364 | void *activation_bytes; | ||
| 365 | int activation_bytes_size; | ||
| 366 | void *audible_fixed_key; | ||
| 367 | int audible_fixed_key_size; | ||
| 368 | void *audible_key; | ||
| 369 | int audible_key_size; | ||
| 370 | void *audible_iv; | ||
| 371 | int audible_iv_size; | ||
| 372 | struct AVAES *aes_decrypt; | ||
| 373 | uint8_t *decryption_key; | ||
| 374 | int decryption_key_len; | ||
| 375 | int enable_drefs; | ||
| 376 | int32_t movie_display_matrix[3][3]; ///< display matrix from mvhd | ||
| 377 | int have_read_mfra_size; | ||
| 378 | uint32_t mfra_size; | ||
| 379 | uint32_t max_stts_delta; | ||
| 380 | int primary_item_id; | ||
| 381 | int cur_item_id; | ||
| 382 | HEIFItem **heif_item; | ||
| 383 | int nb_heif_item; | ||
| 384 | HEIFGrid *heif_grid; | ||
| 385 | int nb_heif_grid; | ||
| 386 | int64_t idat_offset; | ||
| 387 | int interleaved_read; | ||
| 388 | } MOVContext; | ||
| 389 | |||
| 390 | int ff_mp4_read_descr_len(AVIOContext *pb); | ||
| 391 | int ff_mp4_read_descr(void *logctx, AVIOContext *pb, int *tag); | ||
| 392 | int ff_mp4_read_dec_config_descr(void *logctx, AVStream *st, AVIOContext *pb); | ||
| 393 | void ff_mp4_parse_es_descr(AVIOContext *pb, int *es_id); | ||
| 394 | |||
| 395 | #define MP4ODescrTag 0x01 | ||
| 396 | #define MP4IODescrTag 0x02 | ||
| 397 | #define MP4ESDescrTag 0x03 | ||
| 398 | #define MP4DecConfigDescrTag 0x04 | ||
| 399 | #define MP4DecSpecificDescrTag 0x05 | ||
| 400 | #define MP4SLDescrTag 0x06 | ||
| 401 | |||
| 402 | #define MOV_TFHD_BASE_DATA_OFFSET 0x01 | ||
| 403 | #define MOV_TFHD_STSD_ID 0x02 | ||
| 404 | #define MOV_TFHD_DEFAULT_DURATION 0x08 | ||
| 405 | #define MOV_TFHD_DEFAULT_SIZE 0x10 | ||
| 406 | #define MOV_TFHD_DEFAULT_FLAGS 0x20 | ||
| 407 | #define MOV_TFHD_DURATION_IS_EMPTY 0x010000 | ||
| 408 | #define MOV_TFHD_DEFAULT_BASE_IS_MOOF 0x020000 | ||
| 409 | |||
| 410 | #define MOV_TRUN_DATA_OFFSET 0x01 | ||
| 411 | #define MOV_TRUN_FIRST_SAMPLE_FLAGS 0x04 | ||
| 412 | #define MOV_TRUN_SAMPLE_DURATION 0x100 | ||
| 413 | #define MOV_TRUN_SAMPLE_SIZE 0x200 | ||
| 414 | #define MOV_TRUN_SAMPLE_FLAGS 0x400 | ||
| 415 | #define MOV_TRUN_SAMPLE_CTS 0x800 | ||
| 416 | |||
| 417 | #define MOV_FRAG_SAMPLE_FLAG_DEGRADATION_PRIORITY_MASK 0x0000ffff | ||
| 418 | #define MOV_FRAG_SAMPLE_FLAG_IS_NON_SYNC 0x00010000 | ||
| 419 | #define MOV_FRAG_SAMPLE_FLAG_PADDING_MASK 0x000e0000 | ||
| 420 | #define MOV_FRAG_SAMPLE_FLAG_REDUNDANCY_MASK 0x00300000 | ||
| 421 | #define MOV_FRAG_SAMPLE_FLAG_DEPENDED_MASK 0x00c00000 | ||
| 422 | #define MOV_FRAG_SAMPLE_FLAG_DEPENDS_MASK 0x03000000 | ||
| 423 | |||
| 424 | #define MOV_FRAG_SAMPLE_FLAG_DEPENDS_NO 0x02000000 | ||
| 425 | #define MOV_FRAG_SAMPLE_FLAG_DEPENDS_YES 0x01000000 | ||
| 426 | |||
| 427 | #define MOV_TKHD_FLAG_ENABLED 0x0001 | ||
| 428 | #define MOV_TKHD_FLAG_IN_MOVIE 0x0002 | ||
| 429 | #define MOV_TKHD_FLAG_IN_PREVIEW 0x0004 | ||
| 430 | #define MOV_TKHD_FLAG_IN_POSTER 0x0008 | ||
| 431 | |||
| 432 | #define MOV_SAMPLE_DEPENDENCY_UNKNOWN 0x0 | ||
| 433 | #define MOV_SAMPLE_DEPENDENCY_YES 0x1 | ||
| 434 | #define MOV_SAMPLE_DEPENDENCY_NO 0x2 | ||
| 435 | |||
| 436 | #define MOV_TREF_FLAG_ENHANCEMENT 0x1 | ||
| 437 | |||
| 438 | #define TAG_IS_AVCI(tag) \ | ||
| 439 | ((tag) == MKTAG('a', 'i', '5', 'p') || \ | ||
| 440 | (tag) == MKTAG('a', 'i', '5', 'q') || \ | ||
| 441 | (tag) == MKTAG('a', 'i', '5', '2') || \ | ||
| 442 | (tag) == MKTAG('a', 'i', '5', '3') || \ | ||
| 443 | (tag) == MKTAG('a', 'i', '5', '5') || \ | ||
| 444 | (tag) == MKTAG('a', 'i', '5', '6') || \ | ||
| 445 | (tag) == MKTAG('a', 'i', '1', 'p') || \ | ||
| 446 | (tag) == MKTAG('a', 'i', '1', 'q') || \ | ||
| 447 | (tag) == MKTAG('a', 'i', '1', '2') || \ | ||
| 448 | (tag) == MKTAG('a', 'i', '1', '3') || \ | ||
| 449 | (tag) == MKTAG('a', 'i', '1', '5') || \ | ||
| 450 | (tag) == MKTAG('a', 'i', '1', '6') || \ | ||
| 451 | (tag) == MKTAG('a', 'i', 'v', 'x') || \ | ||
| 452 | (tag) == MKTAG('A', 'V', 'i', 'n')) | ||
| 453 | |||
| 454 | |||
| 455 | int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb); | ||
| 456 | |||
| 457 | int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries); | ||
| 458 | void ff_mov_write_chan(AVIOContext *pb, int64_t channel_layout); | ||
| 459 | |||
| 460 | #define FF_MOV_FLAG_MFRA_AUTO -1 | ||
| 461 | #define FF_MOV_FLAG_MFRA_DTS 1 | ||
| 462 | #define FF_MOV_FLAG_MFRA_PTS 2 | ||
| 463 | |||
| 464 | /** | ||
| 465 | * Compute codec id for 'lpcm' tag. | ||
| 466 | * See CoreAudioTypes and AudioStreamBasicDescription at Apple. | ||
| 467 | */ | ||
| 468 | 4 | static inline enum AVCodecID ff_mov_get_lpcm_codec_id(int bps, int flags) | |
| 469 | { | ||
| 470 | /* lpcm flags: | ||
| 471 | * 0x1 = float | ||
| 472 | * 0x2 = big-endian | ||
| 473 | * 0x4 = signed | ||
| 474 | */ | ||
| 475 |
1/2✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
|
4 | return ff_get_pcm_codec_id(bps, flags & 1, flags & 2, flags & 4 ? -1 : 0); |
| 476 | } | ||
| 477 | |||
| 478 | #define MOV_ISMV_TTML_TAG MKTAG('d', 'f', 'x', 'p') | ||
| 479 | #define MOV_MP4_TTML_TAG MKTAG('s', 't', 'p', 'p') | ||
| 480 | #define MOV_MP4_FPCM_TAG MKTAG('f', 'p', 'c', 'm') | ||
| 481 | #define MOV_MP4_IPCM_TAG MKTAG('i', 'p', 'c', 'm') | ||
| 482 | |||
| 483 | struct MP4TrackKindValueMapping { | ||
| 484 | int disposition; | ||
| 485 | const char *value; | ||
| 486 | }; | ||
| 487 | |||
| 488 | struct MP4TrackKindMapping { | ||
| 489 | const char *scheme_uri; | ||
| 490 | const struct MP4TrackKindValueMapping *value_maps; | ||
| 491 | }; | ||
| 492 | |||
| 493 | extern const struct MP4TrackKindMapping ff_mov_track_kind_table[]; | ||
| 494 | |||
| 495 | #endif /* AVFORMAT_ISOM_H */ | ||
| 496 |