Mercurial > libavformat.hg
annotate raw.c @ 1070:26d75e74c7b7 libavformat
Add support for raw flac decoding based on the .flac suffix of input files.
author | banan |
---|---|
date | Tue, 09 May 2006 12:34:35 +0000 |
parents | 2d57ce58f576 |
children | 0bc9422cc0ad |
rev | line source |
---|---|
885 | 1 /* |
0 | 2 * RAW encoder and decoder |
3 * Copyright (c) 2001 Fabrice Bellard. | |
868
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
4 * Copyright (c) 2005 Alex Beregszaszi |
0 | 5 * |
6 * This library is free software; you can redistribute it and/or | |
7 * modify it under the terms of the GNU Lesser General Public | |
8 * License as published by the Free Software Foundation; either | |
9 * version 2 of the License, or (at your option) any later version. | |
10 * | |
11 * This library is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 * Lesser General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU Lesser General Public | |
17 * License along with this library; if not, write to the Free Software | |
896
edbe5c3717f9
Update licensing information: The FSF changed postal address.
diego
parents:
887
diff
changeset
|
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
0 | 19 */ |
20 #include "avformat.h" | |
21 | |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
22 #ifdef CONFIG_MUXERS |
0 | 23 /* simple formats */ |
64 | 24 static int raw_write_header(struct AVFormatContext *s) |
0 | 25 { |
26 return 0; | |
27 } | |
28 | |
468 | 29 static int raw_write_packet(struct AVFormatContext *s, AVPacket *pkt) |
0 | 30 { |
468 | 31 put_buffer(&s->pb, pkt->data, pkt->size); |
0 | 32 put_flush_packet(&s->pb); |
33 return 0; | |
34 } | |
35 | |
64 | 36 static int raw_write_trailer(struct AVFormatContext *s) |
0 | 37 { |
38 return 0; | |
39 } | |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
40 #endif //CONFIG_MUXERS |
0 | 41 |
42 /* raw input */ | |
65 | 43 static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap) |
0 | 44 { |
45 AVStream *st; | |
46 int id; | |
47 | |
48 st = av_new_stream(s, 0); | |
49 if (!st) | |
50 return AVERROR_NOMEM; | |
1003 | 51 |
0 | 52 id = s->iformat->value; |
53 if (id == CODEC_ID_RAWVIDEO) { | |
820
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
54 st->codec->codec_type = CODEC_TYPE_VIDEO; |
0 | 55 } else { |
820
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
56 st->codec->codec_type = CODEC_TYPE_AUDIO; |
0 | 57 } |
820
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
58 st->codec->codec_id = id; |
0 | 59 |
820
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
60 switch(st->codec->codec_type) { |
0 | 61 case CODEC_TYPE_AUDIO: |
820
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
62 st->codec->sample_rate = ap->sample_rate; |
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
63 st->codec->channels = ap->channels; |
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
64 av_set_pts_info(st, 64, 1, st->codec->sample_rate); |
0 | 65 break; |
66 case CODEC_TYPE_VIDEO: | |
743 | 67 av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den); |
820
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
68 st->codec->width = ap->width; |
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
69 st->codec->height = ap->height; |
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
70 st->codec->pix_fmt = ap->pix_fmt; |
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
71 if(st->codec->pix_fmt == PIX_FMT_NONE) |
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
72 st->codec->pix_fmt= PIX_FMT_YUV420P; |
0 | 73 break; |
74 default: | |
75 return -1; | |
76 } | |
77 return 0; | |
78 } | |
79 | |
80 #define RAW_PACKET_SIZE 1024 | |
81 | |
64 | 82 static int raw_read_packet(AVFormatContext *s, AVPacket *pkt) |
0 | 83 { |
84 int ret, size; | |
28 | 85 // AVStream *st = s->streams[0]; |
885 | 86 |
0 | 87 size= RAW_PACKET_SIZE; |
88 | |
775 | 89 ret= av_get_packet(&s->pb, pkt, size); |
0 | 90 |
91 pkt->stream_index = 0; | |
92 if (ret <= 0) { | |
482 | 93 return AVERROR_IO; |
0 | 94 } |
95 /* note: we need to modify the packet size here to handle the last | |
96 packet */ | |
97 pkt->size = ret; | |
98 return ret; | |
99 } | |
100 | |
389
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
101 static int raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt) |
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
102 { |
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
103 int ret, size; |
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
104 |
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
105 size = RAW_PACKET_SIZE; |
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
106 |
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
107 if (av_new_packet(pkt, size) < 0) |
482 | 108 return AVERROR_IO; |
885 | 109 |
775 | 110 pkt->pos= url_ftell(&s->pb); |
389
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
111 pkt->stream_index = 0; |
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
112 ret = get_partial_buffer(&s->pb, pkt->data, size); |
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
113 if (ret <= 0) { |
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
114 av_free_packet(pkt); |
482 | 115 return AVERROR_IO; |
389
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
116 } |
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
117 pkt->size = ret; |
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
118 return ret; |
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
119 } |
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
120 |
868
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
121 // http://www.artificis.hu/files/texts/ingenient.txt |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
122 static int ingenient_read_packet(AVFormatContext *s, AVPacket *pkt) |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
123 { |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
124 int ret, size, w, h, unk1, unk2; |
885 | 125 |
868
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
126 if (get_le32(&s->pb) != MKTAG('M', 'J', 'P', 'G')) |
887 | 127 return AVERROR_IO; // FIXME |
868
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
128 |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
129 size = get_le32(&s->pb); |
885 | 130 |
868
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
131 w = get_le16(&s->pb); |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
132 h = get_le16(&s->pb); |
885 | 133 |
868
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
134 url_fskip(&s->pb, 8); // zero + size (padded?) |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
135 url_fskip(&s->pb, 2); |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
136 unk1 = get_le16(&s->pb); |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
137 unk2 = get_le16(&s->pb); |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
138 url_fskip(&s->pb, 22); // ascii timestamp |
885 | 139 |
868
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
140 av_log(NULL, AV_LOG_DEBUG, "Ingenient packet: size=%d, width=%d, height=%d, unk1=%d unk2=%d\n", |
887 | 141 size, w, h, unk1, unk2); |
868
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
142 |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
143 if (av_new_packet(pkt, size) < 0) |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
144 return AVERROR_IO; |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
145 |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
146 pkt->pos = url_ftell(&s->pb); |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
147 pkt->stream_index = 0; |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
148 ret = get_buffer(&s->pb, pkt->data, size); |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
149 if (ret <= 0) { |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
150 av_free_packet(pkt); |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
151 return AVERROR_IO; |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
152 } |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
153 pkt->size = ret; |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
154 return ret; |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
155 } |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
156 |
64 | 157 static int raw_read_close(AVFormatContext *s) |
0 | 158 { |
159 return 0; | |
160 } | |
161 | |
885 | 162 int pcm_read_seek(AVFormatContext *s, |
558 | 163 int stream_index, int64_t timestamp, int flags) |
306 | 164 { |
165 AVStream *st; | |
166 int block_align, byte_rate; | |
167 int64_t pos; | |
168 | |
169 st = s->streams[0]; | |
820
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
170 switch(st->codec->codec_id) { |
306 | 171 case CODEC_ID_PCM_S16LE: |
172 case CODEC_ID_PCM_S16BE: | |
173 case CODEC_ID_PCM_U16LE: | |
174 case CODEC_ID_PCM_U16BE: | |
820
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
175 block_align = 2 * st->codec->channels; |
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
176 byte_rate = block_align * st->codec->sample_rate; |
306 | 177 break; |
178 case CODEC_ID_PCM_S8: | |
179 case CODEC_ID_PCM_U8: | |
180 case CODEC_ID_PCM_MULAW: | |
181 case CODEC_ID_PCM_ALAW: | |
820
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
182 block_align = st->codec->channels; |
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
183 byte_rate = block_align * st->codec->sample_rate; |
306 | 184 break; |
185 default: | |
820
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
186 block_align = st->codec->block_align; |
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
187 byte_rate = st->codec->bit_rate / 8; |
306 | 188 break; |
189 } | |
885 | 190 |
306 | 191 if (block_align <= 0 || byte_rate <= 0) |
192 return -1; | |
193 | |
194 /* compute the position by aligning it to block_align */ | |
885 | 195 pos = av_rescale_rnd(timestamp * byte_rate, |
196 st->time_base.num, | |
558 | 197 st->time_base.den * (int64_t)block_align, |
198 (flags & AVSEEK_FLAG_BACKWARD) ? AV_ROUND_DOWN : AV_ROUND_UP); | |
199 pos *= block_align; | |
306 | 200 |
201 /* recompute exact position */ | |
464 | 202 st->cur_dts = av_rescale(pos, st->time_base.den, byte_rate * (int64_t)st->time_base.num); |
306 | 203 url_fseek(&s->pb, pos + s->data_offset, SEEK_SET); |
204 return 0; | |
205 } | |
206 | |
63 | 207 /* ac3 read */ |
208 static int ac3_read_header(AVFormatContext *s, | |
209 AVFormatParameters *ap) | |
210 { | |
211 AVStream *st; | |
212 | |
213 st = av_new_stream(s, 0); | |
214 if (!st) | |
215 return AVERROR_NOMEM; | |
216 | |
820
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
217 st->codec->codec_type = CODEC_TYPE_AUDIO; |
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
218 st->codec->codec_id = CODEC_ID_AC3; |
306 | 219 st->need_parsing = 1; |
63 | 220 /* the parameters will be extracted from the compressed bitstream */ |
221 return 0; | |
222 } | |
223 | |
686
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
224 static int shorten_read_header(AVFormatContext *s, |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
225 AVFormatParameters *ap) |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
226 { |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
227 AVStream *st; |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
228 |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
229 st = av_new_stream(s, 0); |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
230 if (!st) |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
231 return AVERROR_NOMEM; |
820
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
232 st->codec->codec_type = CODEC_TYPE_AUDIO; |
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
233 st->codec->codec_id = CODEC_ID_SHORTEN; |
686
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
234 st->need_parsing = 1; |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
235 /* the parameters will be extracted from the compressed bitstream */ |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
236 return 0; |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
237 } |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
238 |
1070
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
239 /* flac read */ |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
240 static int flac_read_header(AVFormatContext *s, |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
241 AVFormatParameters *ap) |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
242 { |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
243 AVStream *st; |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
244 |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
245 st = av_new_stream(s, 0); |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
246 if (!st) |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
247 return AVERROR_NOMEM; |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
248 st->codec->codec_type = CODEC_TYPE_AUDIO; |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
249 st->codec->codec_id = CODEC_ID_FLAC; |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
250 st->need_parsing = 1; |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
251 /* the parameters will be extracted from the compressed bitstream */ |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
252 return 0; |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
253 } |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
254 |
496
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
255 /* dts read */ |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
256 static int dts_read_header(AVFormatContext *s, |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
257 AVFormatParameters *ap) |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
258 { |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
259 AVStream *st; |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
260 |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
261 st = av_new_stream(s, 0); |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
262 if (!st) |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
263 return AVERROR_NOMEM; |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
264 |
820
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
265 st->codec->codec_type = CODEC_TYPE_AUDIO; |
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
266 st->codec->codec_id = CODEC_ID_DTS; |
496
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
267 st->need_parsing = 1; |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
268 /* the parameters will be extracted from the compressed bitstream */ |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
269 return 0; |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
270 } |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
271 |
931 | 272 /* aac read */ |
273 static int aac_read_header(AVFormatContext *s, | |
274 AVFormatParameters *ap) | |
275 { | |
276 AVStream *st; | |
277 | |
278 st = av_new_stream(s, 0); | |
279 if (!st) | |
280 return AVERROR_NOMEM; | |
281 | |
282 st->codec->codec_type = CODEC_TYPE_AUDIO; | |
283 st->codec->codec_id = CODEC_ID_AAC; | |
284 st->need_parsing = 1; | |
285 /* the parameters will be extracted from the compressed bitstream */ | |
286 return 0; | |
287 } | |
288 | |
0 | 289 /* mpeg1/h263 input */ |
290 static int video_read_header(AVFormatContext *s, | |
291 AVFormatParameters *ap) | |
292 { | |
293 AVStream *st; | |
294 | |
295 st = av_new_stream(s, 0); | |
296 if (!st) | |
297 return AVERROR_NOMEM; | |
298 | |
820
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
299 st->codec->codec_type = CODEC_TYPE_VIDEO; |
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
300 st->codec->codec_id = s->iformat->value; |
306 | 301 st->need_parsing = 1; |
302 | |
0 | 303 /* for mjpeg, specify frame rate */ |
304 /* for mpeg4 specify it too (most mpeg4 streams dont have the fixed_vop_rate set ...)*/ | |
1003 | 305 if (ap->time_base.num) { |
745 | 306 av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den); |
885 | 307 } else if ( st->codec->codec_id == CODEC_ID_MJPEG || |
820
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
308 st->codec->codec_id == CODEC_ID_MPEG4 || |
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
309 st->codec->codec_id == CODEC_ID_H264) { |
745 | 310 av_set_pts_info(st, 64, 1, 25); |
0 | 311 } |
745 | 312 |
0 | 313 return 0; |
314 } | |
315 | |
887 | 316 #define SEQ_START_CODE 0x000001b3 |
317 #define GOP_START_CODE 0x000001b8 | |
318 #define PICTURE_START_CODE 0x00000100 | |
924 | 319 #define SLICE_START_CODE 0x00000101 |
320 #define PACK_START_CODE 0x000001ba | |
985
7f8b1a1ac020
can't have PES headers in MPEG video elementary streams so fail probe
mru
parents:
939
diff
changeset
|
321 #define VIDEO_ID 0x000001e0 |
7f8b1a1ac020
can't have PES headers in MPEG video elementary streams so fail probe
mru
parents:
939
diff
changeset
|
322 #define AUDIO_ID 0x000001c0 |
0 | 323 |
324 static int mpegvideo_probe(AVProbeData *p) | |
325 { | |
924 | 326 uint32_t code= -1; |
985
7f8b1a1ac020
can't have PES headers in MPEG video elementary streams so fail probe
mru
parents:
939
diff
changeset
|
327 int pic=0, seq=0, slice=0, pspack=0, pes=0; |
924 | 328 int i; |
49 | 329 |
924 | 330 for(i=0; i<p->buf_size; i++){ |
331 code = (code<<8) + p->buf[i]; | |
332 if ((code & 0xffffff00) == 0x100) { | |
333 switch(code){ | |
334 case SEQ_START_CODE: seq++; break; | |
335 case PICTURE_START_CODE: pic++; break; | |
336 case SLICE_START_CODE: slice++; break; | |
337 case PACK_START_CODE: pspack++; break; | |
985
7f8b1a1ac020
can't have PES headers in MPEG video elementary streams so fail probe
mru
parents:
939
diff
changeset
|
338 case VIDEO_ID: |
7f8b1a1ac020
can't have PES headers in MPEG video elementary streams so fail probe
mru
parents:
939
diff
changeset
|
339 case AUDIO_ID: pes++; break; |
924 | 340 } |
341 } | |
0 | 342 } |
985
7f8b1a1ac020
can't have PES headers in MPEG video elementary streams so fail probe
mru
parents:
939
diff
changeset
|
343 if(seq && seq*9<=pic*10 && pic*9<=slice*10 && !pspack && !pes) |
924 | 344 return AVPROBE_SCORE_MAX/2+1; // +1 for .mpg |
0 | 345 return 0; |
346 } | |
347 | |
135
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
348 static int h263_probe(AVProbeData *p) |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
349 { |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
350 int code; |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
351 const uint8_t *d; |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
352 |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
353 if (p->buf_size < 6) |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
354 return 0; |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
355 d = p->buf; |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
356 code = (d[0] << 14) | (d[1] << 6) | (d[2] >> 2); |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
357 if (code == 0x20) { |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
358 return 50; |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
359 } |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
360 return 0; |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
361 } |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
362 |
473
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
363 static int h261_probe(AVProbeData *p) |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
364 { |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
365 int code; |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
366 const uint8_t *d; |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
367 |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
368 if (p->buf_size < 6) |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
369 return 0; |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
370 d = p->buf; |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
371 code = (d[0] << 12) | (d[1] << 4) | (d[2] >> 4); |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
372 if (code == 0x10) { |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
373 return 50; |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
374 } |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
375 return 0; |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
376 } |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
377 |
686
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
378 AVInputFormat shorten_iformat = { |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
379 "shn", |
868
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
380 "raw shorten", |
686
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
381 0, |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
382 NULL, |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
383 shorten_read_header, |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
384 raw_read_partial_packet, |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
385 raw_read_close, |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
386 .extensions = "shn", |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
387 }; |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
388 |
1070
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
389 AVInputFormat flac_iformat = { |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
390 "flac", |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
391 "raw flac", |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
392 0, |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
393 NULL, |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
394 flac_read_header, |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
395 raw_read_partial_packet, |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
396 raw_read_close, |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
397 .extensions = "flac", |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
398 }; |
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
399 |
0 | 400 AVInputFormat ac3_iformat = { |
401 "ac3", | |
402 "raw ac3", | |
403 0, | |
404 NULL, | |
63 | 405 ac3_read_header, |
389
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
406 raw_read_partial_packet, |
0 | 407 raw_read_close, |
408 .extensions = "ac3", | |
409 }; | |
410 | |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
411 #ifdef CONFIG_MUXERS |
0 | 412 AVOutputFormat ac3_oformat = { |
413 "ac3", | |
414 "raw ac3", | |
885 | 415 "audio/x-ac3", |
0 | 416 "ac3", |
417 0, | |
418 CODEC_ID_AC3, | |
419 0, | |
420 raw_write_header, | |
421 raw_write_packet, | |
422 raw_write_trailer, | |
423 }; | |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
424 #endif //CONFIG_MUXERS |
0 | 425 |
496
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
426 AVInputFormat dts_iformat = { |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
427 "dts", |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
428 "raw dts", |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
429 0, |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
430 NULL, |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
431 dts_read_header, |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
432 raw_read_partial_packet, |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
433 raw_read_close, |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
434 .extensions = "dts", |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
435 }; |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
436 |
931 | 437 AVInputFormat aac_iformat = { |
438 "aac", | |
439 "ADTS AAC", | |
440 0, | |
441 NULL, | |
442 aac_read_header, | |
443 raw_read_partial_packet, | |
444 raw_read_close, | |
445 .extensions = "aac", | |
446 }; | |
447 | |
473
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
448 AVInputFormat h261_iformat = { |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
449 "h261", |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
450 "raw h261", |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
451 0, |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
452 h261_probe, |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
453 video_read_header, |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
454 raw_read_partial_packet, |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
455 raw_read_close, |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
456 .extensions = "h261", |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
457 .value = CODEC_ID_H261, |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
458 }; |
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
459 |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
460 #ifdef CONFIG_MUXERS |
576
f701ba509d0c
H.261 encoder by (Maarten Daniels <maarten dot daniels at luc dot ac dot be>)
michael
parents:
567
diff
changeset
|
461 AVOutputFormat h261_oformat = { |
f701ba509d0c
H.261 encoder by (Maarten Daniels <maarten dot daniels at luc dot ac dot be>)
michael
parents:
567
diff
changeset
|
462 "h261", |
f701ba509d0c
H.261 encoder by (Maarten Daniels <maarten dot daniels at luc dot ac dot be>)
michael
parents:
567
diff
changeset
|
463 "raw h261", |
f701ba509d0c
H.261 encoder by (Maarten Daniels <maarten dot daniels at luc dot ac dot be>)
michael
parents:
567
diff
changeset
|
464 "video/x-h261", |
f701ba509d0c
H.261 encoder by (Maarten Daniels <maarten dot daniels at luc dot ac dot be>)
michael
parents:
567
diff
changeset
|
465 "h261", |
f701ba509d0c
H.261 encoder by (Maarten Daniels <maarten dot daniels at luc dot ac dot be>)
michael
parents:
567
diff
changeset
|
466 0, |
f701ba509d0c
H.261 encoder by (Maarten Daniels <maarten dot daniels at luc dot ac dot be>)
michael
parents:
567
diff
changeset
|
467 0, |
f701ba509d0c
H.261 encoder by (Maarten Daniels <maarten dot daniels at luc dot ac dot be>)
michael
parents:
567
diff
changeset
|
468 CODEC_ID_H261, |
f701ba509d0c
H.261 encoder by (Maarten Daniels <maarten dot daniels at luc dot ac dot be>)
michael
parents:
567
diff
changeset
|
469 raw_write_header, |
f701ba509d0c
H.261 encoder by (Maarten Daniels <maarten dot daniels at luc dot ac dot be>)
michael
parents:
567
diff
changeset
|
470 raw_write_packet, |
f701ba509d0c
H.261 encoder by (Maarten Daniels <maarten dot daniels at luc dot ac dot be>)
michael
parents:
567
diff
changeset
|
471 raw_write_trailer, |
f701ba509d0c
H.261 encoder by (Maarten Daniels <maarten dot daniels at luc dot ac dot be>)
michael
parents:
567
diff
changeset
|
472 }; |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
473 #endif //CONFIG_MUXERS |
576
f701ba509d0c
H.261 encoder by (Maarten Daniels <maarten dot daniels at luc dot ac dot be>)
michael
parents:
567
diff
changeset
|
474 |
135
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
475 AVInputFormat h263_iformat = { |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
476 "h263", |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
477 "raw h263", |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
478 0, |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
479 h263_probe, |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
480 video_read_header, |
389
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
481 raw_read_partial_packet, |
135
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
482 raw_read_close, |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
483 // .extensions = "h263", //FIXME remove after writing mpeg4_probe |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
484 .value = CODEC_ID_H263, |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
485 }; |
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
486 |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
487 #ifdef CONFIG_MUXERS |
0 | 488 AVOutputFormat h263_oformat = { |
489 "h263", | |
490 "raw h263", | |
491 "video/x-h263", | |
492 "h263", | |
493 0, | |
494 0, | |
495 CODEC_ID_H263, | |
496 raw_write_header, | |
497 raw_write_packet, | |
498 raw_write_trailer, | |
499 }; | |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
500 #endif //CONFIG_MUXERS |
0 | 501 |
502 AVInputFormat m4v_iformat = { | |
503 "m4v", | |
504 "raw MPEG4 video format", | |
505 0, | |
506 NULL /*mpegvideo_probe*/, | |
507 video_read_header, | |
389
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
508 raw_read_partial_packet, |
0 | 509 raw_read_close, |
510 .extensions = "m4v", //FIXME remove after writing mpeg4_probe | |
511 .value = CODEC_ID_MPEG4, | |
512 }; | |
513 | |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
514 #ifdef CONFIG_MUXERS |
0 | 515 AVOutputFormat m4v_oformat = { |
516 "m4v", | |
517 "raw MPEG4 video format", | |
518 NULL, | |
519 "m4v", | |
520 0, | |
521 CODEC_ID_NONE, | |
522 CODEC_ID_MPEG4, | |
523 raw_write_header, | |
524 raw_write_packet, | |
525 raw_write_trailer, | |
526 }; | |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
527 #endif //CONFIG_MUXERS |
0 | 528 |
100 | 529 AVInputFormat h264_iformat = { |
530 "h264", | |
531 "raw H264 video format", | |
532 0, | |
533 NULL /*mpegvideo_probe*/, | |
534 video_read_header, | |
389
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
535 raw_read_partial_packet, |
100 | 536 raw_read_close, |
808 | 537 .extensions = "h26l,h264,264", //FIXME remove after writing mpeg4_probe |
100 | 538 .value = CODEC_ID_H264, |
539 }; | |
540 | |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
541 #ifdef CONFIG_MUXERS |
100 | 542 AVOutputFormat h264_oformat = { |
543 "h264", | |
544 "raw H264 video format", | |
545 NULL, | |
546 "h264", | |
547 0, | |
548 CODEC_ID_NONE, | |
549 CODEC_ID_H264, | |
550 raw_write_header, | |
551 raw_write_packet, | |
552 raw_write_trailer, | |
553 }; | |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
554 #endif //CONFIG_MUXERS |
100 | 555 |
0 | 556 AVInputFormat mpegvideo_iformat = { |
557 "mpegvideo", | |
558 "MPEG video", | |
559 0, | |
560 mpegvideo_probe, | |
561 video_read_header, | |
389
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
562 raw_read_partial_packet, |
0 | 563 raw_read_close, |
564 .value = CODEC_ID_MPEG1VIDEO, | |
565 }; | |
566 | |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
567 #ifdef CONFIG_MUXERS |
0 | 568 AVOutputFormat mpeg1video_oformat = { |
569 "mpeg1video", | |
570 "MPEG video", | |
571 "video/x-mpeg", | |
814 | 572 "mpg,mpeg,m1v", |
0 | 573 0, |
574 0, | |
575 CODEC_ID_MPEG1VIDEO, | |
576 raw_write_header, | |
577 raw_write_packet, | |
578 raw_write_trailer, | |
579 }; | |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
580 #endif //CONFIG_MUXERS |
0 | 581 |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
582 #ifdef CONFIG_MUXERS |
637
76e36d97a27a
Patch for creating m2v files by (Fabrizio Gennari <fabrizio.ge tiscali it)
michael
parents:
576
diff
changeset
|
583 AVOutputFormat mpeg2video_oformat = { |
76e36d97a27a
Patch for creating m2v files by (Fabrizio Gennari <fabrizio.ge tiscali it)
michael
parents:
576
diff
changeset
|
584 "mpeg2video", |
76e36d97a27a
Patch for creating m2v files by (Fabrizio Gennari <fabrizio.ge tiscali it)
michael
parents:
576
diff
changeset
|
585 "MPEG2 video", |
76e36d97a27a
Patch for creating m2v files by (Fabrizio Gennari <fabrizio.ge tiscali it)
michael
parents:
576
diff
changeset
|
586 NULL, |
76e36d97a27a
Patch for creating m2v files by (Fabrizio Gennari <fabrizio.ge tiscali it)
michael
parents:
576
diff
changeset
|
587 "m2v", |
76e36d97a27a
Patch for creating m2v files by (Fabrizio Gennari <fabrizio.ge tiscali it)
michael
parents:
576
diff
changeset
|
588 0, |
76e36d97a27a
Patch for creating m2v files by (Fabrizio Gennari <fabrizio.ge tiscali it)
michael
parents:
576
diff
changeset
|
589 0, |
76e36d97a27a
Patch for creating m2v files by (Fabrizio Gennari <fabrizio.ge tiscali it)
michael
parents:
576
diff
changeset
|
590 CODEC_ID_MPEG2VIDEO, |
76e36d97a27a
Patch for creating m2v files by (Fabrizio Gennari <fabrizio.ge tiscali it)
michael
parents:
576
diff
changeset
|
591 raw_write_header, |
76e36d97a27a
Patch for creating m2v files by (Fabrizio Gennari <fabrizio.ge tiscali it)
michael
parents:
576
diff
changeset
|
592 raw_write_packet, |
76e36d97a27a
Patch for creating m2v files by (Fabrizio Gennari <fabrizio.ge tiscali it)
michael
parents:
576
diff
changeset
|
593 raw_write_trailer, |
76e36d97a27a
Patch for creating m2v files by (Fabrizio Gennari <fabrizio.ge tiscali it)
michael
parents:
576
diff
changeset
|
594 }; |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
595 #endif //CONFIG_MUXERS |
637
76e36d97a27a
Patch for creating m2v files by (Fabrizio Gennari <fabrizio.ge tiscali it)
michael
parents:
576
diff
changeset
|
596 |
0 | 597 AVInputFormat mjpeg_iformat = { |
598 "mjpeg", | |
599 "MJPEG video", | |
600 0, | |
601 NULL, | |
602 video_read_header, | |
389
e14fcd57ad2f
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents:
306
diff
changeset
|
603 raw_read_partial_packet, |
0 | 604 raw_read_close, |
605 .extensions = "mjpg,mjpeg", | |
606 .value = CODEC_ID_MJPEG, | |
607 }; | |
608 | |
868
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
609 AVInputFormat ingenient_iformat = { |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
610 "ingenient", |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
611 "Ingenient MJPEG", |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
612 0, |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
613 NULL, |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
614 video_read_header, |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
615 ingenient_read_packet, |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
616 raw_read_close, |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
617 .extensions = "cgi", // FIXME |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
618 .value = CODEC_ID_MJPEG, |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
619 }; |
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
620 |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
621 #ifdef CONFIG_MUXERS |
0 | 622 AVOutputFormat mjpeg_oformat = { |
623 "mjpeg", | |
624 "MJPEG video", | |
625 "video/x-mjpeg", | |
626 "mjpg,mjpeg", | |
627 0, | |
628 0, | |
629 CODEC_ID_MJPEG, | |
630 raw_write_header, | |
631 raw_write_packet, | |
632 raw_write_trailer, | |
633 }; | |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
634 #endif //CONFIG_MUXERS |
0 | 635 |
636 /* pcm formats */ | |
277
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
637 |
306 | 638 #define PCMINPUTDEF(name, long_name, ext, codec) \ |
277
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
639 AVInputFormat pcm_ ## name ## _iformat = {\ |
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
640 #name,\ |
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
641 long_name,\ |
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
642 0,\ |
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
643 NULL,\ |
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
644 raw_read_header,\ |
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
645 raw_read_packet,\ |
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
646 raw_read_close,\ |
306 | 647 pcm_read_seek,\ |
277
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
648 .extensions = ext,\ |
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
649 .value = codec,\ |
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
650 }; |
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
651 |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
652 #if !defined(CONFIG_MUXERS) && defined(CONFIG_DEMUXERS) |
306 | 653 |
654 #define PCMDEF(name, long_name, ext, codec) \ | |
655 PCMINPUTDEF(name, long_name, ext, codec) | |
656 | |
277
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
657 #else |
0 | 658 |
659 #define PCMDEF(name, long_name, ext, codec) \ | |
306 | 660 PCMINPUTDEF(name, long_name, ext, codec)\ |
0 | 661 \ |
662 AVOutputFormat pcm_ ## name ## _oformat = {\ | |
663 #name,\ | |
664 long_name,\ | |
665 NULL,\ | |
666 ext,\ | |
667 0,\ | |
668 codec,\ | |
669 0,\ | |
670 raw_write_header,\ | |
671 raw_write_packet,\ | |
672 raw_write_trailer,\ | |
673 }; | |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
674 #endif //CONFIG_MUXERS |
0 | 675 |
676 #ifdef WORDS_BIGENDIAN | |
677 #define BE_DEF(s) s | |
678 #define LE_DEF(s) NULL | |
679 #else | |
680 #define BE_DEF(s) NULL | |
681 #define LE_DEF(s) s | |
682 #endif | |
683 | |
684 | |
885 | 685 PCMDEF(s16le, "pcm signed 16 bit little endian format", |
0 | 686 LE_DEF("sw"), CODEC_ID_PCM_S16LE) |
687 | |
885 | 688 PCMDEF(s16be, "pcm signed 16 bit big endian format", |
0 | 689 BE_DEF("sw"), CODEC_ID_PCM_S16BE) |
690 | |
885 | 691 PCMDEF(u16le, "pcm unsigned 16 bit little endian format", |
0 | 692 LE_DEF("uw"), CODEC_ID_PCM_U16LE) |
693 | |
885 | 694 PCMDEF(u16be, "pcm unsigned 16 bit big endian format", |
0 | 695 BE_DEF("uw"), CODEC_ID_PCM_U16BE) |
696 | |
885 | 697 PCMDEF(s8, "pcm signed 8 bit format", |
0 | 698 "sb", CODEC_ID_PCM_S8) |
699 | |
885 | 700 PCMDEF(u8, "pcm unsigned 8 bit format", |
0 | 701 "ub", CODEC_ID_PCM_U8) |
702 | |
885 | 703 PCMDEF(mulaw, "pcm mu law format", |
0 | 704 "ul", CODEC_ID_PCM_MULAW) |
705 | |
885 | 706 PCMDEF(alaw, "pcm A law format", |
0 | 707 "al", CODEC_ID_PCM_ALAW) |
708 | |
64 | 709 static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt) |
0 | 710 { |
711 int packet_size, ret, width, height; | |
712 AVStream *st = s->streams[0]; | |
713 | |
820
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
714 width = st->codec->width; |
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
715 height = st->codec->height; |
0 | 716 |
820
feca73904e67
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
michael
parents:
814
diff
changeset
|
717 packet_size = avpicture_get_size(st->codec->pix_fmt, width, height); |
128 | 718 if (packet_size < 0) |
537 | 719 return -1; |
0 | 720 |
775 | 721 ret= av_get_packet(&s->pb, pkt, packet_size); |
0 | 722 |
723 pkt->stream_index = 0; | |
775 | 724 if (ret != packet_size) { |
482 | 725 return AVERROR_IO; |
0 | 726 } else { |
727 return 0; | |
728 } | |
729 } | |
730 | |
731 AVInputFormat rawvideo_iformat = { | |
732 "rawvideo", | |
733 "raw video format", | |
734 0, | |
735 NULL, | |
736 raw_read_header, | |
737 rawvideo_read_packet, | |
738 raw_read_close, | |
749
1a19a6add674
default to YUV420P if none specified for rawvideo input
michael
parents:
745
diff
changeset
|
739 .extensions = "yuv,cif,qcif", |
0 | 740 .value = CODEC_ID_RAWVIDEO, |
741 }; | |
742 | |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
743 #ifdef CONFIG_MUXERS |
0 | 744 AVOutputFormat rawvideo_oformat = { |
745 "rawvideo", | |
746 "raw video format", | |
747 NULL, | |
748 "yuv", | |
749 0, | |
750 CODEC_ID_NONE, | |
751 CODEC_ID_RAWVIDEO, | |
752 raw_write_header, | |
753 raw_write_packet, | |
754 raw_write_trailer, | |
755 }; | |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
756 #endif //CONFIG_MUXERS |
0 | 757 |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
758 #ifdef CONFIG_MUXERS |
468 | 759 static int null_write_packet(struct AVFormatContext *s, AVPacket *pkt) |
0 | 760 { |
761 return 0; | |
762 } | |
763 | |
764 AVOutputFormat null_oformat = { | |
765 "null", | |
766 "null video format", | |
767 NULL, | |
768 NULL, | |
769 0, | |
770 #ifdef WORDS_BIGENDIAN | |
771 CODEC_ID_PCM_S16BE, | |
772 #else | |
773 CODEC_ID_PCM_S16LE, | |
774 #endif | |
775 CODEC_ID_RAWVIDEO, | |
776 raw_write_header, | |
777 null_write_packet, | |
778 raw_write_trailer, | |
779 .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE, | |
780 }; | |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
781 #endif //CONFIG_MUXERS |
277
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
782 |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
783 #ifndef CONFIG_MUXERS |
277
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
784 #define av_register_output_format(format) |
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
785 #endif |
858
66cc656ea404
Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
diego
parents:
820
diff
changeset
|
786 #ifndef CONFIG_DEMUXERS |
277
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
787 #define av_register_input_format(format) |
a313e1080322
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
241
diff
changeset
|
788 #endif |
0 | 789 |
790 int raw_init(void) | |
791 { | |
686
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
792 |
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
793 av_register_input_format(&shorten_iformat); |
1070
26d75e74c7b7
Add support for raw flac decoding based on the .flac suffix of input files.
banan
parents:
1003
diff
changeset
|
794 av_register_input_format(&flac_iformat); |
686
e2687b784c3a
shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
michael
parents:
637
diff
changeset
|
795 |
0 | 796 av_register_input_format(&ac3_iformat); |
797 av_register_output_format(&ac3_oformat); | |
798 | |
931 | 799 av_register_input_format(&aac_iformat); |
800 | |
496
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
801 av_register_input_format(&dts_iformat); |
112057e05179
libdts support by (Benjamin Zores <ben at geexbox dot org>)
michael
parents:
483
diff
changeset
|
802 |
473
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
803 av_register_input_format(&h261_iformat); |
576
f701ba509d0c
H.261 encoder by (Maarten Daniels <maarten dot daniels at luc dot ac dot be>)
michael
parents:
567
diff
changeset
|
804 av_register_output_format(&h261_oformat); |
473
e0a66a870b7f
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents:
468
diff
changeset
|
805 |
135
56590088f801
truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents:
128
diff
changeset
|
806 av_register_input_format(&h263_iformat); |
0 | 807 av_register_output_format(&h263_oformat); |
885 | 808 |
0 | 809 av_register_input_format(&m4v_iformat); |
810 av_register_output_format(&m4v_oformat); | |
885 | 811 |
100 | 812 av_register_input_format(&h264_iformat); |
813 av_register_output_format(&h264_oformat); | |
0 | 814 |
815 av_register_input_format(&mpegvideo_iformat); | |
816 av_register_output_format(&mpeg1video_oformat); | |
817 | |
637
76e36d97a27a
Patch for creating m2v files by (Fabrizio Gennari <fabrizio.ge tiscali it)
michael
parents:
576
diff
changeset
|
818 av_register_output_format(&mpeg2video_oformat); |
76e36d97a27a
Patch for creating m2v files by (Fabrizio Gennari <fabrizio.ge tiscali it)
michael
parents:
576
diff
changeset
|
819 |
0 | 820 av_register_input_format(&mjpeg_iformat); |
821 av_register_output_format(&mjpeg_oformat); | |
885 | 822 |
868
c6b1dde68f3a
Ingenient MJPEG support, more at http://www.artificis.hu/files/texts/ingenient.txt
alex
parents:
858
diff
changeset
|
823 av_register_input_format(&ingenient_iformat); |
0 | 824 |
825 av_register_input_format(&pcm_s16le_iformat); | |
826 av_register_output_format(&pcm_s16le_oformat); | |
827 av_register_input_format(&pcm_s16be_iformat); | |
828 av_register_output_format(&pcm_s16be_oformat); | |
829 av_register_input_format(&pcm_u16le_iformat); | |
830 av_register_output_format(&pcm_u16le_oformat); | |
831 av_register_input_format(&pcm_u16be_iformat); | |
832 av_register_output_format(&pcm_u16be_oformat); | |
833 av_register_input_format(&pcm_s8_iformat); | |
834 av_register_output_format(&pcm_s8_oformat); | |
835 av_register_input_format(&pcm_u8_iformat); | |
836 av_register_output_format(&pcm_u8_oformat); | |
837 av_register_input_format(&pcm_mulaw_iformat); | |
838 av_register_output_format(&pcm_mulaw_oformat); | |
839 av_register_input_format(&pcm_alaw_iformat); | |
840 av_register_output_format(&pcm_alaw_oformat); | |
841 | |
842 av_register_input_format(&rawvideo_iformat); | |
843 av_register_output_format(&rawvideo_oformat); | |
844 | |
845 av_register_output_format(&null_oformat); | |
846 return 0; | |
847 } |