comparison avio.h @ 2783:1a9db30c1d1c libavformat

Extend ByteIOContext and add the buffered IO functions: av_url_read_fplay(), av_url_read_fpause() and av_url_read_fseek(). patch by: Bj«Órn Axelsson, bjorn d axelsson a intinor d se
author andoma
date Wed, 28 Nov 2007 19:46:49 +0000
parents 50e2307414ee
children 173b5cb7efde
comparison
equal deleted inserted replaced
2782:419e121ce80a 2783:1a9db30c1d1c
154 int max_packet_size; 154 int max_packet_size;
155 unsigned long checksum; 155 unsigned long checksum;
156 unsigned char *checksum_ptr; 156 unsigned char *checksum_ptr;
157 unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size); 157 unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
158 int error; ///< contains the error code or 0 if no error happened 158 int error; ///< contains the error code or 0 if no error happened
159 int (*read_play)(void *opaque);
160 int (*read_pause)(void *opaque);
161 int (*read_seek)(void *opaque,
162 int stream_index, int64_t timestamp, int flags);
159 } ByteIOContext; 163 } ByteIOContext;
160 164
161 int init_put_byte(ByteIOContext *s, 165 int init_put_byte(ByteIOContext *s,
162 unsigned char *buffer, 166 unsigned char *buffer,
163 int buffer_size, 167 int buffer_size,
186 offset_t url_ftell(ByteIOContext *s); 190 offset_t url_ftell(ByteIOContext *s);
187 offset_t url_fsize(ByteIOContext *s); 191 offset_t url_fsize(ByteIOContext *s);
188 int url_feof(ByteIOContext *s); 192 int url_feof(ByteIOContext *s);
189 int url_ferror(ByteIOContext *s); 193 int url_ferror(ByteIOContext *s);
190 194
195 int av_url_read_fplay(ByteIOContext *h);
196 int av_url_read_fpause(ByteIOContext *h);
197 int av_url_read_fseek(ByteIOContext *h,
198 int stream_index, int64_t timestamp, int flags);
199
191 #define URL_EOF (-1) 200 #define URL_EOF (-1)
192 /** @note return URL_EOF (-1) if EOF */ 201 /** @note return URL_EOF (-1) if EOF */
193 int url_fgetc(ByteIOContext *s); 202 int url_fgetc(ByteIOContext *s);
194 203
195 /** @warning currently size is limited */ 204 /** @warning currently size is limited */