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

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavcodec/idcinvideo.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:
49
49
#include <string.h>
50
50
 
51
51
#include "avcodec.h"
 
52
#include "internal.h"
 
53
#include "libavutil/internal.h"
52
54
 
53
55
#define HUFFMAN_TABLE_SIZE 64 * 1024
54
56
#define HUF_TOKENS 256
150
152
    unsigned char *histograms;
151
153
 
152
154
    s->avctx = avctx;
153
 
    avctx->pix_fmt = PIX_FMT_PAL8;
 
155
    avctx->pix_fmt = AV_PIX_FMT_PAL8;
154
156
 
155
157
    /* make sure the Huffman tables make it */
156
158
    if (s->avctx->extradata_size != HUFFMAN_TABLE_SIZE) {
208
210
}
209
211
 
210
212
static int idcin_decode_frame(AVCodecContext *avctx,
211
 
                              void *data, int *data_size,
 
213
                              void *data, int *got_frame,
212
214
                              AVPacket *avpkt)
213
215
{
214
216
    const uint8_t *buf = avpkt->data;
222
224
    if (s->frame.data[0])
223
225
        avctx->release_buffer(avctx, &s->frame);
224
226
 
225
 
    if (avctx->get_buffer(avctx, &s->frame)) {
 
227
    if (ff_get_buffer(avctx, &s->frame)) {
226
228
        av_log(avctx, AV_LOG_ERROR, "  id CIN Video: get_buffer() failed\n");
227
229
        return -1;
228
230
    }
236
238
    /* make the palette available on the way out */
237
239
    memcpy(s->frame.data[1], s->pal, AVPALETTE_SIZE);
238
240
 
239
 
    *data_size = sizeof(AVFrame);
 
241
    *got_frame = 1;
240
242
    *(AVFrame*)data = s->frame;
241
243
 
242
244
    /* report that the buffer was completely consumed */
256
258
AVCodec ff_idcin_decoder = {
257
259
    .name           = "idcinvideo",
258
260
    .type           = AVMEDIA_TYPE_VIDEO,
259
 
    .id             = CODEC_ID_IDCIN,
 
261
    .id             = AV_CODEC_ID_IDCIN,
260
262
    .priv_data_size = sizeof(IdcinContext),
261
263
    .init           = idcin_decode_init,
262
264
    .close          = idcin_decode_end,
263
265
    .decode         = idcin_decode_frame,
264
266
    .capabilities   = CODEC_CAP_DR1,
265
 
    .long_name = NULL_IF_CONFIG_SMALL("id Quake II CIN video"),
 
267
    .long_name      = NULL_IF_CONFIG_SMALL("id Quake II CIN video"),
266
268
};
267