aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/avio.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-03-05 21:06:46 +0100
committerAnton Khirnov <anton@khirnov.net>2011-04-03 22:46:40 +0200
commit8978fedaeefdff50ed4deefbfe822ad07f19f616 (patch)
treeffa8b7680649f418f83b1e833e0221749fbb6bdd /libavformat/avio.h
parent79997def65fd2313b48a5f3c3a884c6149ae9b5d (diff)
downloadffmpeg-8978fedaeefdff50ed4deefbfe822ad07f19f616.tar.gz
avio: introduce an AVIOContext.seekable field
Use it instead of url_is_streamed and AVIOContext.is_streamed.
Diffstat (limited to 'libavformat/avio.h')
-rw-r--r--libavformat/avio.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 7c2726f656..80446b4808 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -332,6 +332,8 @@ attribute_deprecated int av_register_protocol(URLProtocol *protocol);
*/
int av_register_protocol2(URLProtocol *protocol, int size);
+#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */
+
/**
* Bytestream IO Context.
* New fields can be added to the end with minor version bumps.
@@ -351,7 +353,9 @@ typedef struct {
int must_flush; /**< true if the next seek should flush */
int eof_reached; /**< true if eof reached */
int write_flag; /**< true if open for writing */
- int is_streamed;
+#if FF_API_OLD_AVIO
+ attribute_deprecated int is_streamed;
+#endif
int max_packet_size;
unsigned long checksum;
unsigned char *checksum_ptr;
@@ -360,6 +364,10 @@ typedef struct {
int (*read_pause)(void *opaque, int pause);
int64_t (*read_seek)(void *opaque, int stream_index,
int64_t timestamp, int flags);
+ /**
+ * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
+ */
+ int seekable;
} AVIOContext;
#if FF_API_OLD_AVIO
@@ -604,10 +612,15 @@ unsigned int avio_rb24(AVIOContext *s);
unsigned int avio_rb32(AVIOContext *s);
uint64_t avio_rb64(AVIOContext *s);
-static inline int url_is_streamed(AVIOContext *s)
+#if FF_API_OLD_AVIO
+/**
+ * @deprecated Use AVIOContext.seekable field directly.
+ */
+attribute_deprecated static inline int url_is_streamed(AVIOContext *s)
{
- return s->is_streamed;
+ return !s->seekable;
}
+#endif
/**
* Create and initialize a AVIOContext for accessing the