gst_app_sink_pull_buffer takes a long time to get data from a pipeline (about 130ms)

Kalle Vahlman kalle.vahlman at gmail.com
Mon Mar 5 08:30:00 PST 2012


2012/3/1 Aldo Biziak <aldobiziak at gmail.com>:
> Good morning all,
> I'm building a simple C application that use appsink to get buffer of data
> from a pipeline (this last pipeline creates data reading images from a
> webcam 30fps):
> GstBuffer* buf = gst_app_sink_pull_buffer(GST_APP_SINK(sink));
> this function require at least 130ms (7.6fps) of processing time, so I can't
> grab images in real time mode (30fps).
[snip]
> gst_element_set_state(pipeline, GST_STATE_PLAYING);
> #ifdef DEBUG_FRAMERATE
> clock_gettime(CLOCK_REALTIME, &timestamp1);
> #endif
> while(1){
> GstBuffer* buf = gst_app_sink_pull_buffer(GST_APP_SINK(sink));

In the above, you are setting the state and immediately "start the
clock". But do you actually have something that promises you it'll be
running immediately? You might want to make sure with get_state(), as
per the set_state() documentation. Though, that should not affect
later rounds as the timers and counters are reset.

Also, if I read the code right it seems you are actually using 15 as
the framerate in the caps rather than 30 like you say.

-- 
Kalle Vahlman, zuh at iki.fi
Powered by http://movial.com
Interesting stuff at http://sandbox.movial.com


More information about the gstreamer-devel mailing list