[gst-devel] g_signal_connect question...

wanting2learn wanting2learn at hotmail.co.uk
Thu Feb 25 11:22:36 CET 2010


I am woking on a gstreamer project and have a problem.

I have pipeline set up and I have used the following to monitor the data
passing through it:

static void onVideoHandoff( GstElement *object, GstBuffer *buffer, gpointer
user_data )
{
    //blah..blah
}

GstElement *identity = gst_element_factory_make("identity", "identity");
g_signal_connect( identity, "handoff", G_CALLBACK(onVideoHandoff), this);

The problem I'm having is that in my onVideoHandoff(..) function when I get
the size of the 'buffer' (thisPacketSize = GST_BUFFER_SIZE(buffer);)  it is
always the same size no matter what type of video frame is going through the
pipeline. (I would expect it to be smaller for delta frames etc but its
always about 2MB).

I'm thinking that this is because the onVideoHandoff function is called
after the video has been decoded and that the buffer size is always the same
as it is about to be writen on screen.

is this correct??

I think I need to monitor the data when it is going through my decoder
element.

My decoder element is set up like so depending in the type needed:
decoder = gst_element_factory_make("ffdec_mjpeg", "decoder"); OR
decoder = gst_element_factory_make("ffdec_mpeg4", "decoder"); OR
decoder = gst_element_factory_make("ffdec_h264", "decoder"); OR

I'm trying to attach an identity element like above but whatever I have
tried has failed.  I have tried the following:
g_signal_connect (decoder, "new-decoded-pad", G_CALLBACK (cb_newpad),
NULL);....
g_signal_connect( decoder, "handoff", G_CALLBACK(cb_handoff), this)

etc but I do not really know the proper way to do this. (the footprint of
the callback function etc)

Can anyone help me?? 
-- 
View this message in context: http://n4.nabble.com/g-signal-connect-question-tp1568779p1568779.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.




More information about the gstreamer-devel mailing list