After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 768852 - appsink: add _try_pull_{sample,preroll} with timeout parameter
appsink: add _try_pull_{sample,preroll} with timeout parameter
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal enhancement
: 1.9.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-07-15 16:42 UTC by Joan Pau
Modified: 2016-07-18 16:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[appsink] add sample/preroll pull timeout (12.97 KB, patch)
2016-07-15 16:42 UTC, Joan Pau
committed Details | Review

Description Joan Pau 2016-07-15 16:42:08 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.
Comment 1 Tim-Philipp Müller 2016-07-18 16:29:08 UTC
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