comparison raw.c @ 2023:a3e79d6e4e3c libavformat

add an enum for need_parsing
author aurel
date Sun, 15 Apr 2007 13:51:57 +0000
parents 4f62a7d9381a
children f9861524ff86
comparison
equal deleted inserted replaced
2022:4f62a7d9381a 2023:a3e79d6e4e3c
216 if (!st) 216 if (!st)
217 return AVERROR_NOMEM; 217 return AVERROR_NOMEM;
218 218
219 st->codec->codec_type = CODEC_TYPE_AUDIO; 219 st->codec->codec_type = CODEC_TYPE_AUDIO;
220 st->codec->codec_id = CODEC_ID_AC3; 220 st->codec->codec_id = CODEC_ID_AC3;
221 st->need_parsing = 1; 221 st->need_parsing = AVSTREAM_PARSE_FULL;
222 /* the parameters will be extracted from the compressed bitstream */ 222 /* the parameters will be extracted from the compressed bitstream */
223 return 0; 223 return 0;
224 } 224 }
225 225
226 static int shorten_read_header(AVFormatContext *s, 226 static int shorten_read_header(AVFormatContext *s,
231 st = av_new_stream(s, 0); 231 st = av_new_stream(s, 0);
232 if (!st) 232 if (!st)
233 return AVERROR_NOMEM; 233 return AVERROR_NOMEM;
234 st->codec->codec_type = CODEC_TYPE_AUDIO; 234 st->codec->codec_type = CODEC_TYPE_AUDIO;
235 st->codec->codec_id = CODEC_ID_SHORTEN; 235 st->codec->codec_id = CODEC_ID_SHORTEN;
236 st->need_parsing = 1; 236 st->need_parsing = AVSTREAM_PARSE_FULL;
237 /* the parameters will be extracted from the compressed bitstream */ 237 /* the parameters will be extracted from the compressed bitstream */
238 return 0; 238 return 0;
239 } 239 }
240 240
241 /* flac read */ 241 /* flac read */
247 st = av_new_stream(s, 0); 247 st = av_new_stream(s, 0);
248 if (!st) 248 if (!st)
249 return AVERROR_NOMEM; 249 return AVERROR_NOMEM;
250 st->codec->codec_type = CODEC_TYPE_AUDIO; 250 st->codec->codec_type = CODEC_TYPE_AUDIO;
251 st->codec->codec_id = CODEC_ID_FLAC; 251 st->codec->codec_id = CODEC_ID_FLAC;
252 st->need_parsing = 1; 252 st->need_parsing = AVSTREAM_PARSE_FULL;
253 /* the parameters will be extracted from the compressed bitstream */ 253 /* the parameters will be extracted from the compressed bitstream */
254 return 0; 254 return 0;
255 } 255 }
256 256
257 /* dts read */ 257 /* dts read */
264 if (!st) 264 if (!st)
265 return AVERROR_NOMEM; 265 return AVERROR_NOMEM;
266 266
267 st->codec->codec_type = CODEC_TYPE_AUDIO; 267 st->codec->codec_type = CODEC_TYPE_AUDIO;
268 st->codec->codec_id = CODEC_ID_DTS; 268 st->codec->codec_id = CODEC_ID_DTS;
269 st->need_parsing = 1; 269 st->need_parsing = AVSTREAM_PARSE_FULL;
270 /* the parameters will be extracted from the compressed bitstream */ 270 /* the parameters will be extracted from the compressed bitstream */
271 return 0; 271 return 0;
272 } 272 }
273 273
274 /* aac read */ 274 /* aac read */
281 if (!st) 281 if (!st)
282 return AVERROR_NOMEM; 282 return AVERROR_NOMEM;
283 283
284 st->codec->codec_type = CODEC_TYPE_AUDIO; 284 st->codec->codec_type = CODEC_TYPE_AUDIO;
285 st->codec->codec_id = CODEC_ID_AAC; 285 st->codec->codec_id = CODEC_ID_AAC;
286 st->need_parsing = 1; 286 st->need_parsing = AVSTREAM_PARSE_FULL;
287 /* the parameters will be extracted from the compressed bitstream */ 287 /* the parameters will be extracted from the compressed bitstream */
288 return 0; 288 return 0;
289 } 289 }
290 290
291 /* mpeg1/h263 input */ 291 /* mpeg1/h263 input */
298 if (!st) 298 if (!st)
299 return AVERROR_NOMEM; 299 return AVERROR_NOMEM;
300 300
301 st->codec->codec_type = CODEC_TYPE_VIDEO; 301 st->codec->codec_type = CODEC_TYPE_VIDEO;
302 st->codec->codec_id = s->iformat->value; 302 st->codec->codec_id = s->iformat->value;
303 st->need_parsing = 1; 303 st->need_parsing = AVSTREAM_PARSE_FULL;
304 304
305 /* for mjpeg, specify frame rate */ 305 /* for mjpeg, specify frame rate */
306 /* for mpeg4 specify it too (most mpeg4 streams dont have the fixed_vop_rate set ...)*/ 306 /* for mpeg4 specify it too (most mpeg4 streams dont have the fixed_vop_rate set ...)*/
307 if (ap->time_base.num) { 307 if (ap->time_base.num) {
308 av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den); 308 av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den);