No data from Appsink

Robin Aproskie raproskie at tellumat.com
Mon May 5 13:03:13 PDT 2014


Thanks I thought I was registering a call back . I am not using a main loop as its a live stream . I am using  the cairo draw call back in the same code seperate pipeline and I am running in qt windows 7. The problem is i can't run a main loop as it does not exit so I can not return from my class. So the rest of my code executes . Maybe a little inexperience here.

 Robin


-------- Original message --------
From: Michael Gruner
Date:05/05/2014 21:04 (GMT+02:00)
To: Discussion of the development of and with GStreamer
Subject: Re: No data from Appsink

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


typedef struct
{
float term;
float lonUav;
float groundTrack;
float altitude;
float latTgt;
float lonTgt;
float tgtDistance;
float scale;
float payAzimuth;
float payDepression;
float payLoadFov;
float trueNorth;
short display;
short resolution;
short endStream;
}udpOverlayStruct;

udpOverlayStruct rawOverlayData;

/* The appsink has received a buffer */
void new_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<mailto:gstreamer-devel at lists.freedesktop.org>
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


**********************************************************************
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
**********************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140505/402ec84c/attachment.html>


More information about the gstreamer-devel mailing list