~ubuntu-branches/ubuntu/saucy/gst-libav1.0/saucy-proposed

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavcodec/vb.c

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-07-30 09:00:15 UTC
  • mfrom: (1.1.16) (7.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20130730090015-sc1ou2yssu7q5w4e
Tags: 1.1.3-1
* New upstream development snapshot:
  + debian/control:
    - Build depend on GStreamer and gst-plugins-base >= 1.1.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
#include "avcodec.h"
31
31
#include "bytestream.h"
 
32
#include "internal.h"
32
33
 
33
34
enum VBFlags{
34
35
    VB_HAS_GMC     = 0x01,
184
185
    return 0;
185
186
}
186
187
 
187
 
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
 
188
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
 
189
                        AVPacket *avpkt)
188
190
{
189
191
    VBDecContext * const c = avctx->priv_data;
190
192
    uint8_t *outptr, *srcptr;
198
200
    if(c->pic.data[0])
199
201
        avctx->release_buffer(avctx, &c->pic);
200
202
    c->pic.reference = 1;
201
 
    if(avctx->get_buffer(avctx, &c->pic) < 0){
 
203
    if(ff_get_buffer(avctx, &c->pic) < 0){
202
204
        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
203
205
        return -1;
204
206
    }
234
236
 
235
237
    FFSWAP(uint8_t*, c->frame, c->prev_frame);
236
238
 
237
 
    *data_size = sizeof(AVFrame);
 
239
    *got_frame = 1;
238
240
    *(AVFrame*)data = c->pic;
239
241
 
240
242
    /* always report that the buffer was completely consumed */
246
248
    VBDecContext * const c = avctx->priv_data;
247
249
 
248
250
    c->avctx = avctx;
249
 
    avctx->pix_fmt = PIX_FMT_PAL8;
 
251
    avctx->pix_fmt = AV_PIX_FMT_PAL8;
250
252
 
251
253
    c->frame      = av_mallocz(avctx->width * avctx->height);
252
254
    c->prev_frame = av_mallocz(avctx->width * avctx->height);
269
271
AVCodec ff_vb_decoder = {
270
272
    .name           = "vb",
271
273
    .type           = AVMEDIA_TYPE_VIDEO,
272
 
    .id             = CODEC_ID_VB,
 
274
    .id             = AV_CODEC_ID_VB,
273
275
    .priv_data_size = sizeof(VBDecContext),
274
276
    .init           = decode_init,
275
277
    .close          = decode_end,
276
278
    .decode         = decode_frame,
277
 
    .long_name = NULL_IF_CONFIG_SMALL("Beam Software VB"),
 
279
    .long_name      = NULL_IF_CONFIG_SMALL("Beam Software VB"),
 
280
    .capabilities   = CODEC_CAP_DR1,
278
281
};
279