UDP and custom GSockets
debruyn
debruynels1 at gmail.com
Wed Apr 20 08:42:48 UTC 2016
Hi Sebastian,
Thanks for helping, So i can get n source address from creating like a
buffer probe on the udpsrc? Do you know where i can find an example of
buffer probes? Was only successfull yesterday to create event probes.
Also I am trying to create my own socket to give to UDPSrc. Will this work
if i link the source IP address and port, that i set on the UDPSink? This is
my code snippet to link the address (Note the pipeline has been linked and
created before this):
GSocketAddress *bind_addr;
GInetAddress *bind_iaddr;
GSocketFamily family;
guint16 port = 50001;
GError *err = NULL;
bind_iaddr = g_inet_address_new_from_string ("10.15.1.140");
bind_addr = g_inet_socket_address_new (bind_iaddr, port);
g_object_unref (bind_iaddr);
family = g_socket_address_get_family (G_SOCKET_ADDRESS (bind_addr));
GSocket * socketUDP = g_socket_new(family, G_SOCKET_TYPE_DATAGRAM,
G_SOCKET_PROTOCOL_UDP, &err);
if(socketUDP == NULL)
{
debug("Could not create socket: %s", err->message);
g_object_unref (bind_addr);
}
else
{
g_socket_bind (socketUDP, bind_addr, TRUE, &err);
if(err != NULL)
{
debug("Failed to bind socket: %s", err->message);
g_object_unref (bind_addr);
}
else
{
g_object_set (G_OBJECT (gstSource), "socket", socketUDP, NULL);
}
}
g_object_set(gstSource,"port",moProfileInstance->getHostPort(),"caps",gst_caps_new_simple
("application/x-rtp",NULL),NULL);
The Error I am getting says the following => Failed to bind socket: Error
binding to address: Cannot assign requested address.
What worries me is that i get the same error when trying to set the address
property of udpsrc ,in the commandline (using gst-launch-1.0) using any
other address other than multicast addresses.
Thanks for the help I really appreciate it.
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/UDP-and-custom-GSockets-tp4677008p4677014.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list