2 * copyright (c) 2001 Fabrice Bellard
4 * This file is part of Libav.
6 * Libav is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * Libav is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with Libav; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef AVFORMAT_AVIO_H
21 #define AVFORMAT_AVIO_H
25 * Buffered I/O operations
30 #include "libavutil/common.h"
31 #include "libavutil/dict.h"
32 #include "libavutil/log.h"
34 #include "libavformat/version.h"
37 #define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */
40 * Callback for checking whether to abort blocking functions.
41 * AVERROR_EXIT is returned in this case by the interrupted
42 * function. During blocking operations, callback is called with
43 * opaque as parameter. If the callback returns 1, the
44 * blocking operation will be aborted.
46 * No members can be added to this struct without a major bump, if
47 * new elements have been added after this struct in AVFormatContext
51 int (*callback)(void*);
56 * Bytestream IO Context.
57 * New fields can be added to the end with minor version bumps.
58 * Removal, reordering and changes to existing fields require a major
60 * sizeof(AVIOContext) must not be used outside libav*.
62 * @note None of the function pointers in AVIOContext should be called
63 * directly, they should only be set by the client application
64 * when implementing custom I/O. Normally these are set to the
65 * function pointers specified in avio_alloc_context()
70 * A class for private options.
72 * If this AVIOContext is created by avio_open2(), av_class is set and
73 * passes the options down to protocols.
75 * If this AVIOContext is manually allocated, then av_class may be set by
78 * warning -- this field can be NULL, be sure to not pass this AVIOContext
79 * to any av_opt_* functions in that case.
83 unsigned char *buffer; /**< Start of the buffer. */
84 int buffer_size; /**< Maximum buffer size */
85 unsigned char *buf_ptr; /**< Current position in the buffer */
86 unsigned char *buf_end; /**< End of the data, may be less than
87 buffer+buffer_size if the read function returned
88 less data than requested, e.g. for streams where
89 no more data has been received yet. */
90 void *opaque; /**< A private pointer, passed to the read/write/seek/...
92 int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
93 int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
94 int64_t (*seek)(void *opaque, int64_t offset, int whence);
95 int64_t pos; /**< position in the file of the current buffer */
96 int must_flush; /**< true if the next seek should flush */
97 int eof_reached; /**< true if eof reached */
98 int write_flag; /**< true if open for writing */
100 attribute_deprecated int is_streamed;
103 unsigned long checksum;
104 unsigned char *checksum_ptr;
105 unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
106 int error; /**< contains the error code or 0 if no error happened */
108 * Pause or resume playback for network streaming protocols - e.g. MMS.
110 int (*read_pause)(void *opaque, int pause);
112 * Seek to a given timestamp in stream with the specified stream_index.
113 * Needed for some network streaming protocols which don't support seeking
116 int64_t (*read_seek)(void *opaque, int stream_index,
117 int64_t timestamp, int flags);
119 * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
129 * New fields can be added to the end with minor version bumps.
130 * Removal, reordering and changes to existing fields require a major
132 * sizeof(URLContext) must not be used outside libav*.
133 * @deprecated This struct will be made private
135 typedef struct URLContext {
136 const AVClass *av_class; ///< information for av_log(). Set by url_open().
137 struct URLProtocol *prot;
139 int is_streamed; /**< true if streamed (no seek possible), default = false */
140 int max_packet_size; /**< if non zero, the stream is packetized with this max packet size */
142 char *filename; /**< specified URL */
144 AVIOInterruptCB interrupt_callback;
147 #define URL_PROTOCOL_FLAG_NESTED_SCHEME 1 /*< The protocol name can be the first part of a nested protocol scheme */
150 * @deprecated This struct is to be made private. Use the higher-level
151 * AVIOContext-based API instead.
153 typedef struct URLProtocol {
155 int (*url_open)(URLContext *h, const char *url, int flags);
156 int (*url_read)(URLContext *h, unsigned char *buf, int size);
157 int (*url_write)(URLContext *h, const unsigned char *buf, int size);
158 int64_t (*url_seek)(URLContext *h, int64_t pos, int whence);
159 int (*url_close)(URLContext *h);
160 struct URLProtocol *next;
161 int (*url_read_pause)(URLContext *h, int pause);
162 int64_t (*url_read_seek)(URLContext *h, int stream_index,
163 int64_t timestamp, int flags);
164 int (*url_get_file_handle)(URLContext *h);
166 const AVClass *priv_data_class;
168 int (*url_check)(URLContext *h, int mask);
171 typedef struct URLPollEntry {
177 /* not implemented */
178 attribute_deprecated int url_poll(URLPollEntry *poll_table, int n, int timeout);
181 * @name URL open modes
182 * The flags argument to url_open and cosins must be one of the following
183 * constants, optionally ORed with other flags.
186 #define URL_RDONLY 1 /**< read-only */
187 #define URL_WRONLY 2 /**< write-only */
188 #define URL_RDWR (URL_RDONLY|URL_WRONLY) /**< read-write */
194 * Use non-blocking mode.
195 * If this flag is set, operations on the context will return
196 * AVERROR(EAGAIN) if they can not be performed immediately.
197 * If this flag is not set, operations on the context will never return
199 * Note that this flag does not affect the opening/connecting of the
200 * context. Connecting a protocol will always block if necessary (e.g. on
201 * network protocols) but never hang (e.g. on busy devices).
202 * Warning: non-blocking protocols is work-in-progress; this flag may be
205 #define URL_FLAG_NONBLOCK 4
207 typedef int URLInterruptCB(void);
208 extern URLInterruptCB *url_interrupt_cb;
211 * @defgroup old_url_funcs Old url_* functions
212 * The following functions are deprecated. Use the buffered API based on #AVIOContext instead.
215 attribute_deprecated int url_open_protocol (URLContext **puc, struct URLProtocol *up,
216 const char *url, int flags);
217 attribute_deprecated int url_alloc(URLContext **h, const char *url, int flags);
218 attribute_deprecated int url_connect(URLContext *h);
219 attribute_deprecated int url_open(URLContext **h, const char *url, int flags);
220 attribute_deprecated int url_read(URLContext *h, unsigned char *buf, int size);
221 attribute_deprecated int url_read_complete(URLContext *h, unsigned char *buf, int size);
222 attribute_deprecated int url_write(URLContext *h, const unsigned char *buf, int size);
223 attribute_deprecated int64_t url_seek(URLContext *h, int64_t pos, int whence);
224 attribute_deprecated int url_close(URLContext *h);
225 attribute_deprecated int64_t url_filesize(URLContext *h);
226 attribute_deprecated int url_get_file_handle(URLContext *h);
227 attribute_deprecated int url_get_max_packet_size(URLContext *h);
228 attribute_deprecated void url_get_filename(URLContext *h, char *buf, int buf_size);
229 attribute_deprecated int av_url_read_pause(URLContext *h, int pause);
230 attribute_deprecated int64_t av_url_read_seek(URLContext *h, int stream_index,
231 int64_t timestamp, int flags);
232 attribute_deprecated void url_set_interrupt_cb(int (*interrupt_cb)(void));
234 * If protocol is NULL, returns the first registered protocol,
235 * if protocol is non-NULL, returns the next registered protocol after protocol,
236 * or NULL if protocol is the last one.
238 attribute_deprecated URLProtocol *av_protocol_next(URLProtocol *p);
240 * Register the URLProtocol protocol.
242 * @param size the size of the URLProtocol struct referenced
244 attribute_deprecated int av_register_protocol2(URLProtocol *protocol, int size);
250 typedef attribute_deprecated AVIOContext ByteIOContext;
252 attribute_deprecated int init_put_byte(AVIOContext *s,
253 unsigned char *buffer,
257 int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
258 int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
259 int64_t (*seek)(void *opaque, int64_t offset, int whence));
260 attribute_deprecated AVIOContext *av_alloc_put_byte(
261 unsigned char *buffer,
265 int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
266 int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
267 int64_t (*seek)(void *opaque, int64_t offset, int whence));
270 * @defgroup old_avio_funcs Old put_/get_*() functions
271 * The following functions are deprecated. Use the "avio_"-prefixed functions instead.
274 attribute_deprecated int get_buffer(AVIOContext *s, unsigned char *buf, int size);
275 attribute_deprecated int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size);
276 attribute_deprecated int get_byte(AVIOContext *s);
277 attribute_deprecated unsigned int get_le16(AVIOContext *s);
278 attribute_deprecated unsigned int get_le24(AVIOContext *s);
279 attribute_deprecated unsigned int get_le32(AVIOContext *s);
280 attribute_deprecated uint64_t get_le64(AVIOContext *s);
281 attribute_deprecated unsigned int get_be16(AVIOContext *s);
282 attribute_deprecated unsigned int get_be24(AVIOContext *s);
283 attribute_deprecated unsigned int get_be32(AVIOContext *s);
284 attribute_deprecated uint64_t get_be64(AVIOContext *s);
286 attribute_deprecated void put_byte(AVIOContext *s, int b);
287 attribute_deprecated void put_nbyte(AVIOContext *s, int b, int count);
288 attribute_deprecated void put_buffer(AVIOContext *s, const unsigned char *buf, int size);
289 attribute_deprecated void put_le64(AVIOContext *s, uint64_t val);
290 attribute_deprecated void put_be64(AVIOContext *s, uint64_t val);
291 attribute_deprecated void put_le32(AVIOContext *s, unsigned int val);
292 attribute_deprecated void put_be32(AVIOContext *s, unsigned int val);
293 attribute_deprecated void put_le24(AVIOContext *s, unsigned int val);
294 attribute_deprecated void put_be24(AVIOContext *s, unsigned int val);
295 attribute_deprecated void put_le16(AVIOContext *s, unsigned int val);
296 attribute_deprecated void put_be16(AVIOContext *s, unsigned int val);
297 attribute_deprecated void put_tag(AVIOContext *s, const char *tag);
302 attribute_deprecated int av_url_read_fpause(AVIOContext *h, int pause);
303 attribute_deprecated int64_t av_url_read_fseek (AVIOContext *h, int stream_index,
304 int64_t timestamp, int flags);
307 * @defgroup old_url_f_funcs Old url_f* functions
308 * The following functions are deprecated, use the "avio_"-prefixed functions instead.
311 attribute_deprecated int url_fopen( AVIOContext **s, const char *url, int flags);
312 attribute_deprecated int url_fclose(AVIOContext *s);
313 attribute_deprecated int64_t url_fseek(AVIOContext *s, int64_t offset, int whence);
314 attribute_deprecated int url_fskip(AVIOContext *s, int64_t offset);
315 attribute_deprecated int64_t url_ftell(AVIOContext *s);
316 attribute_deprecated int64_t url_fsize(AVIOContext *s);
318 attribute_deprecated int url_fgetc(AVIOContext *s);
319 attribute_deprecated int url_setbufsize(AVIOContext *s, int buf_size);
320 attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);
321 attribute_deprecated void put_flush_packet(AVIOContext *s);
322 attribute_deprecated int url_open_dyn_buf(AVIOContext **s);
323 attribute_deprecated int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
324 attribute_deprecated int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
325 attribute_deprecated int url_fdopen(AVIOContext **s, URLContext *h);
331 * @deprecated use AVIOContext.eof_reached
333 attribute_deprecated int url_feof(AVIOContext *s);
334 attribute_deprecated int url_ferror(AVIOContext *s);
336 attribute_deprecated int udp_set_remote_url(URLContext *h, const char *uri);
337 attribute_deprecated int udp_get_local_port(URLContext *h);
339 attribute_deprecated void init_checksum(AVIOContext *s,
340 unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len),
341 unsigned long checksum);
342 attribute_deprecated unsigned long get_checksum(AVIOContext *s);
343 attribute_deprecated void put_strz(AVIOContext *s, const char *buf);
344 /** @note unlike fgets, the EOL character is not returned and a whole
345 line is parsed. return NULL if first char read was EOF */
346 attribute_deprecated char *url_fgets(AVIOContext *s, char *buf, int buf_size);
348 * @deprecated use avio_get_str instead
350 attribute_deprecated char *get_strz(AVIOContext *s, char *buf, int maxlen);
352 * @deprecated Use AVIOContext.seekable field directly.
354 attribute_deprecated static inline int url_is_streamed(AVIOContext *s)
358 attribute_deprecated URLContext *url_fileno(AVIOContext *s);
361 * @deprecated use AVIOContext.max_packet_size directly.
363 attribute_deprecated int url_fget_max_packet_size(AVIOContext *s);
365 attribute_deprecated int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags);
367 /** return the written or read size */
368 attribute_deprecated int url_close_buf(AVIOContext *s);
371 * Return a non-zero value if the resource indicated by url
372 * exists, 0 otherwise.
373 * @deprecated Use avio_check instead.
375 attribute_deprecated int url_exist(const char *url);
376 #endif // FF_API_OLD_AVIO
379 * Return AVIO_FLAG_* access flags corresponding to the access permissions
380 * of the resource in url, or a negative value corresponding to an
381 * AVERROR code in case of failure. The returned access flags are
382 * masked by the value in flags.
384 * @note This function is intrinsically unsafe, in the sense that the
385 * checked resource may change its existence or permission status from
386 * one call to another. Thus you should not trust the returned value,
387 * unless you are sure that no other processes are accessing the
390 int avio_check(const char *url, int flags);
393 * The callback is called in blocking functions to test regulary if
394 * asynchronous interruption is needed. AVERROR_EXIT is returned
395 * in this case by the interrupted function. 'NULL' means no interrupt
398 void avio_set_interrupt_cb(int (*interrupt_cb)(void));
401 * Allocate and initialize an AVIOContext for buffered I/O. It must be later
402 * freed with av_free().
404 * @param buffer Memory block for input/output operations via AVIOContext.
405 * The buffer must be allocated with av_malloc() and friends.
406 * @param buffer_size The buffer size is very important for performance.
407 * For protocols with fixed blocksize it should be set to this blocksize.
408 * For others a typical size is a cache page, e.g. 4kb.
409 * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise.
410 * @param opaque An opaque pointer to user-specific data.
411 * @param read_packet A function for refilling the buffer, may be NULL.
412 * @param write_packet A function for writing the buffer contents, may be NULL.
413 * @param seek A function for seeking to specified byte position, may be NULL.
415 * @return Allocated AVIOContext or NULL on failure.
417 AVIOContext *avio_alloc_context(
418 unsigned char *buffer,
422 int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
423 int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
424 int64_t (*seek)(void *opaque, int64_t offset, int whence));
426 void avio_w8(AVIOContext *s, int b);
427 void avio_write(AVIOContext *s, const unsigned char *buf, int size);
428 void avio_wl64(AVIOContext *s, uint64_t val);
429 void avio_wb64(AVIOContext *s, uint64_t val);
430 void avio_wl32(AVIOContext *s, unsigned int val);
431 void avio_wb32(AVIOContext *s, unsigned int val);
432 void avio_wl24(AVIOContext *s, unsigned int val);
433 void avio_wb24(AVIOContext *s, unsigned int val);
434 void avio_wl16(AVIOContext *s, unsigned int val);
435 void avio_wb16(AVIOContext *s, unsigned int val);
438 * Write a NULL-terminated string.
439 * @return number of bytes written.
441 int avio_put_str(AVIOContext *s, const char *str);
444 * Convert an UTF-8 string to UTF-16LE and write it.
445 * @return number of bytes written.
447 int avio_put_str16le(AVIOContext *s, const char *str);
450 * Passing this as the "whence" parameter to a seek function causes it to
451 * return the filesize without seeking anywhere. Supporting this is optional.
452 * If it is not supported then the seek function will return <0.
454 #define AVSEEK_SIZE 0x10000
457 * Oring this flag as into the "whence" parameter to a seek function causes it to
458 * seek by any means (like reopening and linear reading) or other normally unreasonble
459 * means that can be extreemly slow.
460 * This may be ignored by the seek code.
462 #define AVSEEK_FORCE 0x20000
465 * fseek() equivalent for AVIOContext.
466 * @return new position or AVERROR.
468 int64_t avio_seek(AVIOContext *s, int64_t offset, int whence);
471 * Skip given number of bytes forward
472 * @return new position or AVERROR.
474 static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
476 return avio_seek(s, offset, SEEK_CUR);
480 * ftell() equivalent for AVIOContext.
481 * @return position or AVERROR.
483 static av_always_inline int64_t avio_tell(AVIOContext *s)
485 return avio_seek(s, 0, SEEK_CUR);
490 * @return filesize or AVERROR
492 int64_t avio_size(AVIOContext *s);
494 /** @warning currently size is limited */
495 int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);
497 void avio_flush(AVIOContext *s);
501 * Read size bytes from AVIOContext into buf.
502 * @return number of bytes read or AVERROR
504 int avio_read(AVIOContext *s, unsigned char *buf, int size);
507 * @name Functions for reading from AVIOContext
510 * @note return 0 if EOF, so you cannot use it if EOF handling is
513 int avio_r8 (AVIOContext *s);
514 unsigned int avio_rl16(AVIOContext *s);
515 unsigned int avio_rl24(AVIOContext *s);
516 unsigned int avio_rl32(AVIOContext *s);
517 uint64_t avio_rl64(AVIOContext *s);
518 unsigned int avio_rb16(AVIOContext *s);
519 unsigned int avio_rb24(AVIOContext *s);
520 unsigned int avio_rb32(AVIOContext *s);
521 uint64_t avio_rb64(AVIOContext *s);
527 * Read a string from pb into buf. The reading will terminate when either
528 * a NULL character was encountered, maxlen bytes have been read, or nothing
529 * more can be read from pb. The result is guaranteed to be NULL-terminated, it
530 * will be truncated if buf is too small.
531 * Note that the string is not interpreted or validated in any way, it
532 * might get truncated in the middle of a sequence for multi-byte encodings.
534 * @return number of bytes read (is always <= maxlen).
535 * If reading ends on EOF or error, the return value will be one more than
536 * bytes actually read.
538 int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen);
541 * Read a UTF-16 string from pb and convert it to UTF-8.
542 * The reading will terminate when either a null or invalid character was
543 * encountered or maxlen bytes have been read.
544 * @return number of bytes read (is always <= maxlen)
546 int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen);
547 int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
551 * @name URL open modes
552 * The flags argument to avio_open must be one of the following
553 * constants, optionally ORed with other flags.
556 #define AVIO_FLAG_READ 1 /**< read-only */
557 #define AVIO_FLAG_WRITE 2 /**< write-only */
558 #define AVIO_FLAG_READ_WRITE (AVIO_FLAG_READ|AVIO_FLAG_WRITE) /**< read-write pseudo flag */
564 * Use non-blocking mode.
565 * If this flag is set, operations on the context will return
566 * AVERROR(EAGAIN) if they can not be performed immediately.
567 * If this flag is not set, operations on the context will never return
569 * Note that this flag does not affect the opening/connecting of the
570 * context. Connecting a protocol will always block if necessary (e.g. on
571 * network protocols) but never hang (e.g. on busy devices).
572 * Warning: non-blocking protocols is work-in-progress; this flag may be
575 #define AVIO_FLAG_NONBLOCK 8
578 * Create and initialize a AVIOContext for accessing the
579 * resource indicated by url.
580 * @note When the resource indicated by url has been opened in
581 * read+write mode, the AVIOContext can be used only for writing.
583 * @param s Used to return the pointer to the created AVIOContext.
584 * In case of failure the pointed to value is set to NULL.
585 * @param flags flags which control how the resource indicated by url
587 * @return 0 in case of success, a negative value corresponding to an
588 * AVERROR code in case of failure
590 int avio_open(AVIOContext **s, const char *url, int flags);
593 * Create and initialize a AVIOContext for accessing the
594 * resource indicated by url.
595 * @note When the resource indicated by url has been opened in
596 * read+write mode, the AVIOContext can be used only for writing.
598 * @param s Used to return the pointer to the created AVIOContext.
599 * In case of failure the pointed to value is set to NULL.
600 * @param flags flags which control how the resource indicated by url
602 * @param int_cb an interrupt callback to be used at the protocols level
603 * @param options A dictionary filled with protocol-private options. On return
604 * this parameter will be destroyed and replaced with a dict containing options
605 * that were not found. May be NULL.
606 * @return 0 in case of success, a negative value corresponding to an
607 * AVERROR code in case of failure
609 int avio_open2(AVIOContext **s, const char *url, int flags,
610 const AVIOInterruptCB *int_cb, AVDictionary **options);
613 * Close the resource accessed by the AVIOContext s and free it.
614 * This function can only be used if s was opened by avio_open().
616 * @return 0 on success, an AVERROR < 0 on error.
618 int avio_close(AVIOContext *s);
621 * Open a write only memory stream.
623 * @param s new IO context
624 * @return zero if no error.
626 int avio_open_dyn_buf(AVIOContext **s);
629 * Return the written size and a pointer to the buffer. The buffer
630 * must be freed with av_free().
631 * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
633 * @param s IO context
634 * @param pbuffer pointer to a byte buffer
635 * @return the length of the byte buffer
637 int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
640 * Iterate through names of available protocols.
642 * @param opaque A private pointer representing current protocol.
643 * It must be a pointer to NULL on first iteration and will
644 * be updated by successive calls to avio_enum_protocols.
645 * @param output If set to 1, iterate over output protocols,
646 * otherwise over input protocols.
648 * @return A static string containing the name of current protocol or NULL
650 const char *avio_enum_protocols(void **opaque, int output);
653 * Pause and resume playing - only meaningful if using a network streaming
654 * protocol (e.g. MMS).
655 * @param pause 1 for pause, 0 for resume
657 int avio_pause(AVIOContext *h, int pause);
660 * Seek to a given timestamp relative to some component stream.
661 * Only meaningful if using a network streaming protocol (e.g. MMS.).
662 * @param stream_index The stream index that the timestamp is relative to.
663 * If stream_index is (-1) the timestamp should be in AV_TIME_BASE
664 * units from the beginning of the presentation.
665 * If a stream_index >= 0 is used and the protocol does not support
666 * seeking based on component streams, the call will fail with ENOTSUP.
667 * @param timestamp timestamp in AVStream.time_base units
668 * or if there is no stream specified then in AV_TIME_BASE units.
669 * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
670 * and AVSEEK_FLAG_ANY. The protocol may silently ignore
671 * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
672 * fail with ENOTSUP if used and not supported.
673 * @return >= 0 on success
674 * @see AVInputFormat::read_seek
676 int64_t avio_seek_time(AVIOContext *h, int stream_index,
677 int64_t timestamp, int flags);
679 #endif /* AVFORMAT_AVIO_H */