annotate raw.c @ 43:a23fb606308a libavformat

added basic png handling - do not remake dependencies automatically
author bellard
date Sat, 01 Feb 2003 20:53:07 +0000
parents 64678c053566
children 3e7e13e08b27
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
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
21 /* simple formats */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
22 int raw_write_header(struct AVFormatContext *s)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
23 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
24 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
25 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
26
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
27 int raw_write_packet(struct AVFormatContext *s,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
28 int stream_index,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
29 unsigned char *buf, int size, int force_pts)
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
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
36 int raw_write_trailer(struct AVFormatContext *s)
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 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
40
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
41 /* raw input */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
42 static int raw_read_header(AVFormatContext *s,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
43 AVFormatParameters *ap)
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:
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
66 st->codec.frame_rate = ap->frame_rate;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
67 st->codec.width = ap->width;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
68 st->codec.height = ap->height;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
69 break;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
70 default:
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
71 return -1;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
72 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
73 } else {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
74 return -1;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
75 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
76 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
77 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
78
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
79 #define RAW_PACKET_SIZE 1024
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
80
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
81 int raw_read_packet(AVFormatContext *s,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
82 AVPacket *pkt)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
83 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
84 int ret, size;
28
64678c053566 removed warnings
bellard
parents: 0
diff changeset
85 // AVStream *st = s->streams[0];
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
86
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
87 size= RAW_PACKET_SIZE;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
88
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
89 if (av_new_packet(pkt, size) < 0)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
90 return -EIO;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
91
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
92 pkt->stream_index = 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
93 ret = get_buffer(&s->pb, pkt->data, size);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
94 if (ret <= 0) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
95 av_free_packet(pkt);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
96 return -EIO;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
97 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
98 /* note: we need to modify the packet size here to handle the last
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
99 packet */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
100 pkt->size = ret;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
101 return ret;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
102 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
103
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
104 int raw_read_close(AVFormatContext *s)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
105 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
106 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
107 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
108
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
109 /* mp3 read */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
110 static int mp3_read_header(AVFormatContext *s,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
111 AVFormatParameters *ap)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
112 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
113 AVStream *st;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
114
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
115 st = av_new_stream(s, 0);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
116 if (!st)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
117 return AVERROR_NOMEM;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
118
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
119 st->codec.codec_type = CODEC_TYPE_AUDIO;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
120 st->codec.codec_id = CODEC_ID_MP2;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
121 /* the parameters will be extracted from the compressed bitstream */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
122 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
123 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
124
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
125 /* mpeg1/h263 input */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
126 static int video_read_header(AVFormatContext *s,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
127 AVFormatParameters *ap)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
128 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
129 AVStream *st;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
130
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
131 st = av_new_stream(s, 0);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
132 if (!st)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
133 return AVERROR_NOMEM;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
134
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
135 st->codec.codec_type = CODEC_TYPE_VIDEO;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
136 st->codec.codec_id = s->iformat->value;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
137 /* for mjpeg, specify frame rate */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
138 /* for mpeg4 specify it too (most mpeg4 streams dont have the fixed_vop_rate set ...)*/
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
139 if (st->codec.codec_id == CODEC_ID_MJPEG || st->codec.codec_id == CODEC_ID_MPEG4) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
140 if (ap) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
141 st->codec.frame_rate = ap->frame_rate;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
142 } else {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
143 st->codec.frame_rate = 25 * FRAME_RATE_BASE;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
144 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
145 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
146 return 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 #define SEQ_START_CODE 0x000001b3
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
150 #define GOP_START_CODE 0x000001b8
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
151 #define PICTURE_START_CODE 0x00000100
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
152
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
153 /* XXX: improve that by looking at several start codes */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
154 static int mpegvideo_probe(AVProbeData *p)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
155 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
156 int code, c, i;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
157 code = 0xff;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
158
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
159 /* we search the first start code. If it is a sequence, gop or
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
160 picture start code then we decide it is an mpeg video
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
161 stream. We do not send highest value to give a chance to mpegts */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
162 for(i=0;i<p->buf_size;i++) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
163 c = p->buf[i];
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
164 code = (code << 8) | c;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
165 if ((code & 0xffffff00) == 0x100) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
166 if (code == SEQ_START_CODE ||
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
167 code == GOP_START_CODE ||
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
168 code == PICTURE_START_CODE)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
169 return 50 - 1;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
170 else
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
171 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
172 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
173 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
174 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
175 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
176
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
177 AVInputFormat mp3_iformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
178 "mp3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
179 "MPEG audio",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
180 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
181 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
182 mp3_read_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
183 raw_read_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
184 raw_read_close,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
185 .extensions = "mp2,mp3", /* XXX: use probe */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
186 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
187
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
188 AVOutputFormat mp2_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
189 "mp2",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
190 "MPEG audio layer 2",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
191 "audio/x-mpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
192 "mp2,mp3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
193 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
194 CODEC_ID_MP2,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
195 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
196 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
197 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
198 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
199 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
200
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
201
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
202 AVInputFormat ac3_iformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
203 "ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
204 "raw ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
205 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
206 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
207 raw_read_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
208 raw_read_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
209 raw_read_close,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
210 .extensions = "ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
211 .value = CODEC_ID_AC3,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
212 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
213
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
214 AVOutputFormat ac3_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
215 "ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
216 "raw ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
217 "audio/x-ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
218 "ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
219 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
220 CODEC_ID_AC3,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
221 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
222 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
223 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
224 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
225 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
226
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
227 AVOutputFormat h263_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
228 "h263",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
229 "raw h263",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
230 "video/x-h263",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
231 "h263",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
232 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
233 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
234 CODEC_ID_H263,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
235 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
236 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
237 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
238 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
239
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
240 AVInputFormat m4v_iformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
241 "m4v",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
242 "raw MPEG4 video format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
243 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
244 NULL /*mpegvideo_probe*/,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
245 video_read_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
246 raw_read_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
247 raw_read_close,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
248 .extensions = "m4v", //FIXME remove after writing mpeg4_probe
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
249 .value = CODEC_ID_MPEG4,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
250 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
251
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
252 AVOutputFormat m4v_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
253 "m4v",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
254 "raw MPEG4 video format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
255 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
256 "m4v",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
257 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
258 CODEC_ID_NONE,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
259 CODEC_ID_MPEG4,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
260 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
261 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
262 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
263 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
264
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
265 AVInputFormat mpegvideo_iformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
266 "mpegvideo",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
267 "MPEG video",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
268 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
269 mpegvideo_probe,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
270 video_read_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
271 raw_read_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
272 raw_read_close,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
273 .value = CODEC_ID_MPEG1VIDEO,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
274 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
275
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
276 AVOutputFormat mpeg1video_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
277 "mpeg1video",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
278 "MPEG video",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
279 "video/x-mpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
280 "mpg,mpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
281 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
282 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
283 CODEC_ID_MPEG1VIDEO,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
284 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
285 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
286 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
287 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
288
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
289 AVInputFormat mjpeg_iformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
290 "mjpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
291 "MJPEG video",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
292 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
293 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
294 video_read_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
295 raw_read_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
296 raw_read_close,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
297 .extensions = "mjpg,mjpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
298 .value = CODEC_ID_MJPEG,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
299 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
300
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
301 AVOutputFormat mjpeg_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
302 "mjpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
303 "MJPEG video",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
304 "video/x-mjpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
305 "mjpg,mjpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
306 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
307 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
308 CODEC_ID_MJPEG,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
309 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
310 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
311 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
312 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
313
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
314 /* pcm formats */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
315
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
316 #define PCMDEF(name, long_name, ext, codec) \
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
317 AVInputFormat pcm_ ## name ## _iformat = {\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
318 #name,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
319 long_name,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
320 0,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
321 NULL,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
322 raw_read_header,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
323 raw_read_packet,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
324 raw_read_close,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
325 .extensions = ext,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
326 .value = codec,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
327 };\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
328 \
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
329 AVOutputFormat pcm_ ## name ## _oformat = {\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
330 #name,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
331 long_name,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
332 NULL,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
333 ext,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
334 0,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
335 codec,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
336 0,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
337 raw_write_header,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
338 raw_write_packet,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
339 raw_write_trailer,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
340 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
341
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
342 #ifdef WORDS_BIGENDIAN
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
343 #define BE_DEF(s) s
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
344 #define LE_DEF(s) NULL
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
345 #else
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
346 #define BE_DEF(s) NULL
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
347 #define LE_DEF(s) s
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
348 #endif
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
349
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
350
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
351 PCMDEF(s16le, "pcm signed 16 bit little endian format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
352 LE_DEF("sw"), CODEC_ID_PCM_S16LE)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
353
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
354 PCMDEF(s16be, "pcm signed 16 bit big endian format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
355 BE_DEF("sw"), CODEC_ID_PCM_S16BE)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
356
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
357 PCMDEF(u16le, "pcm unsigned 16 bit little endian format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
358 LE_DEF("uw"), CODEC_ID_PCM_U16LE)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
359
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
360 PCMDEF(u16be, "pcm unsigned 16 bit big endian format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
361 BE_DEF("uw"), CODEC_ID_PCM_U16BE)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
362
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
363 PCMDEF(s8, "pcm signed 8 bit format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
364 "sb", CODEC_ID_PCM_S8)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
365
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
366 PCMDEF(u8, "pcm unsigned 8 bit format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
367 "ub", CODEC_ID_PCM_U8)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
368
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
369 PCMDEF(mulaw, "pcm mu law format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
370 "ul", CODEC_ID_PCM_MULAW)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
371
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
372 PCMDEF(alaw, "pcm A law format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
373 "al", CODEC_ID_PCM_ALAW)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
374
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
375 int rawvideo_read_packet(AVFormatContext *s,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
376 AVPacket *pkt)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
377 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
378 int packet_size, ret, width, height;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
379 AVStream *st = s->streams[0];
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
380
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
381 width = st->codec.width;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
382 height = st->codec.height;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
383
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
384 switch(st->codec.pix_fmt) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
385 case PIX_FMT_YUV420P:
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
386 packet_size = (width * height * 3) / 2;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
387 break;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
388 case PIX_FMT_YUV422:
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
389 packet_size = (width * height * 2);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
390 break;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
391 case PIX_FMT_BGR24:
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
392 case PIX_FMT_RGB24:
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
393 packet_size = (width * height * 3);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
394 break;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
395 default:
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
396 av_abort();
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
397 break;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
398 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
399
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
400 if (av_new_packet(pkt, packet_size) < 0)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
401 return -EIO;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
402
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
403 pkt->stream_index = 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
404 #if 0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
405 /* bypass buffered I/O */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
406 ret = url_read(url_fileno(&s->pb), pkt->data, pkt->size);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
407 #else
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
408 ret = get_buffer(&s->pb, pkt->data, pkt->size);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
409 #endif
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
410 if (ret != pkt->size) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
411 av_free_packet(pkt);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
412 return -EIO;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
413 } else {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
414 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
415 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
416 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
417
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
418 AVInputFormat rawvideo_iformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
419 "rawvideo",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
420 "raw video format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
421 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
422 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
423 raw_read_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
424 rawvideo_read_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
425 raw_read_close,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
426 .extensions = "yuv",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
427 .value = CODEC_ID_RAWVIDEO,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
428 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
429
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
430 AVOutputFormat rawvideo_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
431 "rawvideo",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
432 "raw video format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
433 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
434 "yuv",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
435 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
436 CODEC_ID_NONE,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
437 CODEC_ID_RAWVIDEO,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
438 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
439 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
440 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
441 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
442
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
443 static int null_write_packet(struct AVFormatContext *s,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
444 int stream_index,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
445 unsigned char *buf, int size, int force_pts)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
446 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
447 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
448 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
449
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
450 AVOutputFormat null_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
451 "null",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
452 "null video format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
453 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
454 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
455 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
456 #ifdef WORDS_BIGENDIAN
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
457 CODEC_ID_PCM_S16BE,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
458 #else
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
459 CODEC_ID_PCM_S16LE,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
460 #endif
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
461 CODEC_ID_RAWVIDEO,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
462 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
463 null_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
464 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
465 .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
466 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
467
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
468 int raw_init(void)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
469 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
470 av_register_input_format(&mp3_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
471 av_register_output_format(&mp2_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
472
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
473 av_register_input_format(&ac3_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
474 av_register_output_format(&ac3_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
475
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
476 av_register_output_format(&h263_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
477
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
478 av_register_input_format(&m4v_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
479 av_register_output_format(&m4v_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
480
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
481 av_register_input_format(&mpegvideo_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
482 av_register_output_format(&mpeg1video_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
483
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
484 av_register_input_format(&mjpeg_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
485 av_register_output_format(&mjpeg_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
486
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
487 av_register_input_format(&pcm_s16le_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
488 av_register_output_format(&pcm_s16le_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
489 av_register_input_format(&pcm_s16be_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
490 av_register_output_format(&pcm_s16be_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
491 av_register_input_format(&pcm_u16le_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
492 av_register_output_format(&pcm_u16le_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
493 av_register_input_format(&pcm_u16be_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
494 av_register_output_format(&pcm_u16be_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
495 av_register_input_format(&pcm_s8_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
496 av_register_output_format(&pcm_s8_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
497 av_register_input_format(&pcm_u8_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
498 av_register_output_format(&pcm_u8_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
499 av_register_input_format(&pcm_mulaw_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
500 av_register_output_format(&pcm_mulaw_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
501 av_register_input_format(&pcm_alaw_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
502 av_register_output_format(&pcm_alaw_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
503
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
504 av_register_input_format(&rawvideo_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
505 av_register_output_format(&rawvideo_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
506
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
507 av_register_output_format(&null_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
508 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
509 }