"client-added" signal issue from tcpserversink with Android SDK gstreamer 1.2

stic at free.fr stic at free.fr
Tue Oct 29 10:31:11 CET 2013


ohh ok great ! thank you for the information.

----- Mail original -----
De: "Sebastian Dröge" <sebastian at centricular.com>
À: "Discussions about GStreamer on Android" <gstreamer-android at lists.freedesktop.org>
Envoyé: Mardi 29 Octobre 2013 09:53:12
Objet: Re: "client-added" signal issue from tcpserversink with Android SDK	gstreamer 1.2

On Mo, 2013-10-28 at 16:32 +0100, stic at free.fr wrote:
> Hello,
> 
> I migrated a program for Android from gstreamer version 0.1 to 1.2 but I still have an issue for which I cannot find a workaround.
> I am receiving "client-added" signal from a tcpserversink, to get the client ip address, where fd is the file description returned by signal.
> Following code was working fine with gstreamer 0.1, but does not work anymore with gstreamer 1.2, as the printed ip address is 0.0.0.0:
> 
>   struct sockaddr_in client_address;
>   socklen_t client_address_len;
>   client_address_len = sizeof client_address;
>   gint peer = getpeername(fd, (struct sockaddr*)&client_address, &client_address_len);
>   gchar *message = g_strdup_printf("New client added -> %s", inet_ntoa (client_address.sin_addr));
> 
> I also tried to use directly a struct sockaddr instead of sockaddr_in but without any success, in that case the printed ip address contains wrong values.
> 
> Do you have any idea of why it does not work anymore ?

You get a GSocket* passed in the client-added signal now, not a fd. You
can get the IP address or any other information you want via the GSocket
API.

-- 
Sebastian Dröge <sebastian at centricular.com>
Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source

_______________________________________________
gstreamer-android mailing list
gstreamer-android at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/gstreamer-android


More information about the gstreamer-android mailing list