comparison eacmv.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 bf274494b66e
children dff431441c9c
comparison
equal deleted inserted replaced
9354:174309386512 9355:54bc8a2727b0
142 #define EA_PREAMBLE_SIZE 8 142 #define EA_PREAMBLE_SIZE 8
143 #define MVIh_TAG MKTAG('M', 'V', 'I', 'h') 143 #define MVIh_TAG MKTAG('M', 'V', 'I', 'h')
144 144
145 static int cmv_decode_frame(AVCodecContext *avctx, 145 static int cmv_decode_frame(AVCodecContext *avctx,
146 void *data, int *data_size, 146 void *data, int *data_size,
147 const uint8_t *buf, int buf_size) 147 AVPacket *avpkt)
148 { 148 {
149 const uint8_t *buf = avpkt->data;
150 int buf_size = avpkt->size;
149 CmvContext *s = avctx->priv_data; 151 CmvContext *s = avctx->priv_data;
150 const uint8_t *buf_end = buf + buf_size; 152 const uint8_t *buf_end = buf + buf_size;
151 153
152 if (AV_RL32(buf)==MVIh_TAG||AV_RB32(buf)==MVIh_TAG) { 154 if (AV_RL32(buf)==MVIh_TAG||AV_RB32(buf)==MVIh_TAG) {
153 cmv_process_header(s, buf+EA_PREAMBLE_SIZE, buf_end); 155 cmv_process_header(s, buf+EA_PREAMBLE_SIZE, buf_end);