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

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavcodec/dxa.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:
27
27
#include <stdio.h>
28
28
#include <stdlib.h>
29
29
 
 
30
#include "libavutil/common.h"
30
31
#include "libavutil/intreadwrite.h"
31
32
#include "avcodec.h"
 
33
#include "internal.h"
32
34
 
33
35
#include <zlib.h>
34
36
 
36
38
 * Decoder context
37
39
 */
38
40
typedef struct DxaDecContext {
39
 
    AVCodecContext *avctx;
40
41
    AVFrame pic, prev;
41
42
 
42
43
    int dsize;
188
189
    return 0;
189
190
}
190
191
 
191
 
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
 
192
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
192
193
{
193
194
    const uint8_t *buf = avpkt->data;
194
195
    int buf_size = avpkt->size;
215
216
        buf_size -= 768+4;
216
217
    }
217
218
 
218
 
    if(avctx->get_buffer(avctx, &c->pic) < 0){
 
219
    if(ff_get_buffer(avctx, &c->pic) < 0){
219
220
        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
220
221
        return -1;
221
222
    }
281
282
    if(c->pic.data[0])
282
283
        avctx->release_buffer(avctx, &c->pic);
283
284
 
284
 
    *data_size = sizeof(AVFrame);
 
285
    *got_frame = 1;
285
286
    *(AVFrame*)data = c->prev;
286
287
 
287
288
    /* always report that the buffer was completely consumed */
292
293
{
293
294
    DxaDecContext * const c = avctx->priv_data;
294
295
 
295
 
    c->avctx = avctx;
296
 
    avctx->pix_fmt = PIX_FMT_PAL8;
 
296
    avctx->pix_fmt = AV_PIX_FMT_PAL8;
297
297
 
298
298
    c->dsize = avctx->width * avctx->height * 2;
299
299
    if((c->decomp_buf = av_malloc(c->dsize)) == NULL) {
320
320
AVCodec ff_dxa_decoder = {
321
321
    .name           = "dxa",
322
322
    .type           = AVMEDIA_TYPE_VIDEO,
323
 
    .id             = CODEC_ID_DXA,
 
323
    .id             = AV_CODEC_ID_DXA,
324
324
    .priv_data_size = sizeof(DxaDecContext),
325
325
    .init           = decode_init,
326
326
    .close          = decode_end,
327
327
    .decode         = decode_frame,
328
328
    .capabilities   = CODEC_CAP_DR1,
329
 
    .long_name = NULL_IF_CONFIG_SMALL("Feeble Files/ScummVM DXA"),
 
329
    .long_name      = NULL_IF_CONFIG_SMALL("Feeble Files/ScummVM DXA"),
330
330
};
331