Mercurial > libavformat.hg
comparison gif.c @ 241:3d92f793fd67 libavformat
64 bit pts for writing - more const usage
author | bellard |
---|---|
date | Wed, 10 Sep 2003 22:37:33 +0000 |
parents | 25062c9b1f86 |
children | 3dd3646e0164 |
comparison
equal
deleted
inserted
replaced
240:e6f99d238179 | 241:3d92f793fd67 |
---|---|
218 } | 218 } |
219 | 219 |
220 | 220 |
221 static int gif_image_write_image(ByteIOContext *pb, | 221 static int gif_image_write_image(ByteIOContext *pb, |
222 int x1, int y1, int width, int height, | 222 int x1, int y1, int width, int height, |
223 uint8_t *buf, int linesize, int pix_fmt) | 223 const uint8_t *buf, int linesize, int pix_fmt) |
224 { | 224 { |
225 PutBitContext p; | 225 PutBitContext p; |
226 uint8_t buffer[200]; /* 100 * 9 / 8 = 113 */ | 226 uint8_t buffer[200]; /* 100 * 9 / 8 = 113 */ |
227 int i, left, w, v; | 227 int i, left, w, v; |
228 uint8_t *ptr; | 228 const uint8_t *ptr; |
229 /* image block */ | 229 /* image block */ |
230 | 230 |
231 put_byte(pb, 0x2c); | 231 put_byte(pb, 0x2c); |
232 put_le16(pb, x1); | 232 put_le16(pb, x1); |
233 put_le16(pb, y1); | 233 put_le16(pb, y1); |
329 put_flush_packet(&s->pb); | 329 put_flush_packet(&s->pb); |
330 return 0; | 330 return 0; |
331 } | 331 } |
332 | 332 |
333 static int gif_write_video(AVFormatContext *s, | 333 static int gif_write_video(AVFormatContext *s, |
334 AVCodecContext *enc, uint8_t *buf, int size) | 334 AVCodecContext *enc, const uint8_t *buf, int size) |
335 { | 335 { |
336 ByteIOContext *pb = &s->pb; | 336 ByteIOContext *pb = &s->pb; |
337 GIFContext *gif = s->priv_data; | 337 GIFContext *gif = s->priv_data; |
338 int jiffies; | 338 int jiffies; |
339 int64_t delay; | 339 int64_t delay; |
364 put_flush_packet(&s->pb); | 364 put_flush_packet(&s->pb); |
365 return 0; | 365 return 0; |
366 } | 366 } |
367 | 367 |
368 static int gif_write_packet(AVFormatContext *s, int stream_index, | 368 static int gif_write_packet(AVFormatContext *s, int stream_index, |
369 uint8_t *buf, int size, int force_pts) | 369 const uint8_t *buf, int size, int64_t pts) |
370 { | 370 { |
371 AVCodecContext *codec = &s->streams[stream_index]->codec; | 371 AVCodecContext *codec = &s->streams[stream_index]->codec; |
372 if (codec->codec_type == CODEC_TYPE_AUDIO) | 372 if (codec->codec_type == CODEC_TYPE_AUDIO) |
373 return 0; /* just ignore audio */ | 373 return 0; /* just ignore audio */ |
374 else | 374 else |