comparison raw.c @ 63:8329ba7cbd01 libavformat

raw ac3 auto detects parameters
author bellard
date Sun, 09 Feb 2003 18:07:16 +0000
parents 3e7e13e08b27
children b0e0eb595e29
comparison
equal deleted inserted replaced
62:56a6676125b4 63:8329ba7cbd01
120 st->codec.codec_id = CODEC_ID_MP2; 120 st->codec.codec_id = CODEC_ID_MP2;
121 /* the parameters will be extracted from the compressed bitstream */ 121 /* the parameters will be extracted from the compressed bitstream */
122 return 0; 122 return 0;
123 } 123 }
124 124
125 /* ac3 read */
126 static int ac3_read_header(AVFormatContext *s,
127 AVFormatParameters *ap)
128 {
129 AVStream *st;
130
131 st = av_new_stream(s, 0);
132 if (!st)
133 return AVERROR_NOMEM;
134
135 st->codec.codec_type = CODEC_TYPE_AUDIO;
136 st->codec.codec_id = CODEC_ID_AC3;
137 /* the parameters will be extracted from the compressed bitstream */
138 return 0;
139 }
140
125 /* mpeg1/h263 input */ 141 /* mpeg1/h263 input */
126 static int video_read_header(AVFormatContext *s, 142 static int video_read_header(AVFormatContext *s,
127 AVFormatParameters *ap) 143 AVFormatParameters *ap)
128 { 144 {
129 AVStream *st; 145 AVStream *st;
205 AVInputFormat ac3_iformat = { 221 AVInputFormat ac3_iformat = {
206 "ac3", 222 "ac3",
207 "raw ac3", 223 "raw ac3",
208 0, 224 0,
209 NULL, 225 NULL,
210 raw_read_header, 226 ac3_read_header,
211 raw_read_packet, 227 raw_read_packet,
212 raw_read_close, 228 raw_read_close,
213 .extensions = "ac3", 229 .extensions = "ac3",
214 .value = CODEC_ID_AC3,
215 }; 230 };
216 231
217 AVOutputFormat ac3_oformat = { 232 AVOutputFormat ac3_oformat = {
218 "ac3", 233 "ac3",
219 "raw ac3", 234 "raw ac3",