comparison mpegaudiodec.c @ 9355:54bc8a2727b0 libavcodec

Implement avcodec_decode_video2(), _audio3() and _subtitle2() which takes an AVPacket argument rather than a const uint8_t *buf + int buf_size. This allows passing of packet-specific flags from demuxer to decoder, such as the keyframe flag, which appears necessary to playback corePNG P-frames. Patch by Thilo Borgmann thilo.borgmann googlemail com, see also the thread "Google Summer of Code participation" on the mailinglist.
author rbultje
date Tue, 07 Apr 2009 15:59:50 +0000
parents 043574c5c153
children 0dce4fe6e6f3
comparison
equal deleted inserted replaced
9354:174309386512 9355:54bc8a2727b0
2256 return nb_frames * 32 * sizeof(OUT_INT) * s->nb_channels; 2256 return nb_frames * 32 * sizeof(OUT_INT) * s->nb_channels;
2257 } 2257 }
2258 2258
2259 static int decode_frame(AVCodecContext * avctx, 2259 static int decode_frame(AVCodecContext * avctx,
2260 void *data, int *data_size, 2260 void *data, int *data_size,
2261 const uint8_t * buf, int buf_size) 2261 AVPacket *avpkt)
2262 { 2262 {
2263 const uint8_t *buf = avpkt->data;
2264 int buf_size = avpkt->size;
2263 MPADecodeContext *s = avctx->priv_data; 2265 MPADecodeContext *s = avctx->priv_data;
2264 uint32_t header; 2266 uint32_t header;
2265 int out_size; 2267 int out_size;
2266 OUT_INT *out_samples = data; 2268 OUT_INT *out_samples = data;
2267 2269
2313 } 2315 }
2314 2316
2315 #if CONFIG_MP3ADU_DECODER 2317 #if CONFIG_MP3ADU_DECODER
2316 static int decode_frame_adu(AVCodecContext * avctx, 2318 static int decode_frame_adu(AVCodecContext * avctx,
2317 void *data, int *data_size, 2319 void *data, int *data_size,
2318 const uint8_t * buf, int buf_size) 2320 AVPacket *avpkt)
2319 { 2321 {
2322 const uint8_t *buf = avpkt->data;
2323 int buf_size = avpkt->size;
2320 MPADecodeContext *s = avctx->priv_data; 2324 MPADecodeContext *s = avctx->priv_data;
2321 uint32_t header; 2325 uint32_t header;
2322 int len, out_size; 2326 int len, out_size;
2323 OUT_INT *out_samples = data; 2327 OUT_INT *out_samples = data;
2324 2328
2457 } 2461 }
2458 2462
2459 2463
2460 static int decode_frame_mp3on4(AVCodecContext * avctx, 2464 static int decode_frame_mp3on4(AVCodecContext * avctx,
2461 void *data, int *data_size, 2465 void *data, int *data_size,
2462 const uint8_t * buf, int buf_size) 2466 AVPacket *avpkt)
2463 { 2467 {
2468 const uint8_t *buf = avpkt->data;
2469 int buf_size = avpkt->size;
2464 MP3On4DecodeContext *s = avctx->priv_data; 2470 MP3On4DecodeContext *s = avctx->priv_data;
2465 MPADecodeContext *m; 2471 MPADecodeContext *m;
2466 int fsize, len = buf_size, out_size = 0; 2472 int fsize, len = buf_size, out_size = 0;
2467 uint32_t header; 2473 uint32_t header;
2468 OUT_INT *out_samples = data; 2474 OUT_INT *out_samples = data;