annotate raw.c @ 282:a864d92bf6b8 libavformat

10l
author alex
date Wed, 15 Oct 2003 15:21:46 +0000
parents a313e1080322
children e7a8d4dd8e14
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
1 /*
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
2 * RAW encoder and decoder
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
3 * Copyright (c) 2001 Fabrice Bellard.
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
4 *
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
5 * This library is free software; you can redistribute it and/or
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
6 * modify it under the terms of the GNU Lesser General Public
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
7 * License as published by the Free Software Foundation; either
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
8 * version 2 of the License, or (at your option) any later version.
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
9 *
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
10 * This library is distributed in the hope that it will be useful,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
13 * Lesser General Public License for more details.
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
14 *
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
15 * You should have received a copy of the GNU Lesser General Public
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
16 * License along with this library; if not, write to the Free Software
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
18 */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
19 #include "avformat.h"
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
20
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
21 #ifdef CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
22 /* simple formats */
64
b0e0eb595e29 * static,const,compiler warning cleanup
kabi
parents: 63
diff changeset
23 static int raw_write_header(struct AVFormatContext *s)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
24 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
25 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
26 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
27
64
b0e0eb595e29 * static,const,compiler warning cleanup
kabi
parents: 63
diff changeset
28 static int raw_write_packet(struct AVFormatContext *s, int stream_index,
241
3d92f793fd67 64 bit pts for writing - more const usage
bellard
parents: 234
diff changeset
29 const uint8_t *buf, int size, int64_t pts)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
30 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
31 put_buffer(&s->pb, buf, size);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
32 put_flush_packet(&s->pb);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
33 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
34 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
35
64
b0e0eb595e29 * static,const,compiler warning cleanup
kabi
parents: 63
diff changeset
36 static int raw_write_trailer(struct AVFormatContext *s)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
37 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
38 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
39 }
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
40 #endif //CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
41
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
42 /* raw input */
65
a58a8a53eb46 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 64
diff changeset
43 static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
44 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
45 AVStream *st;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
46 int id;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
47
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
48 st = av_new_stream(s, 0);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
49 if (!st)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
50 return AVERROR_NOMEM;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
51 if (ap) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
52 id = s->iformat->value;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
53 if (id == CODEC_ID_RAWVIDEO) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
54 st->codec.codec_type = CODEC_TYPE_VIDEO;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
55 } else {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
56 st->codec.codec_type = CODEC_TYPE_AUDIO;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
57 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
58 st->codec.codec_id = id;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
59
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
60 switch(st->codec.codec_type) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
61 case CODEC_TYPE_AUDIO:
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
62 st->codec.sample_rate = ap->sample_rate;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
63 st->codec.channels = ap->channels;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
64 break;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
65 case CODEC_TYPE_VIDEO:
85
25062c9b1f86 per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents: 65
diff changeset
66 st->codec.frame_rate = ap->frame_rate;
25062c9b1f86 per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents: 65
diff changeset
67 st->codec.frame_rate_base = ap->frame_rate_base;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
68 st->codec.width = ap->width;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
69 st->codec.height = ap->height;
128
45633cd5518a * introducing new public interface in imgconvert.c
romansh
parents: 126
diff changeset
70 st->codec.pix_fmt = ap->pix_fmt;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
71 break;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
72 default:
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
73 return -1;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
74 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
75 } else {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
76 return -1;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
77 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
78 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
79 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
80
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
81 #define RAW_PACKET_SIZE 1024
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
82
64
b0e0eb595e29 * static,const,compiler warning cleanup
kabi
parents: 63
diff changeset
83 static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
84 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
85 int ret, size;
28
64678c053566 removed warnings
bellard
parents: 0
diff changeset
86 // AVStream *st = s->streams[0];
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
87
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
88 size= RAW_PACKET_SIZE;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
89
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
90 if (av_new_packet(pkt, size) < 0)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
91 return -EIO;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
92
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
93 pkt->stream_index = 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
94 ret = get_buffer(&s->pb, pkt->data, size);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
95 if (ret <= 0) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
96 av_free_packet(pkt);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
97 return -EIO;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
98 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
99 /* note: we need to modify the packet size here to handle the last
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
100 packet */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
101 pkt->size = ret;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
102 return ret;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
103 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
104
64
b0e0eb595e29 * static,const,compiler warning cleanup
kabi
parents: 63
diff changeset
105 static int raw_read_close(AVFormatContext *s)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
106 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
107 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
108 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
109
63
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
110 /* ac3 read */
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
111 static int ac3_read_header(AVFormatContext *s,
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
112 AVFormatParameters *ap)
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
113 {
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
114 AVStream *st;
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
115
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
116 st = av_new_stream(s, 0);
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
117 if (!st)
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
118 return AVERROR_NOMEM;
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
119
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
120 st->codec.codec_type = CODEC_TYPE_AUDIO;
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
121 st->codec.codec_id = CODEC_ID_AC3;
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
122 /* the parameters will be extracted from the compressed bitstream */
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
123 return 0;
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
124 }
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
125
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
126 /* mpeg1/h263 input */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
127 static int video_read_header(AVFormatContext *s,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
128 AVFormatParameters *ap)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
129 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
130 AVStream *st;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
131
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
132 st = av_new_stream(s, 0);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
133 if (!st)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
134 return AVERROR_NOMEM;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
135
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
136 st->codec.codec_type = CODEC_TYPE_VIDEO;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
137 st->codec.codec_id = s->iformat->value;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
138 /* for mjpeg, specify frame rate */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
139 /* for mpeg4 specify it too (most mpeg4 streams dont have the fixed_vop_rate set ...)*/
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
140 if (st->codec.codec_id == CODEC_ID_MJPEG || st->codec.codec_id == CODEC_ID_MPEG4) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
141 if (ap) {
85
25062c9b1f86 per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents: 65
diff changeset
142 st->codec.frame_rate = ap->frame_rate;
25062c9b1f86 per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents: 65
diff changeset
143 st->codec.frame_rate_base = ap->frame_rate_base;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
144 } else {
85
25062c9b1f86 per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents: 65
diff changeset
145 st->codec.frame_rate = 25;
25062c9b1f86 per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents: 65
diff changeset
146 st->codec.frame_rate_base = 1;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
147 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
148 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
149 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
150 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
151
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
152 #define SEQ_START_CODE 0x000001b3
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
153 #define GOP_START_CODE 0x000001b8
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
154 #define PICTURE_START_CODE 0x00000100
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
155
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
156 /* XXX: improve that by looking at several start codes */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
157 static int mpegvideo_probe(AVProbeData *p)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
158 {
49
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
159 int code;
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
160 const uint8_t *d;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
161
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
162 /* we search the first start code. If it is a sequence, gop or
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
163 picture start code then we decide it is an mpeg video
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
164 stream. We do not send highest value to give a chance to mpegts */
49
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
165 /* NOTE: the search range was restricted to avoid too many false
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
166 detections */
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
167
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
168 if (p->buf_size < 6)
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
169 return 0;
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
170 d = p->buf;
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
171 code = (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | (d[3]);
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
172 if ((code & 0xffffff00) == 0x100) {
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
173 if (code == SEQ_START_CODE ||
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
174 code == GOP_START_CODE ||
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
175 code == PICTURE_START_CODE)
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
176 return 50 - 1;
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
177 else
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
178 return 0;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
179 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
180 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
181 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
182
135
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
183 static int h263_probe(AVProbeData *p)
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
184 {
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
185 int code;
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
186 const uint8_t *d;
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
187
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
188 if (p->buf_size < 6)
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
189 return 0;
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
190 d = p->buf;
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
191 code = (d[0] << 14) | (d[1] << 6) | (d[2] >> 2);
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
192 if (code == 0x20) {
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
193 return 50;
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
194 }
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
195 return 0;
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
196 }
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
197
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
198 AVInputFormat ac3_iformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
199 "ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
200 "raw ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
201 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
202 NULL,
63
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
203 ac3_read_header,
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
204 raw_read_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
205 raw_read_close,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
206 .extensions = "ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
207 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
208
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
209 #ifdef CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
210 AVOutputFormat ac3_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
211 "ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
212 "raw ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
213 "audio/x-ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
214 "ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
215 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
216 CODEC_ID_AC3,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
217 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
218 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
219 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
220 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
221 };
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
222 #endif //CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
223
135
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
224 AVInputFormat h263_iformat = {
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
225 "h263",
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
226 "raw h263",
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
227 0,
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
228 h263_probe,
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
229 video_read_header,
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
230 raw_read_packet,
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
231 raw_read_close,
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
232 // .extensions = "h263", //FIXME remove after writing mpeg4_probe
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
233 .value = CODEC_ID_H263,
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
234 };
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
235
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
236 #ifdef CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
237 AVOutputFormat h263_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
238 "h263",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
239 "raw h263",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
240 "video/x-h263",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
241 "h263",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
242 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
243 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
244 CODEC_ID_H263,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
245 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
246 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
247 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
248 };
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
249 #endif //CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
250
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
251 AVInputFormat m4v_iformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
252 "m4v",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
253 "raw MPEG4 video format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
254 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
255 NULL /*mpegvideo_probe*/,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
256 video_read_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
257 raw_read_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
258 raw_read_close,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
259 .extensions = "m4v", //FIXME remove after writing mpeg4_probe
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
260 .value = CODEC_ID_MPEG4,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
261 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
262
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
263 #ifdef CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
264 AVOutputFormat m4v_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
265 "m4v",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
266 "raw MPEG4 video format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
267 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
268 "m4v",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
269 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
270 CODEC_ID_NONE,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
271 CODEC_ID_MPEG4,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
272 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
273 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
274 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
275 };
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
276 #endif //CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
277
100
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
278 AVInputFormat h264_iformat = {
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
279 "h264",
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
280 "raw H264 video format",
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
281 0,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
282 NULL /*mpegvideo_probe*/,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
283 video_read_header,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
284 raw_read_packet,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
285 raw_read_close,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
286 .extensions = "h26l,h264", //FIXME remove after writing mpeg4_probe
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
287 .value = CODEC_ID_H264,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
288 };
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
289
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
290 #ifdef CONFIG_ENCODERS
100
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
291 AVOutputFormat h264_oformat = {
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
292 "h264",
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
293 "raw H264 video format",
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
294 NULL,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
295 "h264",
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
296 0,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
297 CODEC_ID_NONE,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
298 CODEC_ID_H264,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
299 raw_write_header,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
300 raw_write_packet,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
301 raw_write_trailer,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
302 };
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
303 #endif //CONFIG_ENCODERS
100
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
304
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
305 AVInputFormat mpegvideo_iformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
306 "mpegvideo",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
307 "MPEG video",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
308 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
309 mpegvideo_probe,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
310 video_read_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
311 raw_read_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
312 raw_read_close,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
313 .value = CODEC_ID_MPEG1VIDEO,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
314 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
315
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
316 #ifdef CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
317 AVOutputFormat mpeg1video_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
318 "mpeg1video",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
319 "MPEG video",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
320 "video/x-mpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
321 "mpg,mpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
322 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
323 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
324 CODEC_ID_MPEG1VIDEO,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
325 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
326 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
327 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
328 };
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
329 #endif //CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
330
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
331 AVInputFormat mjpeg_iformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
332 "mjpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
333 "MJPEG video",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
334 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
335 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
336 video_read_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
337 raw_read_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
338 raw_read_close,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
339 .extensions = "mjpg,mjpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
340 .value = CODEC_ID_MJPEG,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
341 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
342
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
343 #ifdef CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
344 AVOutputFormat mjpeg_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
345 "mjpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
346 "MJPEG video",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
347 "video/x-mjpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
348 "mjpg,mjpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
349 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
350 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
351 CODEC_ID_MJPEG,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
352 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
353 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
354 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
355 };
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
356 #endif //CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
357
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
358 /* pcm formats */
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
359 #if !defined(CONFIG_ENCODERS) && defined(CONFIG_DECODERS)
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
360
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
361 #define PCMDEF(name, long_name, ext, codec) \
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
362 AVInputFormat pcm_ ## name ## _iformat = {\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
363 #name,\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
364 long_name,\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
365 0,\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
366 NULL,\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
367 raw_read_header,\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
368 raw_read_packet,\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
369 raw_read_close,\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
370 .extensions = ext,\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
371 .value = codec,\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
372 };
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
373
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
374 #else
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
375
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
376 #define PCMDEF(name, long_name, ext, codec) \
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
377 AVInputFormat pcm_ ## name ## _iformat = {\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
378 #name,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
379 long_name,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
380 0,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
381 NULL,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
382 raw_read_header,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
383 raw_read_packet,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
384 raw_read_close,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
385 .extensions = ext,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
386 .value = codec,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
387 };\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
388 \
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
389 AVOutputFormat pcm_ ## name ## _oformat = {\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
390 #name,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
391 long_name,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
392 NULL,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
393 ext,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
394 0,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
395 codec,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
396 0,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
397 raw_write_header,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
398 raw_write_packet,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
399 raw_write_trailer,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
400 };
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
401 #endif //CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
402
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
403 #ifdef WORDS_BIGENDIAN
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
404 #define BE_DEF(s) s
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
405 #define LE_DEF(s) NULL
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
406 #else
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
407 #define BE_DEF(s) NULL
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
408 #define LE_DEF(s) s
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
409 #endif
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
410
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
411
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
412 PCMDEF(s16le, "pcm signed 16 bit little endian format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
413 LE_DEF("sw"), CODEC_ID_PCM_S16LE)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
414
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
415 PCMDEF(s16be, "pcm signed 16 bit big endian format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
416 BE_DEF("sw"), CODEC_ID_PCM_S16BE)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
417
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
418 PCMDEF(u16le, "pcm unsigned 16 bit little endian format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
419 LE_DEF("uw"), CODEC_ID_PCM_U16LE)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
420
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
421 PCMDEF(u16be, "pcm unsigned 16 bit big endian format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
422 BE_DEF("uw"), CODEC_ID_PCM_U16BE)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
423
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
424 PCMDEF(s8, "pcm signed 8 bit format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
425 "sb", CODEC_ID_PCM_S8)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
426
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
427 PCMDEF(u8, "pcm unsigned 8 bit format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
428 "ub", CODEC_ID_PCM_U8)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
429
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
430 PCMDEF(mulaw, "pcm mu law format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
431 "ul", CODEC_ID_PCM_MULAW)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
432
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
433 PCMDEF(alaw, "pcm A law format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
434 "al", CODEC_ID_PCM_ALAW)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
435
64
b0e0eb595e29 * static,const,compiler warning cleanup
kabi
parents: 63
diff changeset
436 static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
437 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
438 int packet_size, ret, width, height;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
439 AVStream *st = s->streams[0];
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
440
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
441 width = st->codec.width;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
442 height = st->codec.height;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
443
128
45633cd5518a * introducing new public interface in imgconvert.c
romansh
parents: 126
diff changeset
444 packet_size = avpicture_get_size(st->codec.pix_fmt, width, height);
45633cd5518a * introducing new public interface in imgconvert.c
romansh
parents: 126
diff changeset
445 if (packet_size < 0)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
446 av_abort();
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
447
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
448 if (av_new_packet(pkt, packet_size) < 0)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
449 return -EIO;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
450
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
451 pkt->stream_index = 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
452 #if 0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
453 /* bypass buffered I/O */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
454 ret = url_read(url_fileno(&s->pb), pkt->data, pkt->size);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
455 #else
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
456 ret = get_buffer(&s->pb, pkt->data, pkt->size);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
457 #endif
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
458 if (ret != pkt->size) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
459 av_free_packet(pkt);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
460 return -EIO;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
461 } else {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
462 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
463 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
464 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
465
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
466 AVInputFormat rawvideo_iformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
467 "rawvideo",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
468 "raw video format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
469 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
470 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
471 raw_read_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
472 rawvideo_read_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
473 raw_read_close,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
474 .extensions = "yuv",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
475 .value = CODEC_ID_RAWVIDEO,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
476 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
477
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
478 #ifdef CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
479 AVOutputFormat rawvideo_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
480 "rawvideo",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
481 "raw video format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
482 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
483 "yuv",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
484 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
485 CODEC_ID_NONE,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
486 CODEC_ID_RAWVIDEO,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
487 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
488 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
489 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
490 };
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
491 #endif //CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
492
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
493 #ifdef CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
494 static int null_write_packet(struct AVFormatContext *s,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
495 int stream_index,
241
3d92f793fd67 64 bit pts for writing - more const usage
bellard
parents: 234
diff changeset
496 const uint8_t *buf, int size, int64_t pts)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
497 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
498 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
499 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
500
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
501 AVOutputFormat null_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
502 "null",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
503 "null video format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
504 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
505 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
506 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
507 #ifdef WORDS_BIGENDIAN
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
508 CODEC_ID_PCM_S16BE,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
509 #else
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
510 CODEC_ID_PCM_S16LE,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
511 #endif
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
512 CODEC_ID_RAWVIDEO,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
513 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
514 null_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
515 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
516 .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
517 };
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
518 #endif //CONFIG_ENCODERS
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
519
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
520 #ifndef CONFIG_ENCODERS
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
521 #define av_register_output_format(format)
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
522 #endif
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
523 #ifndef CONFIG_DECODERS
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
524 #define av_register_input_format(format)
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
525 #endif
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
526
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
527 int raw_init(void)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
528 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
529 av_register_input_format(&ac3_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
530 av_register_output_format(&ac3_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
531
135
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
532 av_register_input_format(&h263_iformat);
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
533 av_register_output_format(&h263_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
534
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
535 av_register_input_format(&m4v_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
536 av_register_output_format(&m4v_oformat);
100
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
537
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
538 av_register_input_format(&h264_iformat);
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
539 av_register_output_format(&h264_oformat);
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
540
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
541 av_register_input_format(&mpegvideo_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
542 av_register_output_format(&mpeg1video_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
543
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
544 av_register_input_format(&mjpeg_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
545 av_register_output_format(&mjpeg_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
546
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
547 av_register_input_format(&pcm_s16le_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
548 av_register_output_format(&pcm_s16le_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
549 av_register_input_format(&pcm_s16be_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
550 av_register_output_format(&pcm_s16be_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
551 av_register_input_format(&pcm_u16le_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
552 av_register_output_format(&pcm_u16le_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
553 av_register_input_format(&pcm_u16be_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
554 av_register_output_format(&pcm_u16be_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
555 av_register_input_format(&pcm_s8_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
556 av_register_output_format(&pcm_s8_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
557 av_register_input_format(&pcm_u8_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
558 av_register_output_format(&pcm_u8_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
559 av_register_input_format(&pcm_mulaw_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
560 av_register_output_format(&pcm_mulaw_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
561 av_register_input_format(&pcm_alaw_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
562 av_register_output_format(&pcm_alaw_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
563
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
564 av_register_input_format(&rawvideo_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
565 av_register_output_format(&rawvideo_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
566
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
567 av_register_output_format(&null_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
568 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
569 }