]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpproto.c
yop: initialize palette to 0
[ffmpeg] / libavformat / rtpproto.c
index e70b89ec9e85d023198d59e84872c13b2dd0af77..190dff4bd2239e1da4862a139521e74002497bb1 100644 (file)
@@ -40,9 +40,6 @@
 #include <sys/poll.h>
 #endif
 
-#define RTP_TX_BUF_SIZE  (64 * 1024)
-#define RTP_RX_BUF_SIZE  (128 * 1024)
-
 typedef struct RTPContext {
     URLContext *rtp_hd, *rtcp_hd;
     int rtp_fd, rtcp_fd;
@@ -315,18 +312,27 @@ static int rtp_get_file_handle(URLContext *h)
     return s->rtp_fd;
 }
 
-int ff_rtp_get_rtcp_file_handle(URLContext *h) {
+static int rtp_get_multi_file_handle(URLContext *h, int **handles,
+                                     int *numhandles)
+{
     RTPContext *s = h->priv_data;
-    return s->rtcp_fd;
+    int *hs       = *handles = av_malloc(sizeof(**handles) * 2);
+    if (!hs)
+        return AVERROR(ENOMEM);
+    hs[0] = s->rtp_fd;
+    hs[1] = s->rtcp_fd;
+    *numhandles = 2;
+    return 0;
 }
 
 URLProtocol ff_rtp_protocol = {
-    .name                = "rtp",
-    .url_open            = rtp_open,
-    .url_read            = rtp_read,
-    .url_write           = rtp_write,
-    .url_close           = rtp_close,
-    .url_get_file_handle = rtp_get_file_handle,
-    .priv_data_size      = sizeof(RTPContext),
-    .flags               = URL_PROTOCOL_FLAG_NETWORK,
+    .name                      = "rtp",
+    .url_open                  = rtp_open,
+    .url_read                  = rtp_read,
+    .url_write                 = rtp_write,
+    .url_close                 = rtp_close,
+    .url_get_file_handle       = rtp_get_file_handle,
+    .url_get_multi_file_handle = rtp_get_multi_file_handle,
+    .priv_data_size            = sizeof(RTPContext),
+    .flags                     = URL_PROTOCOL_FLAG_NETWORK,
 };