No data from Appsink

Michael Gruner michael.gruner at ridgerun.com
Mon May 5 11:48:33 PDT 2014


Hi Robin,

Signals won't work unless there is a main loop running (or a similar 
listener mechanism). In your app, when you wait for errors or EOS, are 
you waiting on a GMainLoop? If for some reason you can't do so, you 
might want to try registering callbacks to the appsink instead of using 
signals.

Michael

On 05/05/2014 07:51 AM, Robin Aproskie wrote:
> Hi
> I have a simple pipeline as below code shows." udpsrc->appsink "
> I am sending a datagram to the localhost UDP port with the below 
> struct; I am receiving the data as per wireshark; but I do not get the 
> appsink callback to trigger to tell me there is data, do I need 
> another element of do I need to format the datagram with cap. How do I 
> do this? at the moment I just need raw 54 byte struct data.
> Thanks
> Robin
> typedefstruct
> {
> float term;
> floatlonUav;
> floatgroundTrack;
> floataltitude;
> floatlatTgt;
> floatlonTgt;
> floattgtDistance;
> floatscale;
> floatpayAzimuth;
> floatpayDepression;
> floatpayLoadFov;
> floattrueNorth;
> shortdisplay;
> shortresolution;
> shortendStream;
> }udpOverlayStruct;
> udpOverlayStruct rawOverlayData;
> /* The appsink has received a buffer */
> voidnew_buffer (GstElement *app_sink, udpOverlayStruct* data) {
> GstBuffer *buffer;
> udpOverlayStruct *temp = (udpOverlayStruct*)buffer->offset;
> /* Retrieve the buffer */
> g_signal_emit_by_name (app_sink, "pull-buffer", &buffer);
> if(buffer)
> {
> data->altitude = temp->altitude;
> gst_buffer_unref (buffer);
> }
> }
> void main{
>
> gst_init (NULL,NULL);
>
> app_pipeline = gst_pipeline_new ("UDP-pipeline");
> app_sink = gst_element_factory_make ("appsink", "app_sink");
> rawCaps = gst_caps_from_string(NULL);
> g_object_set (app_sink, "emit-signals", 
> TRUE,"blocksize",54,"max-buffers",1, NULL);
> g_signal_connect (app_sink, "new-buffer", G_CALLBACK (new_buffer), 
> &rawOverlayData);
> app_udpsrc = gst_element_factory_make ("udpsrc", NULL);
> g_object_set (G_OBJECT (app_udpsrc), "address", "127.0.0.1", NULL);
> g_object_set (G_OBJECT (app_udpsrc), "port", 2010, NULL);
> gst_bin_add_many (GST_BIN (app_pipeline),app_udpsrc, app_sink,NULL);
> error *= gst_element_link (app_udpsrc, app_sink);
> ret = gst_element_set_state (app_pipeline, GST_STATE_PLAYING);
> if(ret == GST_STATE_CHANGE_FAILURE)
> {
> g_printerr ("Unable to set the pipeline to the playing state.\n");
> gst_object_unref (pipeline);
> }
> }
> /* Wait until error or EOS */
>
> **********************************************************************
> Relevant company disclaimers are available at the following addresses:
>   Tellumat (Pty) Ltd e-mail: 
> mailto:disclaimer at tellumat.com?Subject=Tellumat_Disclaimer
>   Web:  http://www.tellumat.com/email.aspx
> **********************************************************************
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140505/c9d52950/attachment-0001.html>


More information about the gstreamer-devel mailing list