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

« back to all changes in this revision

Viewing changes to libavcodec/v210x.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:
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
};