~ubuntu-branches/ubuntu/trusty/libav/trusty-proposed

« back to all changes in this revision

Viewing changes to libavcodec/vb.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2013-10-22 23:24:08 UTC
  • mfrom: (1.3.36 sid)
  • Revision ID: package-import@ubuntu.com-20131022232408-b8tvvn4pyzri9mi3
Tags: 6:9.10-1ubuntu1
* Build all -extra flavors from this source package, as libav got demoted
  from main to universe, cf LP: #1243235
* Simplify debian/rules to follow exactly the code that debian executes
* New upstream (LP: #1180288) fixes lots of security issues (LP: #1242802)
* Merge from unstable, remaining changes:
  - build-depend on libtiff5-dev rather than libtiff4-dev,
    avoids FTBFS caused by imlib
  - follow the regular debian codepaths

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