[gst-devel] Error handing in custom plugin

AlannY alanny at starlink.ru
Fri Apr 11 09:10:19 CEST 2008


Hi there, my name is Alan and I have a problems with GStreamer.

I'm writing a custom plugin (still newbie) and I need some error 
handling, but I really not understand how to do it. In the _chain() 
function I have statement:

int ret = gst_pad_push (filter->srcpad, buffer);

When running ret is -5 which means GST_FLOW_ERROR. How to determine 
where error occurred? What GST_FLOW_ERROR means.

(example code)
static GstFlowReturn
gst_myplugin_chain (GstPad *pad,
                   GstBuffer *buf)
{
   Gstmyplugin *plugin = GST_MYPLUGIN (GST_OBJECT_PARENT (pad));

   GstBuffer *buffer;
   gst_pad_alloc_buffer_and_set_caps (plugin->srcpad, 
GST_BUFFER_OFFSET_NONE, plugin->width*plugin->height*3, GST_PAD_CAPS 
(pad), &buffer);
   gst_buffer_copy_metadata(buffer, buf, GST_BUFFER_COPY_ALL);
   memcpy(buffer->data, buf->data, buf->size);

   int ret = gst_pad_push (plugin->srcpad, buffer);
   g_print("%d\n", ret);
   return ret;
}

Thank you.




More information about the gstreamer-devel mailing list