summaryrefslogtreecommitdiff
path: root/libavformat/avio.h
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2009-03-03 17:04:51 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2009-03-03 17:04:51 +0000
commitf0a80394645ce436307d3d458878689411a44ba7 (patch)
tree78da33e8ec44b8767300dcf5fca4b3e6213fbdd4 /libavformat/avio.h
parent2fea965070a96a04a46513cc524ac4cfcf622fd8 (diff)
Add url_get_file_handle(), which is used to get the file descriptor
associated with the I/O handle (e.g. the fd returned by open()). See "[RFC] rtsp.c EOF support" thread. There were previously some URI-specific implementations of the same idea, e.g. rtp_get_file_handles() and udp_get_file_handle(). All of these are deprecated by this patch and will be removed at the next major API bump. Originally committed as revision 17779 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avio.h')
-rw-r--r--libavformat/avio.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavformat/avio.h b/libavformat/avio.h
index d154911559..be02b06f60 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -78,6 +78,15 @@ int url_exist(const char *filename);
int64_t url_filesize(URLContext *h);
/**
+ * Return the file descriptor associated with this URL. For RTP, this
+ * will return only the RTP file descriptor, not the RTCP file descriptor.
+ * To get both, use rtp_get_file_handles().
+ *
+ * @return the file descriptor associated with this URL, or <0 on error.
+ */
+int url_get_file_handle(URLContext *h);
+
+/**
* Return the maximum packet size associated to packetized file
* handle. If the file is not packetized (stream like HTTP or file on
* disk), then 0 is returned.
@@ -144,6 +153,7 @@ typedef struct URLProtocol {
int (*url_read_pause)(URLContext *h, int pause);
int64_t (*url_read_seek)(URLContext *h, int stream_index,
int64_t timestamp, int flags);
+ int (*url_get_file_handle)(URLContext *h);
} URLProtocol;
#if LIBAVFORMAT_VERSION_MAJOR < 53
@@ -389,6 +399,8 @@ void init_checksum(ByteIOContext *s,
/* udp.c */
int udp_set_remote_url(URLContext *h, const char *uri);
int udp_get_local_port(URLContext *h);
+#if (LIBAVFORMAT_VERSION_MAJOR <= 52)
int udp_get_file_handle(URLContext *h);
+#endif
#endif /* AVFORMAT_AVIO_H */