Using appsink with GLib asynchronous API
hyperlight
minh at keirton.com
Mon Oct 26 20:25:51 UTC 2020
Sorry the code I used was:
[...]
/* The appsink has received a buffer */
static GstFlowReturn new_sample(GstElement *sink, gpointer *data)
{
GstSample *sample;
/* Retrieve the buffer */
sample = gst_app_sink_pull_sample(GST_APP_SINK(sink));
if (gst_app_sink_is_eos(GST_APP_SINK(sink)))
{
g_print("EOS received in Appsink********\n");
}
if (sample)
{
/* print a * to indicate a received buffer */
g_print("*");
sleep(1);
gst_sample_unref(sample);
return GST_FLOW_OK;
}
return GST_FLOW_ERROR;
}
[...]
int main(int argc, char *argv[])
{
[...]
g_signal_connect(appsink, "new-sample", G_CALLBACK(new_sample), NULL);
[...]
}
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list