Mercurial > libavformat.hg
comparison avio.h @ 4091:626b5bfb5aef libavformat
whitespace cosmetics
author | diego |
---|---|
date | Sat, 13 Dec 2008 13:39:13 +0000 |
parents | 549a09cf23fe |
children | 724c0f6a52dc |
comparison
equal
deleted
inserted
replaced
4090:a209d26d63c2 | 4091:626b5bfb5aef |
---|---|
112 * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will | 112 * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will |
113 * fail with ENOTSUP if used and not supported. | 113 * fail with ENOTSUP if used and not supported. |
114 * @return >= 0 on success | 114 * @return >= 0 on success |
115 * @see AVInputFormat::read_seek | 115 * @see AVInputFormat::read_seek |
116 */ | 116 */ |
117 int64_t av_url_read_seek(URLContext *h, | 117 int64_t av_url_read_seek(URLContext *h, int stream_index, |
118 int stream_index, int64_t timestamp, int flags); | 118 int64_t timestamp, int flags); |
119 | 119 |
120 /** | 120 /** |
121 * Passing this as the "whence" parameter to a seek function causes it to | 121 * Passing this as the "whence" parameter to a seek function causes it to |
122 * return the filesize without seeking anywhere. Supporting this is optional. | 122 * return the filesize without seeking anywhere. Supporting this is optional. |
123 * If it is not supported then the seek function will return <0. | 123 * If it is not supported then the seek function will return <0. |
131 int (*url_write)(URLContext *h, unsigned char *buf, int size); | 131 int (*url_write)(URLContext *h, unsigned char *buf, int size); |
132 int64_t (*url_seek)(URLContext *h, int64_t pos, int whence); | 132 int64_t (*url_seek)(URLContext *h, int64_t pos, int whence); |
133 int (*url_close)(URLContext *h); | 133 int (*url_close)(URLContext *h); |
134 struct URLProtocol *next; | 134 struct URLProtocol *next; |
135 int (*url_read_pause)(URLContext *h, int pause); | 135 int (*url_read_pause)(URLContext *h, int pause); |
136 int64_t (*url_read_seek)(URLContext *h, | 136 int64_t (*url_read_seek)(URLContext *h, int stream_index, |
137 int stream_index, int64_t timestamp, int flags); | 137 int64_t timestamp, int flags); |
138 } URLProtocol; | 138 } URLProtocol; |
139 | 139 |
140 extern URLProtocol *first_protocol; | 140 extern URLProtocol *first_protocol; |
141 extern URLInterruptCB *url_interrupt_cb; | 141 extern URLInterruptCB *url_interrupt_cb; |
142 | 142 |
168 unsigned long checksum; | 168 unsigned long checksum; |
169 unsigned char *checksum_ptr; | 169 unsigned char *checksum_ptr; |
170 unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size); | 170 unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size); |
171 int error; ///< contains the error code or 0 if no error happened | 171 int error; ///< contains the error code or 0 if no error happened |
172 int (*read_pause)(void *opaque, int pause); | 172 int (*read_pause)(void *opaque, int pause); |
173 int64_t (*read_seek)(void *opaque, | 173 int64_t (*read_seek)(void *opaque, int stream_index, |
174 int stream_index, int64_t timestamp, int flags); | 174 int64_t timestamp, int flags); |
175 } ByteIOContext; | 175 } ByteIOContext; |
176 | 176 |
177 int init_put_byte(ByteIOContext *s, | 177 int init_put_byte(ByteIOContext *s, |
178 unsigned char *buffer, | 178 unsigned char *buffer, |
179 int buffer_size, | 179 int buffer_size, |
236 int url_feof(ByteIOContext *s); | 236 int url_feof(ByteIOContext *s); |
237 | 237 |
238 int url_ferror(ByteIOContext *s); | 238 int url_ferror(ByteIOContext *s); |
239 | 239 |
240 int av_url_read_fpause(ByteIOContext *h, int pause); | 240 int av_url_read_fpause(ByteIOContext *h, int pause); |
241 int64_t av_url_read_fseek(ByteIOContext *h, | 241 int64_t av_url_read_fseek(ByteIOContext *h, int stream_index, |
242 int stream_index, int64_t timestamp, int flags); | 242 int64_t timestamp, int flags); |
243 | 243 |
244 #define URL_EOF (-1) | 244 #define URL_EOF (-1) |
245 /** @note return URL_EOF (-1) if EOF */ | 245 /** @note return URL_EOF (-1) if EOF */ |
246 int url_fgetc(ByteIOContext *s); | 246 int url_fgetc(ByteIOContext *s); |
247 | 247 |
251 #else | 251 #else |
252 int url_fprintf(ByteIOContext *s, const char *fmt, ...); | 252 int url_fprintf(ByteIOContext *s, const char *fmt, ...); |
253 #endif | 253 #endif |
254 | 254 |
255 /** @note unlike fgets, the EOL character is not returned and a whole | 255 /** @note unlike fgets, the EOL character is not returned and a whole |
256 line is parsed. return NULL if first char read was EOF */ | 256 line is parsed. return NULL if first char read was EOF */ |
257 char *url_fgets(ByteIOContext *s, char *buf, int buf_size); | 257 char *url_fgets(ByteIOContext *s, char *buf, int buf_size); |
258 | 258 |
259 void put_flush_packet(ByteIOContext *s); | 259 void put_flush_packet(ByteIOContext *s); |
260 | 260 |
261 | 261 |
272 * @returns number of bytes read or AVERROR | 272 * @returns number of bytes read or AVERROR |
273 */ | 273 */ |
274 int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size); | 274 int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size); |
275 | 275 |
276 /** @note return 0 if EOF, so you cannot use it if EOF handling is | 276 /** @note return 0 if EOF, so you cannot use it if EOF handling is |
277 necessary */ | 277 necessary */ |
278 int get_byte(ByteIOContext *s); | 278 int get_byte(ByteIOContext *s); |
279 unsigned int get_le24(ByteIOContext *s); | 279 unsigned int get_le24(ByteIOContext *s); |
280 unsigned int get_le32(ByteIOContext *s); | 280 unsigned int get_le32(ByteIOContext *s); |
281 uint64_t get_le64(ByteIOContext *s); | 281 uint64_t get_le64(ByteIOContext *s); |
282 unsigned int get_le16(ByteIOContext *s); | 282 unsigned int get_le16(ByteIOContext *s); |
293 { | 293 { |
294 return s->is_streamed; | 294 return s->is_streamed; |
295 } | 295 } |
296 | 296 |
297 /** @note when opened as read/write, the buffers are only used for | 297 /** @note when opened as read/write, the buffers are only used for |
298 writing */ | 298 writing */ |
299 int url_fdopen(ByteIOContext **s, URLContext *h); | 299 int url_fdopen(ByteIOContext **s, URLContext *h); |
300 | 300 |
301 /** @warning must be called before any I/O */ | 301 /** @warning must be called before any I/O */ |
302 int url_setbufsize(ByteIOContext *s, int buf_size); | 302 int url_setbufsize(ByteIOContext *s, int buf_size); |
303 /** Reset the buffer for reading or writing. | 303 /** Reset the buffer for reading or writing. |
305 * @param flags URL_RDONLY to set up the buffer for reading, or URL_WRONLY | 305 * @param flags URL_RDONLY to set up the buffer for reading, or URL_WRONLY |
306 * to set up the buffer for writing. */ | 306 * to set up the buffer for writing. */ |
307 int url_resetbuf(ByteIOContext *s, int flags); | 307 int url_resetbuf(ByteIOContext *s, int flags); |
308 | 308 |
309 /** @note when opened as read/write, the buffers are only used for | 309 /** @note when opened as read/write, the buffers are only used for |
310 writing */ | 310 writing */ |
311 int url_fopen(ByteIOContext **s, const char *filename, int flags); | 311 int url_fopen(ByteIOContext **s, const char *filename, int flags); |
312 int url_fclose(ByteIOContext *s); | 312 int url_fclose(ByteIOContext *s); |
313 URLContext *url_fileno(ByteIOContext *s); | 313 URLContext *url_fileno(ByteIOContext *s); |
314 | 314 |
315 /** | 315 /** |
353 * @param pbuffer pointer to a byte buffer | 353 * @param pbuffer pointer to a byte buffer |
354 * @return the length of the byte buffer | 354 * @return the length of the byte buffer |
355 */ | 355 */ |
356 int url_close_dyn_buf(ByteIOContext *s, uint8_t **pbuffer); | 356 int url_close_dyn_buf(ByteIOContext *s, uint8_t **pbuffer); |
357 | 357 |
358 unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf, unsigned int len); | 358 unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf, |
359 unsigned int len); | |
359 unsigned long get_checksum(ByteIOContext *s); | 360 unsigned long get_checksum(ByteIOContext *s); |
360 void init_checksum(ByteIOContext *s, unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len), unsigned long checksum); | 361 void init_checksum(ByteIOContext *s, |
362 unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len), | |
363 unsigned long checksum); | |
361 | 364 |
362 /* udp.c */ | 365 /* udp.c */ |
363 int udp_set_remote_url(URLContext *h, const char *uri); | 366 int udp_set_remote_url(URLContext *h, const char *uri); |
364 int udp_get_local_port(URLContext *h); | 367 int udp_get_local_port(URLContext *h); |
365 int udp_get_file_handle(URLContext *h); | 368 int udp_get_file_handle(URLContext *h); |