Unable to get the sample from Appsink using C++

RK29 giri_2984 at yahoo.co.in
Fri Aug 21 20:54:13 UTC 2020


     
It was the caps that was causing issues: I removed the caps. I am struggling
with this now:
1)Please let me know how to implement the caps before the appsink?
2)static GstFlowReturn new_sample1(GstAppSink* appsink, gpointer data) {
only triggers once. I want to keep getting the samples continuously.

  GstElement* appSink = gst_element_factory_make("appsink", NULL);
        gst_app_sink_set_emit_signals((GstAppSink*)appSink, true);
        gst_app_sink_set_drop((GstAppSink*)appSink, true);
        gst_app_sink_set_max_buffers((GstAppSink*)appSink, 3000);				//
Limit the number of buffers the appsink can store if we don't take anything
from it
        GstAppSinkCallbacks callbacks = { NULL, NULL, new_sample1 };	//
These are the functions called when we get a new preroll (new_preroll) and a
new buffer/image (new_sample)
        gst_app_sink_set_callbacks(GST_APP_SINK(appSink), &callbacks, pipe,
NULL); // 'data' is just some user data sent to the callback so you can
update your own data, if needed
        gst_element_sync_state_with_parent(appSink);
        gst_bin_add_many(GST_BIN(pipe), q, conv, scale, appSink, NULL);
        gst_element_sync_state_with_parent(q);
        gst_element_sync_state_with_parent(conv);
        gst_element_sync_state_with_parent(scale);
        gst_element_sync_state_with_parent(sink);
        gst_element_sync_state_with_parent(appSink);
        gst_element_link_many(q, conv, scale, appSink, NULL);



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list