vaapioverlay: ensure sinkpad has current buffer
authorU. Artie Eoff <ullysses.a.eoff@intel.com>
Tue, 14 Jan 2020 19:17:49 +0000 (11:17 -0800)
committerU. Artie Eoff <ullysses.a.eoff@intel.com>
Tue, 14 Jan 2020 19:37:22 +0000 (11:37 -0800)
commit1364070eca040306ea42bfdd59d09c80022d166a
treeabe956d070104dc391ee74aedfe010ebd8315b90
parent889fac3823cc4f6ab5923a71d3e56d25f17df52e
vaapioverlay: ensure sinkpad has current buffer

Use the gst_video_aggregator_pad_has_current_buffer API
to check if the current sinkpad has a queued buffer before
attempting to obtain a input buffer from the base plugin.
If the sinkpad does not have a current buffer, then it is
either not producing them yet (e.g. current time < sinkpad
start time) or it has reached EOS.

Previously, we only handled EOS case.

Example:

 gst-launch-1.0 videotestsrc num-buffers=100 \
  ! vaapipostproc ! vaapioverlay name=overlay \
  ! vaapisink videotestsrc timestamp-offset=1000000000 \
  num-buffers=100 ! video/x-raw,width=160,height=120 \
  ! overlay.
gst/vaapi/gstvaapioverlay.c