Lauraire wrote
Anyone about this topic.... I am still looking for a solution... :/
I must miss something obvious but what...? I receive the signal from appsink
"new-buffer" and call the g_signal_emit_by_name (app->appsink,
"pull-buffer", gstBuffer, &ret) method that returns an unusable gstBuffer :
it causes a segfault when I try to manipulate it.... data seems to be
NULL....??
Any help appreciated!
I'm not really understanding why you'd want to emit a "pull-buffer" signal back to the app-sink when it receives the "new-buffer" signal.
I just use this pretty much straight from the appsink examples (limited as they are) to get the data:
/* get the buffer from appsink */
buffer = gst_app_sink_pull_buffer (GST_APP_SINK (elt));
/* turn it into an app buffer, it's not really needed, we could simply push
* the retrieved buffer from appsink into appsrc just fine. */
size = GST_BUFFER_SIZE (buffer);
//g_print ("Pushing a buffer of size %d\n", size);
raw_buffer = g_malloc0 (size);
memcpy (raw_buffer, GST_BUFFER_DATA (buffer), size);
app_buffer = gst_app_buffer_new (raw_buffer, size, g_free, raw_buffer);
/* newer basesrc will set caps for use automatically but it does not really
hurt to set it on the buffer again */
gst_buffer_set_caps (app_buffer, GST_BUFFER_CAPS (buffer));
and then push the buffers to my view and recording pipelines:
gst_app_src_push_buffer (GST_APP_SRC(data->vappsrc), app_buffer);
gst_app_src_push_buffer (GST_APP_SRC(data->rappsrc), buffer);
Seems to work OK but I'm having problems dynamically building my appsink pipeline (to deal with lame hardware and v4l2 drivers) to force a desired format at the appsink (so I can manipulate the video image data) where gst_element_link_filtered() succeeds but the the pipeline errors out with "internal data error" when run.