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

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavcodec/eacmv.c

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-09-24 17:07:00 UTC
  • mfrom: (1.1.17) (7.1.9 experimental)
  • Revision ID: package-import@ubuntu.com-20130924170700-4dg62s3pwl0pdakz
Tags: 1.2.0-1
* New upstream stable release:
  + debian/control:
    - Build depend on GStreamer and gst-plugins-base >= 1.2.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 * http://wiki.multimedia.cx/index.php?title=Electronic_Arts_CMV
29
29
 */
30
30
 
 
31
#include "libavutil/common.h"
31
32
#include "libavutil/intreadwrite.h"
32
33
#include "libavutil/imgutils.h"
33
34
#include "avcodec.h"
 
35
#include "internal.h"
34
36
 
35
37
typedef struct CmvContext {
36
38
    AVCodecContext *avctx;
44
46
static av_cold int cmv_decode_init(AVCodecContext *avctx){
45
47
    CmvContext *s = avctx->priv_data;
46
48
    s->avctx = avctx;
47
 
    avctx->pix_fmt = PIX_FMT_PAL8;
 
49
    avctx->pix_fmt = AV_PIX_FMT_PAL8;
48
50
    return 0;
49
51
}
50
52
 
145
147
#define MVIh_TAG MKTAG('M', 'V', 'I', 'h')
146
148
 
147
149
static int cmv_decode_frame(AVCodecContext *avctx,
148
 
                            void *data, int *data_size,
 
150
                            void *data, int *got_frame,
149
151
                            AVPacket *avpkt)
150
152
{
151
153
    const uint8_t *buf = avpkt->data;
172
174
 
173
175
    s->frame.reference = 1;
174
176
    s->frame.buffer_hints = FF_BUFFER_HINTS_VALID;
175
 
    if (avctx->get_buffer(avctx, &s->frame)<0) {
 
177
    if (ff_get_buffer(avctx, &s->frame)<0) {
176
178
        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
177
179
        return -1;
178
180
    }
190
192
        cmv_decode_intra(s, buf+2, buf_end);
191
193
    }
192
194
 
193
 
    *data_size = sizeof(AVFrame);
 
195
    *got_frame = 1;
194
196
    *(AVFrame*)data = s->frame;
195
197
 
196
198
    return buf_size;
211
213
AVCodec ff_eacmv_decoder = {
212
214
    .name           = "eacmv",
213
215
    .type           = AVMEDIA_TYPE_VIDEO,
214
 
    .id             = CODEC_ID_CMV,
 
216
    .id             = AV_CODEC_ID_CMV,
215
217
    .priv_data_size = sizeof(CmvContext),
216
218
    .init           = cmv_decode_init,
217
219
    .close          = cmv_decode_end,
218
220
    .decode         = cmv_decode_frame,
219
221
    .capabilities   = CODEC_CAP_DR1,
220
 
    .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts CMV video"),
 
222
    .long_name      = NULL_IF_CONFIG_SMALL("Electronic Arts CMV video"),
221
223
};