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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-09-24 17:07:00 UTC
  • mfrom: (1.1.17) (7.1.9 experimental)
  • Revision ID: package-import@ubuntu.com-20130924170700-4dg62s3pwl0pdakz
Tags: 1.2.0-1
* New upstream stable release:
  + debian/control:
    - Build depend on GStreamer and gst-plugins-base >= 1.2.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
244
244
    return 0;
245
245
}
246
246
 
247
 
static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPacket *avpkt)
 
247
static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame,
 
248
                        AVPacket *avpkt)
248
249
{
249
250
    KmvcContext *const ctx = avctx->priv_data;
250
251
    uint8_t *out, *src;
259
260
 
260
261
    ctx->pic.reference = 1;
261
262
    ctx->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
262
 
    if (avctx->get_buffer(avctx, &ctx->pic) < 0) {
 
263
    if (ff_get_buffer(avctx, &ctx->pic) < 0) {
263
264
        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
264
265
        return -1;
265
266
    }
345
346
        ctx->prev = ctx->frm1;
346
347
    }
347
348
 
348
 
    *data_size = sizeof(AVFrame);
 
349
    *got_frame = 1;
349
350
    *(AVFrame *) data = ctx->pic;
350
351
 
351
352
    /* always report that the buffer was completely consumed */
377
378
    }
378
379
 
379
380
    if (avctx->extradata_size < 12) {
380
 
        av_log(NULL, 0, "Extradata missing, decoding may not work properly...\n");
 
381
        av_log(avctx, AV_LOG_WARNING,
 
382
               "Extradata missing, decoding may not work properly...\n");
381
383
        c->palsize = 127;
382
384
    } else {
383
385
        c->palsize = AV_RL16(avctx->extradata + 10);
396
398
        c->setpal = 1;
397
399
    }
398
400
 
399
 
    avctx->pix_fmt = PIX_FMT_PAL8;
 
401
    avctx->pix_fmt = AV_PIX_FMT_PAL8;
400
402
 
401
403
    return 0;
402
404
}
404
406
AVCodec ff_kmvc_decoder = {
405
407
    .name           = "kmvc",
406
408
    .type           = AVMEDIA_TYPE_VIDEO,
407
 
    .id             = CODEC_ID_KMVC,
 
409
    .id             = AV_CODEC_ID_KMVC,
408
410
    .priv_data_size = sizeof(KmvcContext),
409
411
    .init           = decode_init,
410
412
    .decode         = decode_frame,
411
413
    .capabilities   = CODEC_CAP_DR1,
412
 
    .long_name = NULL_IF_CONFIG_SMALL("Karl Morton's video codec"),
 
414
    .long_name      = NULL_IF_CONFIG_SMALL("Karl Morton's video codec"),
413
415
};