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

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavcodec/sgidec.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:
22
22
#include "libavutil/imgutils.h"
23
23
#include "avcodec.h"
24
24
#include "bytestream.h"
 
25
#include "internal.h"
25
26
#include "sgi.h"
26
27
 
27
28
typedef struct SgiState {
150
151
}
151
152
 
152
153
static int decode_frame(AVCodecContext *avctx,
153
 
                        void *data, int *data_size,
 
154
                        void *data, int *got_frame,
154
155
                        AVPacket *avpkt)
155
156
{
156
157
    SgiState *s = avctx->priv_data;
191
192
    }
192
193
 
193
194
    if (s->depth == SGI_GRAYSCALE) {
194
 
        avctx->pix_fmt = s->bytes_per_channel == 2 ? PIX_FMT_GRAY16BE : PIX_FMT_GRAY8;
 
195
        avctx->pix_fmt = s->bytes_per_channel == 2 ? AV_PIX_FMT_GRAY16BE : AV_PIX_FMT_GRAY8;
195
196
    } else if (s->depth == SGI_RGB) {
196
 
        avctx->pix_fmt = s->bytes_per_channel == 2 ? PIX_FMT_RGB48BE : PIX_FMT_RGB24;
 
197
        avctx->pix_fmt = s->bytes_per_channel == 2 ? AV_PIX_FMT_RGB48BE : AV_PIX_FMT_RGB24;
197
198
    } else if (s->depth == SGI_RGBA && s->bytes_per_channel == 1) {
198
 
        avctx->pix_fmt = PIX_FMT_RGBA;
 
199
        avctx->pix_fmt = AV_PIX_FMT_RGBA;
199
200
    } else {
200
201
        av_log(avctx, AV_LOG_ERROR, "wrong picture format\n");
201
202
        return -1;
209
210
        avctx->release_buffer(avctx, p);
210
211
 
211
212
    p->reference = 0;
212
 
    if (avctx->get_buffer(avctx, p) < 0) {
 
213
    if (ff_get_buffer(avctx, p) < 0) {
213
214
        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed.\n");
214
215
        return -1;
215
216
    }
232
233
 
233
234
    if (ret == 0) {
234
235
        *picture   = s->picture;
235
 
        *data_size = sizeof(AVPicture);
 
236
        *got_frame = 1;
236
237
        return avpkt->size;
237
238
    } else {
238
239
        return ret;
261
262
AVCodec ff_sgi_decoder = {
262
263
    .name           = "sgi",
263
264
    .type           = AVMEDIA_TYPE_VIDEO,
264
 
    .id             = CODEC_ID_SGI,
 
265
    .id             = AV_CODEC_ID_SGI,
265
266
    .priv_data_size = sizeof(SgiState),
266
267
    .init           = sgi_init,
267
268
    .close          = sgi_end,
268
269
    .decode         = decode_frame,
269
 
    .long_name = NULL_IF_CONFIG_SMALL("SGI image"),
 
270
    .long_name      = NULL_IF_CONFIG_SMALL("SGI image"),
 
271
    .capabilities   = CODEC_CAP_DR1,
270
272
};
271