notes/gstreamer/basesrc-eos.md

1.5 KiB

title
basesrc eos

Decided to look into this issue in the morning.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/227

At first, got side tracked by the comment pointing to src_event . However, when send_event is invoked on the element, src_event isn't where it's received. ElementImpl's send_event is where it comes to. Now, udpsrc is build upon basesrc. Had clearly forgotten how much the base classes hide away. So looking into how EOS is handled by basesrc led down a rabbit hole. The handling of EOS for push and pull mode is different. ts-udpsrc at least right now only supports push mode, which also makes sense considering that it implements asynchronous Task.

Now, scratching head on how much of this should be applicable to ts-udpsrc considering that it doesn't derive from basesrc.

basesrc EOS handling

For example, it's odd that the base_src_loop is triggered again to perform some operation asynchronously. On second thought though, guess it makes sense that what's to be done is done synchronously in send_event. The buffer pool also needs to be set to flushing?

What has to be done can be seen below.

base_src_loop EOS handling

  • Pause task
  • Post segment done message
  • Push event?