Mercurial > libavformat.hg
annotate isom.h @ 4707:f153437e1ac0 libavformat
Set pkt->pos correctly (to the start of header of the packet) in swfdec.
author | reimar |
---|---|
date | Fri, 13 Mar 2009 22:26:45 +0000 |
parents | 2249417477c5 |
children | 5dd75af88ade |
rev | line source |
---|---|
1306
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
1216
diff
changeset
|
1 /* |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
1216
diff
changeset
|
2 * ISO Media common code |
4251
77e0c7511d41
cosmetics: Remove pointless period after copyright statement non-sentences.
diego
parents:
4079
diff
changeset
|
3 * copyright (c) 2001 Fabrice Bellard |
1306
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
1216
diff
changeset
|
4 * copyright (c) 2002 Francois Revol <revol@free.fr> |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
1216
diff
changeset
|
5 * copyright (c) 2006 Baptiste Coudurier <baptiste.coudurier@free.fr> |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
1216
diff
changeset
|
6 * |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1306
diff
changeset
|
7 * This file is part of FFmpeg. |
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1306
diff
changeset
|
8 * |
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1306
diff
changeset
|
9 * FFmpeg is free software; you can redistribute it and/or |
1306
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
1216
diff
changeset
|
10 * modify it under the terms of the GNU Lesser General Public |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
1216
diff
changeset
|
11 * License as published by the Free Software Foundation; either |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1306
diff
changeset
|
12 * version 2.1 of the License, or (at your option) any later version. |
1306
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
1216
diff
changeset
|
13 * |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1306
diff
changeset
|
14 * FFmpeg is distributed in the hope that it will be useful, |
1306
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
1216
diff
changeset
|
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
1216
diff
changeset
|
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
1216
diff
changeset
|
17 * Lesser General Public License for more details. |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
1216
diff
changeset
|
18 * |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
1216
diff
changeset
|
19 * You should have received a copy of the GNU Lesser General Public |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1306
diff
changeset
|
20 * License along with FFmpeg; if not, write to the Free Software |
1306
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
1216
diff
changeset
|
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
1216
diff
changeset
|
22 */ |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
1216
diff
changeset
|
23 |
3852 | 24 #ifndef AVFORMAT_ISOM_H |
25 #define AVFORMAT_ISOM_H | |
943
4e7a66723f1d
mp4 codecs objecttype handling patch by (Baptiste COUDURIER <baptiste.coudurier smartjog com)
michael
parents:
diff
changeset
|
26 |
4690
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
27 #include "avio.h" |
2171 | 28 #include "riff.h" |
4690
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
29 #include "dv.h" |
2171 | 30 |
1216
fec0a3d5408f
move common code from mov.c and movenc.c to isom.c
bcoudurier
parents:
1059
diff
changeset
|
31 /* isom.c */ |
1948 | 32 extern const AVCodecTag ff_mp4_obj_type[]; |
1843 | 33 extern const AVCodecTag codec_movvideo_tags[]; |
34 extern const AVCodecTag codec_movaudio_tags[]; | |
2969 | 35 extern const AVCodecTag ff_codec_movsubtitle_tags[]; |
1216
fec0a3d5408f
move common code from mov.c and movenc.c to isom.c
bcoudurier
parents:
1059
diff
changeset
|
36 |
fec0a3d5408f
move common code from mov.c and movenc.c to isom.c
bcoudurier
parents:
1059
diff
changeset
|
37 int ff_mov_iso639_to_lang(const char *lang, int mp4); |
4269 | 38 int ff_mov_lang_to_iso639(unsigned code, char *to); |
943
4e7a66723f1d
mp4 codecs objecttype handling patch by (Baptiste COUDURIER <baptiste.coudurier smartjog com)
michael
parents:
diff
changeset
|
39 |
4690
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
40 /* the QuickTime file format is quite convoluted... |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
41 * it has lots of index tables, each indexing something in another one... |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
42 * Here we just use what is needed to read the chunks |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
43 */ |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
44 |
2045
aa5e56700fdf
cosmectics, use consistant and homogeneous type names for atoms
bcoudurier
parents:
1948
diff
changeset
|
45 typedef struct { |
971
43f85eba04c4
CTTS support patch by (Baptiste COUDURIER <baptiste.coudurier smartjog com>)
michael
parents:
943
diff
changeset
|
46 int count; |
43f85eba04c4
CTTS support patch by (Baptiste COUDURIER <baptiste.coudurier smartjog com>)
michael
parents:
943
diff
changeset
|
47 int duration; |
4079 | 48 } MOVStts; |
971
43f85eba04c4
CTTS support patch by (Baptiste COUDURIER <baptiste.coudurier smartjog com>)
michael
parents:
943
diff
changeset
|
49 |
4690
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
50 typedef struct { |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
51 int first; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
52 int count; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
53 int id; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
54 } MOVStsc; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
55 |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
56 typedef struct { |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
57 uint32_t type; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
58 char *path; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
59 } MOVDref; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
60 |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
61 typedef struct { |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
62 uint32_t type; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
63 int64_t offset; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
64 int64_t size; /* total size (excluding the size and type fields) */ |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
65 } MOVAtom; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
66 |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
67 struct MOVParseTableEntry; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
68 |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
69 typedef struct { |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
70 unsigned track_id; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
71 uint64_t base_data_offset; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
72 uint64_t moof_offset; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
73 unsigned stsd_id; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
74 unsigned duration; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
75 unsigned size; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
76 unsigned flags; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
77 } MOVFragment; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
78 |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
79 typedef struct { |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
80 unsigned track_id; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
81 unsigned stsd_id; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
82 unsigned duration; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
83 unsigned size; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
84 unsigned flags; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
85 } MOVTrackExt; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
86 |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
87 typedef struct MOVStreamContext { |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
88 ByteIOContext *pb; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
89 int ffindex; /* the ffmpeg stream id */ |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
90 int next_chunk; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
91 unsigned int chunk_count; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
92 int64_t *chunk_offsets; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
93 unsigned int stts_count; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
94 MOVStts *stts_data; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
95 unsigned int ctts_count; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
96 MOVStts *ctts_data; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
97 unsigned int stsc_count; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
98 MOVStsc *stsc_data; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
99 int ctts_index; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
100 int ctts_sample; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
101 unsigned int sample_size; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
102 unsigned int sample_count; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
103 int *sample_sizes; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
104 unsigned int keyframe_count; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
105 int *keyframes; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
106 int time_scale; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
107 int time_rate; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
108 int time_offset; ///< time offset of the first edit list entry |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
109 int current_sample; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
110 unsigned int bytes_per_frame; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
111 unsigned int samples_per_frame; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
112 int dv_audio_container; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
113 int pseudo_stream_id; ///< -1 means demux all ids |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
114 int16_t audio_cid; ///< stsd audio compression id |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
115 unsigned drefs_count; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
116 MOVDref *drefs; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
117 int dref_id; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
118 int wrong_dts; ///< dts are wrong due to negative ctts |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
119 int width; ///< tkhd width |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
120 int height; ///< tkhd height |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
121 } MOVStreamContext; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
122 |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
123 typedef struct MOVContext { |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
124 AVFormatContext *fc; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
125 int time_scale; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
126 int64_t duration; /* duration of the longest track */ |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
127 int found_moov; /* when both 'moov' and 'mdat' sections has been found */ |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
128 int found_mdat; /* we suppose we have enough data to read the file */ |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
129 AVPaletteControl palette_control; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
130 DVDemuxContext *dv_demux; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
131 AVFormatContext *dv_fctx; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
132 int isom; /* 1 if file is ISO Media (mp4/3gp) */ |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
133 MOVFragment fragment; ///< current fragment in moof atom |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
134 MOVTrackExt *trex_data; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
135 unsigned trex_count; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
136 int itunes_metadata; ///< metadata are itunes style |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
137 } MOVContext; |
2249417477c5
Move MOVContext and related structures from mov.c to isom.h. See "[PATCH]
rbultje
parents:
4269
diff
changeset
|
138 |
3852 | 139 #endif /* AVFORMAT_ISOM_H */ |