How can i get rtpbin

Sebastian Dröge sebastian at centricular.com
Sun Nov 15 23:26:09 PST 2015


On Fr, 2015-11-13 at 17:24 -0800, Bob Huang wrote:
> Hi  Sebastian, thank you for your reply.
> 
> Yes, it works. Then I add code like below:
> void static new_manager (GstElement *rtspsrc, GstElement *manager,
> gpointer
> data){ 
>     GST_DEBUG ("new_manager has been created.\n"); 
> 
>     gchar *test; 
>     test = gst_element_get_name(manager); 
>     GST_DEBUG ("GstElement name:%s\n", test); 
>     g_free(test); 
> 
>    g_signal_connect (manager, "get-internal-session",
> (GCallback)(get_internal_session), NULL);
> } 
> 
> static void get_internal_session(GstElement *rtpbin, guint id,
> gpointer  
> user_data){
>     g_print ("get_internal_session has been created.\n");
>     g_print ("session id:%d\n", id);
> }
> The problem : in function "get_internal_session" the *id* always is
> 0! I want to get the session ID, how can I get it right?

The "get-internal-session" signal is an action signal. You don't
connect to it, you emit it and use it as if it's a function call.

Take a look at the C examples in
  gst-plugins-good/tests/examples/rtp/

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20151116/0f312322/attachment.sig>


More information about the gstreamer-devel mailing list