GNOME Bugzilla – Bug 670130
udpsink: add "src-port" property to force UDP source port
Last modified: 2013-08-21 19:14:21 UTC
Created attachment 207618 [details] [review] patch 1/2 Allowing to force the UDP source port allows passing through restrictive firewalls e.g. network A --> GST --> FW A ---...---> FW B --> GST --> network B Enabling this option allows to use GST to tunnel the data over unicast through the firewalls. Note that the src-port needs to be set before other options to avoid autobinding of the socket to a random port.
Created attachment 207619 [details] [review] patch 2/2
Is the second patch on top of the first? I don't think it's a good idea to fall back to a random port if the port requested cannot be bound (second patch). First patch looks good.
Yes, the second patch is on top of the first one. From what I read; a socket is unusable once you try to bind to a wrong source port; hence the fall back to dynamic. But simply failing could also work; the fallback can also be handled from the application or higher level bins.
In GStreamer 0.10, the property "sockfd" can be used with udpsink to pass a file descriptor from a socket previously allocated which could bind on a specific port. In Gstreamer 1.0, the property "socket" can be used in the same goal to pass a GSocket instance which would bind on a specific port. Then, it might be more straightforward to use a "src-port" property and not to have to instantiate the socket itself.
There's a "bind-port" and "bind-address" property for this now.