~ubuntu-branches/ubuntu/utopic/libav/utopic

« back to all changes in this revision

Viewing changes to libavcodec/frwu.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2014-05-11 12:28:45 UTC
  • mfrom: (1.3.42 sid)
  • Revision ID: package-import@ubuntu.com-20140511122845-zxdom35pimot5eat
Tags: 6:10.1-1
* New upstream release 10:
   - pcm-dvd: Fix 20bit decoding (bug/592)
   - avi: Improve non-interleaved detection (bug/666)
   - arm: hpeldsp: fix put_pixels8_y2_{,no_rnd_}armv6
   - arm: hpeldsp: prevent overreads in armv6 asm (bug/646)
   - avfilter: Add missing emms_c when needed
   - rtmpproto: Check the buffer sizes when copying app/playpath strings
   - swscale: Fix an undefined behaviour
   - vp9: Read the frame size as unsigned
   - dcadec: Use correct channel count in stereo downmix check
   - dcadec: Do not decode the XCh extension when downmixing to stereo
   - matroska: add the Opus mapping
   - matroskadec: read the CodecDelay element
   - rtmpproto: Make sure to pass on the error code if read_connect failed
   - lavr: allocate the resampling buffer with a positive size
   - mp3enc: Properly write bitrate value in XING header (Closes: #736088)
   - golomb: Fix the implementation of get_se_golomb_long
* Drop debian/libav-tools.maintscript. ffserver is no longer found in
  stable, and this seems to cause other problems today (Closes: #742676)

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    }
33
33
    avctx->pix_fmt = AV_PIX_FMT_UYVY422;
34
34
 
35
 
    avctx->coded_frame = avcodec_alloc_frame();
36
 
    if (!avctx->coded_frame)
37
 
        return AVERROR(ENOMEM);
38
 
 
39
35
    return 0;
40
36
}
41
37
 
43
39
                        AVPacket *avpkt)
44
40
{
45
41
    int field, ret;
46
 
    AVFrame *pic = avctx->coded_frame;
 
42
    AVFrame *pic = data;
47
43
    const uint8_t *buf = avpkt->data;
48
44
    const uint8_t *buf_end = buf + avpkt->size;
49
45
 
50
 
    if (pic->data[0])
51
 
        avctx->release_buffer(avctx, pic);
52
 
 
53
46
    if (avpkt->size < avctx->width * 2 * avctx->height + 4 + 2*8) {
54
47
        av_log(avctx, AV_LOG_ERROR, "Packet is too small.\n");
55
48
        return AVERROR_INVALIDDATA;
59
52
        return AVERROR_INVALIDDATA;
60
53
    }
61
54
 
62
 
    pic->reference = 0;
63
 
    if ((ret = ff_get_buffer(avctx, pic)) < 0) {
 
55
    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0) {
64
56
        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
65
57
        return ret;
66
58
    }
98
90
    }
99
91
 
100
92
    *got_frame = 1;
101
 
    *(AVFrame*)data = *pic;
102
93
 
103
94
    return avpkt->size;
104
95
}
105
96
 
106
 
static av_cold int decode_close(AVCodecContext *avctx)
107
 
{
108
 
    AVFrame *pic = avctx->coded_frame;
109
 
    if (pic->data[0])
110
 
        avctx->release_buffer(avctx, pic);
111
 
    av_freep(&avctx->coded_frame);
112
 
 
113
 
    return 0;
114
 
}
115
 
 
116
97
AVCodec ff_frwu_decoder = {
117
98
    .name           = "frwu",
 
99
    .long_name      = NULL_IF_CONFIG_SMALL("Forward Uncompressed"),
118
100
    .type           = AVMEDIA_TYPE_VIDEO,
119
101
    .id             = AV_CODEC_ID_FRWU,
120
102
    .init           = decode_init,
121
 
    .close          = decode_close,
122
103
    .decode         = decode_frame,
123
104
    .capabilities   = CODEC_CAP_DR1,
124
 
    .long_name      = NULL_IF_CONFIG_SMALL("Forward Uncompressed"),
125
105
};