diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2009-03-03 20:04:51 +0300 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2009-03-03 20:04:51 +0300 |
commit | f0a80394645ce436307d3d458878689411a44ba7 (patch) | |
tree | 78da33e8ec44b8767300dcf5fca4b3e6213fbdd4 /libavformat/rtpproto.c | |
parent | 2fea965070a96a04a46513cc524ac4cfcf622fd8 (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/rtpproto.c')
-rw-r--r-- | libavformat/rtpproto.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libavformat/rtpproto.c b/libavformat/rtpproto.c index 610a7f7859..9d80ddf0a7 100644 --- a/libavformat/rtpproto.c +++ b/libavformat/rtpproto.c @@ -169,8 +169,8 @@ static int rtp_open(URLContext *h, const char *uri, int flags) /* just to ease handle access. XXX: need to suppress direct handle access */ - s->rtp_fd = udp_get_file_handle(s->rtp_hd); - s->rtcp_fd = udp_get_file_handle(s->rtcp_hd); + s->rtp_fd = url_get_file_handle(s->rtp_hd); + s->rtcp_fd = url_get_file_handle(s->rtcp_hd); h->max_packet_size = url_get_max_packet_size(s->rtp_hd); h->is_streamed = 1; @@ -296,6 +296,7 @@ int rtp_get_local_port(URLContext *h) return udp_get_local_port(s->rtp_hd); } +#if (LIBAVFORMAT_VERSION_MAJOR <= 52) /** * Return the rtp and rtcp file handles for select() usage to wait for * several RTP streams at the same time. @@ -309,6 +310,13 @@ void rtp_get_file_handles(URLContext *h, int *prtp_fd, int *prtcp_fd) *prtp_fd = s->rtp_fd; *prtcp_fd = s->rtcp_fd; } +#endif + +static int rtp_get_file_handle(URLContext *h) +{ + RTPContext *s = h->priv_data; + return s->rtp_fd; +} URLProtocol rtp_protocol = { "rtp", @@ -317,4 +325,5 @@ URLProtocol rtp_protocol = { rtp_write, NULL, /* seek */ rtp_close, + .url_get_file_handle = rtp_get_file_handle, }; |