~ubuntu-branches/ubuntu/jaunty/xvidcap/jaunty-proposed

« back to all changes in this revision

Viewing changes to ffmpeg/libavcodec/msvideo1.c

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc, Andrew Starr-Bochicchio, Lionel Le Folgoc
  • Date: 2008-12-26 00:10:06 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20081226001006-2040ls9680bd1blt
Tags: 1.1.7-0.2ubuntu1
[ Andrew Starr-Bochicchio ]
* Merge from debian-multimedia (LP: #298547), Ubuntu Changes:
 - For ffmpeg-related build-deps, fix versionized dependencies
   as the ubuntu versioning is different than debian-multimedia's.

[ Lionel Le Folgoc ]
* LP: #311412 is fixed since the 1.1.7~rc1-0.1 revision.
* debian/patches/03_ffmpeg.diff: updated to fix FTBFS due to libswscale API
  change (cherry-pick from Gentoo #234383).

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 * You should have received a copy of the GNU Lesser General Public
18
18
 * License along with FFmpeg; if not, write to the Free Software
19
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
 
 *
21
20
 */
22
21
 
23
22
/**
36
35
#include <string.h>
37
36
#include <unistd.h>
38
37
 
39
 
#include "common.h"
40
38
#include "avcodec.h"
41
 
#include "dsputil.h"
42
39
 
43
40
#define PALETTE_COUNT 256
44
41
#define CHECK_STREAM_PTR(n) \
51
48
typedef struct Msvideo1Context {
52
49
 
53
50
    AVCodecContext *avctx;
54
 
    DSPContext dsp;
55
51
    AVFrame frame;
56
52
 
57
 
    unsigned char *buf;
 
53
    const unsigned char *buf;
58
54
    int size;
59
55
 
60
56
    int mode_8bit;  /* if it's not 8-bit, it's 16-bit */
61
57
 
62
58
} Msvideo1Context;
63
59
 
64
 
static int msvideo1_decode_init(AVCodecContext *avctx)
 
60
static av_cold int msvideo1_decode_init(AVCodecContext *avctx)
65
61
{
66
 
    Msvideo1Context *s = (Msvideo1Context *)avctx->priv_data;
 
62
    Msvideo1Context *s = avctx->priv_data;
67
63
 
68
64
    s->avctx = avctx;
69
65
 
76
72
        avctx->pix_fmt = PIX_FMT_RGB555;
77
73
    }
78
74
 
79
 
    avctx->has_b_frames = 0;
80
 
    dsputil_init(&s->dsp, avctx);
81
 
 
82
75
    s->frame.data[0] = NULL;
83
76
 
84
77
    return 0;
300
293
 
301
294
static int msvideo1_decode_frame(AVCodecContext *avctx,
302
295
                                void *data, int *data_size,
303
 
                                uint8_t *buf, int buf_size)
 
296
                                const uint8_t *buf, int buf_size)
304
297
{
305
 
    Msvideo1Context *s = (Msvideo1Context *)avctx->priv_data;
 
298
    Msvideo1Context *s = avctx->priv_data;
306
299
 
307
300
    s->buf = buf;
308
301
    s->size = buf_size;
326
319
    return buf_size;
327
320
}
328
321
 
329
 
static int msvideo1_decode_end(AVCodecContext *avctx)
 
322
static av_cold int msvideo1_decode_end(AVCodecContext *avctx)
330
323
{
331
 
    Msvideo1Context *s = (Msvideo1Context *)avctx->priv_data;
 
324
    Msvideo1Context *s = avctx->priv_data;
332
325
 
333
326
    if (s->frame.data[0])
334
327
        avctx->release_buffer(avctx, &s->frame);
346
339
    msvideo1_decode_end,
347
340
    msvideo1_decode_frame,
348
341
    CODEC_CAP_DR1,
 
342
    .long_name= "Microsoft Video 1",
349
343
};