{
return ffurl_size(h);
}
+int url_get_file_handle(URLContext *h)
+{
+ return ffurl_get_file_handle(h);
+}
#endif
#define URL_SCHEME_CHARS \
return size;
}
-int url_get_file_handle(URLContext *h)
+int ffurl_get_file_handle(URLContext *h)
{
if (!h->prot->url_get_file_handle)
return -1;
attribute_deprecated int64_t url_seek(URLContext *h, int64_t pos, int whence);
attribute_deprecated int url_close(URLContext *h);
attribute_deprecated int64_t url_filesize(URLContext *h);
+attribute_deprecated int url_get_file_handle(URLContext *h);
#endif
/**
int url_exist(const char *url);
/**
- * Return the file descriptor associated with this URL. For RTP, this
- * will return only the RTP file descriptor, not the RTCP file descriptor.
- *
- * @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.
http_get_file_handle(URLContext *h)
{
HTTPContext *s = h->priv_data;
- return url_get_file_handle(s->hd);
+ return ffurl_get_file_handle(s->hd);
}
URLProtocol ff_http_protocol = {
/* just to ease handle access. XXX: need to suppress direct handle
access */
- s->rtp_fd = url_get_file_handle(s->rtp_hd);
- s->rtcp_fd = url_get_file_handle(s->rtcp_hd);
+ s->rtp_fd = ffurl_get_file_handle(s->rtp_hd);
+ s->rtcp_fd = ffurl_get_file_handle(s->rtcp_hd);
h->max_packet_size = url_get_max_packet_size(s->rtp_hd);
h->is_streamed = 1;
}
rt->seq = 0;
- tcp_fd = url_get_file_handle(rt->rtsp_hd);
+ tcp_fd = ffurl_get_file_handle(rt->rtsp_hd);
if (!getpeername(tcp_fd, (struct sockaddr*) &peer, &peer_len)) {
getnameinfo((struct sockaddr*) &peer, peer_len, host, sizeof(host),
NULL, 0, NI_NUMERICHOST);
return AVERROR(EAGAIN);
max_p = 0;
if (rt->rtsp_hd) {
- tcp_fd = url_get_file_handle(rt->rtsp_hd);
+ tcp_fd = ffurl_get_file_handle(rt->rtsp_hd);
p[max_p].fd = tcp_fd;
p[max_p++].events = POLLIN;
} else {
for (i = 0; i < rt->nb_rtsp_streams; i++) {
rtsp_st = rt->rtsp_streams[i];
if (rtsp_st->rtp_handle) {
- p[max_p].fd = url_get_file_handle(rtsp_st->rtp_handle);
+ p[max_p].fd = ffurl_get_file_handle(rtsp_st->rtp_handle);
p[max_p++].events = POLLIN;
p[max_p].fd = rtp_get_rtcp_file_handle(rtsp_st->rtp_handle);
p[max_p++].events = POLLIN;
payload_type = recvbuf[1] & 0x7f;
break;
}
- getsockname(url_get_file_handle(in), (struct sockaddr*) &addr, &addrlen);
+ getsockname(ffurl_get_file_handle(in), (struct sockaddr*) &addr, &addrlen);
ffurl_close(in);
in = NULL;
RTSPState *rt = s->priv_data;
RTSPStream *rtsp_st;
int n;
- struct pollfd p = {url_get_file_handle(rt->rtsp_hd), POLLIN, 0};
+ struct pollfd p = {ffurl_get_file_handle(rt->rtsp_hd), POLLIN, 0};
AVFormatContext *rtpctx;
int ret;
static int sap_fetch_packet(AVFormatContext *s, AVPacket *pkt)
{
struct SAPState *sap = s->priv_data;
- int fd = url_get_file_handle(sap->ann_fd);
+ int fd = ffurl_get_file_handle(sap->ann_fd);
int n, ret;
struct pollfd p = {fd, POLLIN, 0};
uint8_t recvbuf[1500];
goto fail;
}
- udp_fd = url_get_file_handle(sap->ann_fd);
+ udp_fd = ffurl_get_file_handle(sap->ann_fd);
if (getsockname(udp_fd, (struct sockaddr*) &localaddr, &addrlen)) {
ret = AVERROR(EIO);
goto fail;
*/
int64_t ffurl_size(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.
+ *
+ * @return the file descriptor associated with this URL, or <0 on error.
+ */
+int ffurl_get_file_handle(URLContext *h);
+
#endif //AVFORMAT_URL_H