summaryrefslogtreecommitdiff
path: root/libavformat/rtpdec.h
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-02-16 22:50:50 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2010-02-16 22:50:50 +0000
commit9c8fa20d7e60760f117c2123a51137db1ac91682 (patch)
tree1167eca1e68c73f232872ebab1f925d4e0b673e7 /libavformat/rtpdec.h
parentfe74099aee7b2c4f918194c4ed560e244677df7a (diff)
When using RTP-over-UDP, send dummy packets during stream setup, similar to
what e.g. RealPlayer does. This allows proper port forwarding setup in NAT- based environments. Patch by Martin Storsjö <$firstname at $firstname dot st>. Originally committed as revision 21856 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtpdec.h')
-rw-r--r--libavformat/rtpdec.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavformat/rtpdec.h b/libavformat/rtpdec.h
index 1a243f89c8..92d519684f 100644
--- a/libavformat/rtpdec.h
+++ b/libavformat/rtpdec.h
@@ -74,6 +74,19 @@ void rtp_get_file_handles(URLContext *h, int *prtp_fd, int *prtcp_fd);
#endif
/**
+ * Send a dummy packet on both port pairs to set up the connection
+ * state in potential NAT routers, so that we're able to receive
+ * packets.
+ *
+ * Note, this only works if the NAT router doesn't remap ports. This
+ * isn't a standardized procedure, but it works in many cases in practice.
+ *
+ * The same routine is used with RDT too, even if RDT doesn't use normal
+ * RTP packets otherwise.
+ */
+void rtp_send_punch_packets(URLContext* rtp_handle);
+
+/**
* some rtp servers assume client is dead if they don't hear from them...
* so we send a Receiver Report to the provided ByteIO context
* (we don't have access to the rtcp handle from here)