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

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavcodec/vmnc.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:
28
28
#include <stdio.h>
29
29
#include <stdlib.h>
30
30
 
 
31
#include "libavutil/common.h"
31
32
#include "libavutil/intreadwrite.h"
32
33
#include "avcodec.h"
33
34
 
284
285
    return src - ssrc;
285
286
}
286
287
 
287
 
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
 
288
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
 
289
                        AVPacket *avpkt)
288
290
{
289
291
    const uint8_t *buf = avpkt->data;
290
292
    int buf_size = avpkt->size;
445
447
            put_cursor(outptr, c->pic.linesize[0], c, c->cur_x, c->cur_y);
446
448
        }
447
449
    }
448
 
    *data_size = sizeof(AVFrame);
 
450
    *got_frame      = 1;
449
451
    *(AVFrame*)data = c->pic;
450
452
 
451
453
    /* always report that the buffer was completely consumed */
473
475
 
474
476
    switch(c->bpp){
475
477
    case 8:
476
 
        avctx->pix_fmt = PIX_FMT_PAL8;
 
478
        avctx->pix_fmt = AV_PIX_FMT_PAL8;
477
479
        break;
478
480
    case 16:
479
 
        avctx->pix_fmt = PIX_FMT_RGB555;
 
481
        avctx->pix_fmt = AV_PIX_FMT_RGB555;
480
482
        break;
481
483
    case 32:
482
 
        avctx->pix_fmt = PIX_FMT_RGB32;
 
484
        avctx->pix_fmt = AV_PIX_FMT_RGB32;
483
485
        break;
484
486
    default:
485
487
        av_log(avctx, AV_LOG_ERROR, "Unsupported bitdepth %i\n", c->bpp);
512
514
AVCodec ff_vmnc_decoder = {
513
515
    .name           = "vmnc",
514
516
    .type           = AVMEDIA_TYPE_VIDEO,
515
 
    .id             = CODEC_ID_VMNC,
 
517
    .id             = AV_CODEC_ID_VMNC,
516
518
    .priv_data_size = sizeof(VmncContext),
517
519
    .init           = decode_init,
518
520
    .close          = decode_end,
519
521
    .decode         = decode_frame,
520
522
    .capabilities   = CODEC_CAP_DR1,
521
 
    .long_name = NULL_IF_CONFIG_SMALL("VMware Screen Codec / VMware Video"),
 
523
    .long_name      = NULL_IF_CONFIG_SMALL("VMware Screen Codec / VMware Video"),
522
524
};
523