/*
* RTP network protocol
- * Copyright (c) 2002 Fabrice Bellard.
+ * Copyright (c) 2002 Fabrice Bellard
*
* This file is part of FFmpeg.
*
*/
/**
- * @file rtpproto.c
+ * @file libavformat/rtpproto.c
* RTP protocol
*/
#include "network.h"
#include "os_support.h"
#include <fcntl.h>
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
#define RTP_TX_BUF_SIZE (64 * 1024)
#define RTP_RX_BUF_SIZE (128 * 1024)
/* 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;
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.
*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",
rtp_write,
NULL, /* seek */
rtp_close,
+ .url_get_file_handle = rtp_get_file_handle,
};