X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fisom.h;h=1df666f1ffcb347ca651cf85c20cc646d9cd0404;hb=655e45e7dfafc494044cc52f8889fc6da75eff6a;hp=5b18f1ee98a230be2cb0565aa33d6598cacf8d99;hpb=4b29ed399f3cab201138490c976806118c25e06b;p=ffmpeg diff --git a/libavformat/isom.h b/libavformat/isom.h index 5b18f1ee98a..1df666f1ffc 100644 --- a/libavformat/isom.h +++ b/libavformat/isom.h @@ -25,7 +25,7 @@ #define AVFORMAT_ISOM_H #include "avio.h" -#include "riff.h" +#include "internal.h" #include "dv.h" /* isom.c */ @@ -34,8 +34,8 @@ extern const AVCodecTag codec_movvideo_tags[]; extern const AVCodecTag codec_movaudio_tags[]; extern const AVCodecTag ff_codec_movsubtitle_tags[]; -int ff_mov_iso639_to_lang(const char *lang, int mp4); -int ff_mov_lang_to_iso639(unsigned code, char *to); +int ff_mov_iso639_to_lang(const char lang[4], int mp4); +int ff_mov_lang_to_iso639(unsigned code, char to[4]); /* the QuickTime file format is quite convoluted... * it has lots of index tables, each indexing something in another one... @@ -56,11 +56,14 @@ typedef struct { typedef struct { uint32_t type; char *path; + char *dir; + char volume[28]; + char filename[64]; + int16_t nlvl_to, nlvl_from; } MOVDref; typedef struct { uint32_t type; - int64_t offset; int64_t size; /* total size (excluding the size and type fields) */ } MOVAtom; @@ -85,8 +88,8 @@ typedef struct { } MOVTrackExt; typedef struct MOVStreamContext { - ByteIOContext *pb; - int ffindex; /* the ffmpeg stream id */ + AVIOContext *pb; + int ffindex; ///< AVStream index int next_chunk; unsigned int chunk_count; int64_t *chunk_offsets; @@ -96,6 +99,8 @@ typedef struct MOVStreamContext { MOVStts *ctts_data; unsigned int stsc_count; MOVStsc *stsc_data; + unsigned int stps_count; + unsigned *stps_data; ///< partial sync sample for mpeg-2 open gop int ctts_index; int ctts_sample; unsigned int sample_size; @@ -104,36 +109,50 @@ typedef struct MOVStreamContext { unsigned int keyframe_count; int *keyframes; int time_scale; - int time_rate; - int time_offset; ///< time offset of the first edit list entry + int time_offset; ///< time offset of the first edit list entry int current_sample; unsigned int bytes_per_frame; unsigned int samples_per_frame; int dv_audio_container; int pseudo_stream_id; ///< -1 means demux all ids - int16_t audio_cid; ///< stsd audio compression id + int16_t audio_cid; ///< stsd audio compression id unsigned drefs_count; MOVDref *drefs; int dref_id; - int wrong_dts; ///< dts are wrong due to huge ctts offset (iMovie files) - int width; ///< tkhd width - int height; ///< tkhd height - int dts_shift; ///< dts shift when ctts is negative + int wrong_dts; ///< dts are wrong due to huge ctts offset (iMovie files) + int width; ///< tkhd width + int height; ///< tkhd height + int dts_shift; ///< dts shift when ctts is negative } MOVStreamContext; typedef struct MOVContext { AVFormatContext *fc; int time_scale; - int64_t duration; /* duration of the longest track */ - int found_moov; /* when both 'moov' and 'mdat' sections has been found */ - int found_mdat; /* we suppose we have enough data to read the file */ + int64_t duration; ///< duration of the longest track + int found_moov; ///< 'moov' atom has been found + int found_mdat; ///< 'mdat' atom has been found DVDemuxContext *dv_demux; AVFormatContext *dv_fctx; - int isom; /* 1 if file is ISO Media (mp4/3gp) */ + int isom; ///< 1 if file is ISO Media (mp4/3gp) MOVFragment fragment; ///< current fragment in moof atom MOVTrackExt *trex_data; unsigned trex_count; - int itunes_metadata; ///< metadata are itunes style + int itunes_metadata; ///< metadata are itunes style + int chapter_track; } MOVContext; +int ff_mp4_read_descr_len(AVIOContext *pb); +int ff_mp4_read_descr(AVFormatContext *fc, AVIOContext *pb, int *tag); +int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext *pb); + +#define MP4IODescrTag 0x02 +#define MP4ESDescrTag 0x03 +#define MP4DecConfigDescrTag 0x04 +#define MP4DecSpecificDescrTag 0x05 + +int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb, MOVAtom atom); +enum CodecID ff_mov_get_lpcm_codec_id(int bps, int flags); + +int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries); + #endif /* AVFORMAT_ISOM_H */