No data from Appsink

Robin Aproskie raproskie at tellumat.com
Mon May 5 06:51:11 PDT 2014


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


More information about the gstreamer-devel mailing list