GNOME Bugzilla – Bug 768852
appsink: add _try_pull_{sample,preroll} with timeout parameter
Last modified: 2016-07-18 16:31:28 UTC
Created attachment 331603 [details] [review] [appsink] add sample/preroll pull timeout The _pull_sample and _pull_preroll functions block until a sample is available, EOS or the pipeline is not in PLAYING state (returning null in the last two cases). Add similar functions _try_pull_sample and try_pull_preroll with a timeout argument to specify the maximum amount of time to wait for a new sample. To avoid code duplication, wait forever if the timeout GST_CLOCK_TIME_NONE, and use to implement _pull_sample/_pull_preroll with the original behavior. Add also corresponding signal actions try-pull-sample and try-pull-preroll.
Thanks, pushed with minor changes (add Since markers to doc blurbs, add to API docs, decrease padding in header, minor code style change re. 'const gboolean'): commit ffa9f04bb2072c0a257cbb50177dd208b9ea367b Author: Tim-Philipp Müller <tim@centricular.com> Date: Mon Jul 18 17:26:26 2016 +0100 tests: appsink: add minimal test for new pull with timeout functions https://bugzilla.gnome.org/show_bug.cgi?id=768852 commit c6722c06a040a333188793d7f4403dd983c04815 Author: Joan Pau Beltran <joanpau.beltran@socib.cat> Date: Fri Jul 15 13:20:29 2016 +0200 appsink: add _pull_sample/preroll() variants with timeout The _pull_sample() and _pull_preroll() functions block until a sample is available, EOS happens or the pipeline is shut down (returning NULL in the last two cases). This adds _try_pull_sample() and _try_pull_preroll() functions with a timeout argument to specify the maximum amount of time to wait for a new sample. To avoid code duplication, wait forever if the timeout is GST_CLOCK_TIME_NONE and use that to implement _pull_sample/_pull_preroll with the original behavior. Add also corresponding action signals "try-pull-sample" and "try-pull-preroll". https://bugzilla.gnome.org/show_bug.cgi?id=768852