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

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavcodec/v210x.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:
19
19
 */
20
20
 
21
21
#include "avcodec.h"
 
22
#include "internal.h"
22
23
#include "libavutil/bswap.h"
 
24
#include "libavutil/internal.h"
 
25
#include "libavutil/mem.h"
23
26
 
24
27
static av_cold int decode_init(AVCodecContext *avctx)
25
28
{
27
30
        av_log(avctx, AV_LOG_ERROR, "v210x needs even width\n");
28
31
        return -1;
29
32
    }
30
 
    avctx->pix_fmt = PIX_FMT_YUV422P16;
 
33
    avctx->pix_fmt = AV_PIX_FMT_YUV422P16;
31
34
    avctx->bits_per_raw_sample= 10;
32
35
 
33
36
    avctx->coded_frame= avcodec_alloc_frame();
35
38
    return 0;
36
39
}
37
40
 
38
 
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
 
41
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
 
42
                        AVPacket *avpkt)
39
43
{
40
44
    int y=0;
41
45
    int width= avctx->width;
56
60
    }
57
61
 
58
62
    pic->reference= 0;
59
 
    if(avctx->get_buffer(avctx, pic) < 0)
 
63
    if(ff_get_buffer(avctx, pic) < 0)
60
64
        return -1;
61
65
 
62
66
    ydst= (uint16_t *)pic->data[0];
116
120
        }
117
121
    }
118
122
 
119
 
    *data_size=sizeof(AVFrame);
 
123
    *got_frame = 1;
120
124
    *(AVFrame*)data= *avctx->coded_frame;
121
125
 
122
126
    return avpkt->size;
135
139
AVCodec ff_v210x_decoder = {
136
140
    .name           = "v210x",
137
141
    .type           = AVMEDIA_TYPE_VIDEO,
138
 
    .id             = CODEC_ID_V210X,
 
142
    .id             = AV_CODEC_ID_V210X,
139
143
    .init           = decode_init,
140
144
    .close          = decode_close,
141
145
    .decode         = decode_frame,
142
146
    .capabilities   = CODEC_CAP_DR1,
143
 
    .long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"),
 
147
    .long_name      = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"),
144
148
};