Mercurial > libavcodec.hg
comparison libgsm.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 | 7955db355703 |
comparison
equal
deleted
inserted
replaced
9354:174309386512 | 9355:54bc8a2727b0 |
---|---|
136 .long_name = NULL_IF_CONFIG_SMALL("libgsm GSM Microsoft variant"), | 136 .long_name = NULL_IF_CONFIG_SMALL("libgsm GSM Microsoft variant"), |
137 }; | 137 }; |
138 | 138 |
139 static int libgsm_decode_frame(AVCodecContext *avctx, | 139 static int libgsm_decode_frame(AVCodecContext *avctx, |
140 void *data, int *data_size, | 140 void *data, int *data_size, |
141 uint8_t *buf, int buf_size) { | 141 AVPacket *avpkt) { |
142 const uint8_t *buf = avpkt->data; | |
143 int buf_size = avpkt->size; | |
142 *data_size = 0; /* In case of error */ | 144 *data_size = 0; /* In case of error */ |
143 if(buf_size < avctx->block_align) return -1; | 145 if(buf_size < avctx->block_align) return -1; |
144 switch(avctx->codec_id) { | 146 switch(avctx->codec_id) { |
145 case CODEC_ID_GSM: | 147 case CODEC_ID_GSM: |
146 if(gsm_decode(avctx->priv_data,buf,data)) return -1; | 148 if(gsm_decode(avctx->priv_data,buf,data)) return -1; |