Mercurial > libavcodec.hg
comparison dsicinav.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 | 8a4984c5cacc |
comparison
equal
deleted
inserted
replaced
9354:174309386512 | 9355:54bc8a2727b0 |
---|---|
193 } | 193 } |
194 } | 194 } |
195 | 195 |
196 static int cinvideo_decode_frame(AVCodecContext *avctx, | 196 static int cinvideo_decode_frame(AVCodecContext *avctx, |
197 void *data, int *data_size, | 197 void *data, int *data_size, |
198 const uint8_t *buf, int buf_size) | 198 AVPacket *avpkt) |
199 { | 199 { |
200 const uint8_t *buf = avpkt->data; | |
201 int buf_size = avpkt->size; | |
200 CinVideoContext *cin = avctx->priv_data; | 202 CinVideoContext *cin = avctx->priv_data; |
201 int i, y, palette_type, palette_colors_count, bitmap_frame_type, bitmap_frame_size; | 203 int i, y, palette_type, palette_colors_count, bitmap_frame_type, bitmap_frame_size; |
202 | 204 |
203 cin->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; | 205 cin->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; |
204 if (avctx->reget_buffer(avctx, &cin->frame)) { | 206 if (avctx->reget_buffer(avctx, &cin->frame)) { |
310 return 0; | 312 return 0; |
311 } | 313 } |
312 | 314 |
313 static int cinaudio_decode_frame(AVCodecContext *avctx, | 315 static int cinaudio_decode_frame(AVCodecContext *avctx, |
314 void *data, int *data_size, | 316 void *data, int *data_size, |
315 const uint8_t *buf, int buf_size) | 317 AVPacket *avpkt) |
316 { | 318 { |
319 const uint8_t *buf = avpkt->data; | |
320 int buf_size = avpkt->size; | |
317 CinAudioContext *cin = avctx->priv_data; | 321 CinAudioContext *cin = avctx->priv_data; |
318 const uint8_t *src = buf; | 322 const uint8_t *src = buf; |
319 int16_t *samples = (int16_t *)data; | 323 int16_t *samples = (int16_t *)data; |
320 | 324 |
321 buf_size = FFMIN(buf_size, *data_size/2); | 325 buf_size = FFMIN(buf_size, *data_size/2); |