Mercurial > libavcodec.hg
comparison vmdav.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 | e9d9d946f213 |
children | 4cab394c16ea |
comparison
equal
deleted
inserted
replaced
9354:174309386512 | 9355:54bc8a2727b0 |
---|---|
364 return 0; | 364 return 0; |
365 } | 365 } |
366 | 366 |
367 static int vmdvideo_decode_frame(AVCodecContext *avctx, | 367 static int vmdvideo_decode_frame(AVCodecContext *avctx, |
368 void *data, int *data_size, | 368 void *data, int *data_size, |
369 const uint8_t *buf, int buf_size) | 369 AVPacket *avpkt) |
370 { | 370 { |
371 const uint8_t *buf = avpkt->data; | |
372 int buf_size = avpkt->size; | |
371 VmdVideoContext *s = avctx->priv_data; | 373 VmdVideoContext *s = avctx->priv_data; |
372 | 374 |
373 s->buf = buf; | 375 s->buf = buf; |
374 s->size = buf_size; | 376 s->size = buf_size; |
375 | 377 |
519 return data_size * 2; | 521 return data_size * 2; |
520 } | 522 } |
521 | 523 |
522 static int vmdaudio_decode_frame(AVCodecContext *avctx, | 524 static int vmdaudio_decode_frame(AVCodecContext *avctx, |
523 void *data, int *data_size, | 525 void *data, int *data_size, |
524 const uint8_t *buf, int buf_size) | 526 AVPacket *avpkt) |
525 { | 527 { |
528 const uint8_t *buf = avpkt->data; | |
529 int buf_size = avpkt->size; | |
526 VmdAudioContext *s = avctx->priv_data; | 530 VmdAudioContext *s = avctx->priv_data; |
527 unsigned char *output_samples = (unsigned char *)data; | 531 unsigned char *output_samples = (unsigned char *)data; |
528 | 532 |
529 /* point to the start of the encoded data */ | 533 /* point to the start of the encoded data */ |
530 const unsigned char *p = buf + 16; | 534 const unsigned char *p = buf + 16; |