Skip to content

basesink, appsink: Add an API to basesink to notify preroll object and unblock pull-preroll on GAP event

Seungha Yang requested to merge seungha.yang/gstreamer:sink-preroll-object into main
    appsink: Unblock pull-preroll on GAP event

    ... and add support for preroll sample with buffer list.

    From application point of view, it's tricky to know that whether
    pipeline is prerolled by buffer/buffer-list or by GAP event.
    Then, if pipeline is prerolled by GAP event but pipeline's state
    is staying in PAUSED, pull-preroll would be blocked forever
    which doesn't seem to very desired behavior.
    basesink: Fix GstBufferList handling

    * It's possible that GstBufferList is being passed to
      gst_base_sink_get_sync_times() if prepare() or prepare_list() is
      implemented by subclass, but we were casting it to GstBuffer always.
    * Pass GstBufferList to the gst_base_sink_do_sync() without modification
      so that we can pass GstBufferList to subclass via preroll_object().
    basesink: Add support for notifying subclass of non-buffer preroll object

    Add a new vfunc GstBaseSinkClass::preroll_object() for subclass
    to be able to handle preroll object even if it's not a GstBuffer
    such as GstBufferList or GAP/EOS events.
Edited by Seungha Yang

Merge request reports