4 /* byte stream handling */
8 unsigned char *buf_ptr, *buf_end;
10 void (*write_packet)(void *opaque, UINT8 *buf, int buf_size);
11 int (*write_seek)(void *opaque, long long offset, int whence);
12 long long pos; /* position in the file of the current buffer */
15 int init_put_byte(PutByteContext *s,
16 unsigned char *buffer,
19 void (*write_packet)(void *opaque, UINT8 *buf, int buf_size),
20 int (*write_seek)(void *opaque, long long offset, int whence));
22 void put_byte(PutByteContext *s, int b);
23 void put_buffer(PutByteContext *s, unsigned char *buf, int size);
24 void put_le32(PutByteContext *s, unsigned int val);
25 void put_le64(PutByteContext *s, unsigned long long val);
26 void put_le16(PutByteContext *s, unsigned int val);
27 void put_tag(PutByteContext *s, char *tag);
29 long long put_seek(PutByteContext *s, long long offset, int whence);
30 long long put_pos(PutByteContext *s);
32 void put_flush_packet(PutByteContext *s);
38 int max_payload_size; /* in bytes */
41 int udp_tx_open(UDPContext *s,
44 void udp_tx_close(UDPContext *s);
45 void udp_write_data(void *opaque, UINT8 *buf, int size);
47 /* generic functions */
49 struct AVFormatContext;
51 typedef struct AVFormat {
55 char *extensions; /* comma separated extensions */
56 enum CodecID audio_codec;
57 enum CodecID video_codec;
58 int (*write_header)(struct AVFormatContext *);
59 int (*write_audio_frame)(struct AVFormatContext *,
60 unsigned char *buf, int size);
61 int (*write_video_picture)(struct AVFormatContext *,
62 unsigned char *buf, int size);
63 int (*write_trailer)(struct AVFormatContext *);
64 struct AVFormat *next;
67 typedef struct AVFormatContext {
68 struct AVFormat *format;
71 AVEncodeContext *video_enc;
72 AVEncodeContext *audio_enc;
73 int is_streamed; /* true if the stream is generated as being streamed */
76 extern AVFormat *first_format;
77 extern int data_out_size;
78 extern const char *comment_string;
81 extern AVFormat rm_format;
82 extern AVFormat ra_format;
85 extern AVFormat mpeg_mux_format;
88 extern AVFormat asf_format;
91 extern AVFormat mpjpeg_format;
92 extern AVFormat jpeg_format;
95 extern AVFormat swf_format;
98 void register_avformat(AVFormat *format);
99 AVFormat *guess_format(const char *short_name, const char *filename, const char *mime_type);
101 void register_avencoder(AVEncoder *format);
102 AVEncoder *avencoder_find(enum CodecID id);
103 void avencoder_string(char *buf, int buf_size, AVEncodeContext *enc);
105 int avencoder_open(AVEncodeContext *avctx, AVEncoder *codec);
106 int avencoder_encode(AVEncodeContext *avctx, UINT8 *buf, int buf_size, void *data);
107 int avencoder_close(AVEncodeContext *avctx);
109 extern AVFormat mp2_format;
110 extern AVFormat ac3_format;
111 extern AVFormat h263_format;
112 extern AVFormat mpeg1video_format;
114 int strstart(const char *str, const char *val, const char **ptr);
119 extern const char *v4l_device;
121 long long gettime(void);
122 int v4l_init(int rate, int width, int height);
123 int v4l_read_picture(UINT8 *picture[3],
124 int width, int height,
127 int audio_open(int freq, int channels);