comparison mpjpeg.c @ 2771:d52c718e83f9 libavformat

Use dynamically allocated ByteIOContext in AVFormatContext patch by: Bj«Órn Axelsson, bjorn d axelsson a intinor d se thread: [PATCH] Remove static ByteIOContexts, 06 nov 2007
author andoma
date Wed, 21 Nov 2007 07:41:00 +0000
parents 0899bfe4105c
children 7a0230981402
comparison
equal deleted inserted replaced
2770:a7e42cf4b364 2771:d52c718e83f9
27 static int mpjpeg_write_header(AVFormatContext *s) 27 static int mpjpeg_write_header(AVFormatContext *s)
28 { 28 {
29 uint8_t buf1[256]; 29 uint8_t buf1[256];
30 30
31 snprintf(buf1, sizeof(buf1), "--%s\n", BOUNDARY_TAG); 31 snprintf(buf1, sizeof(buf1), "--%s\n", BOUNDARY_TAG);
32 put_buffer(&s->pb, buf1, strlen(buf1)); 32 put_buffer(s->pb, buf1, strlen(buf1));
33 put_flush_packet(&s->pb); 33 put_flush_packet(s->pb);
34 return 0; 34 return 0;
35 } 35 }
36 36
37 static int mpjpeg_write_packet(AVFormatContext *s, AVPacket *pkt) 37 static int mpjpeg_write_packet(AVFormatContext *s, AVPacket *pkt)
38 { 38 {
39 uint8_t buf1[256]; 39 uint8_t buf1[256];
40 40
41 snprintf(buf1, sizeof(buf1), "Content-type: image/jpeg\n\n"); 41 snprintf(buf1, sizeof(buf1), "Content-type: image/jpeg\n\n");
42 put_buffer(&s->pb, buf1, strlen(buf1)); 42 put_buffer(s->pb, buf1, strlen(buf1));
43 put_buffer(&s->pb, pkt->data, pkt->size); 43 put_buffer(s->pb, pkt->data, pkt->size);
44 44
45 snprintf(buf1, sizeof(buf1), "\n--%s\n", BOUNDARY_TAG); 45 snprintf(buf1, sizeof(buf1), "\n--%s\n", BOUNDARY_TAG);
46 put_buffer(&s->pb, buf1, strlen(buf1)); 46 put_buffer(s->pb, buf1, strlen(buf1));
47 put_flush_packet(&s->pb); 47 put_flush_packet(s->pb);
48 return 0; 48 return 0;
49 } 49 }
50 50
51 static int mpjpeg_write_trailer(AVFormatContext *s) 51 static int mpjpeg_write_trailer(AVFormatContext *s)
52 { 52 {