comparison pngdec.c @ 6245:817e302aae08 libavcodec

const
author michael
date Fri, 01 Feb 2008 14:00:31 +0000
parents 45d083bbbbe7
children 0a403ade8c81
comparison
equal deleted inserted replaced
6244:bacdb7089756 6245:817e302aae08
29 #include <zlib.h> 29 #include <zlib.h>
30 30
31 //#define DEBUG 31 //#define DEBUG
32 32
33 typedef struct PNGDecContext { 33 typedef struct PNGDecContext {
34 uint8_t *bytestream; 34 const uint8_t *bytestream;
35 uint8_t *bytestream_start; 35 const uint8_t *bytestream_start;
36 uint8_t *bytestream_end; 36 const uint8_t *bytestream_end;
37 AVFrame picture; 37 AVFrame picture;
38 38
39 int state; 39 int state;
40 int width, height; 40 int width, height;
41 int bit_depth; 41 int bit_depth;
310 return 0; 310 return 0;
311 } 311 }
312 312
313 static int decode_frame(AVCodecContext *avctx, 313 static int decode_frame(AVCodecContext *avctx,
314 void *data, int *data_size, 314 void *data, int *data_size,
315 uint8_t *buf, int buf_size) 315 const uint8_t *buf, int buf_size)
316 { 316 {
317 PNGDecContext * const s = avctx->priv_data; 317 PNGDecContext * const s = avctx->priv_data;
318 AVFrame *picture = data; 318 AVFrame *picture = data;
319 AVFrame * const p= (AVFrame*)&s->picture; 319 AVFrame * const p= (AVFrame*)&s->picture;
320 uint32_t tag, length; 320 uint32_t tag, length;