GNOME Bugzilla – Bug 788361
audiosink: expose more audioringbuffer vmethods to child sinks
Last modified: 2018-11-03 12:00:19 UTC
The existing reset vmethod is deprecated. The audio sink will fallback to calling reset if pause or stop are not provided and will fallback to calling start if resume is not provided. Existing audio sinks continue to work as before. This change is needed for sinks that need to distinguish between a pause and a stop (currently both are handled by a reset).
This is change is required by https://bugzilla.gnome.org/show_bug.cgi?id=788362
Created attachment 360684 [details] [review] audiosink: expose more audioringbuffer vmethods to child sinks
Created attachment 360810 [details] [review] audiosink: expose more audioringbuffer vmethods to child sinks
Last attached patch exposes clear_all in addition to pause, resume and stop.
Created attachment 360812 [details] [review] directsoundsink: don't reset DirectSoundBuffer when pausing
Created attachment 360814 [details] [review] audiosink: expose more audioringbuffer vmethods to child sinks
Created attachment 360815 [details] [review] audiosink: expose more audioringbuffer vmethods to child sinks
Created attachment 360816 [details] [review] audiosink: expose more audioringbuffer vmethods to child sinks
Created attachment 361026 [details] [review] audiosink: chain up to the ringbuffer clear_all parent implementation
Found a simpler fix for the directsoundsink issue that does not require to expose clear_all. Will submit a new patch soon.
Created attachment 361287 [details] [review] audiosink: expose more audioringbuffer vmethods to child sinks Final patch for now. Has minor cleanups compared to previous one. I kept the new clean_all vmethod. Does not hurt. To summarize this patch: it exposes a bunch of missing ringbuffer vmethods to child classes. Care has been taken to not affect existing audio sinks and to preserve ABI.
Created attachment 372822 [details] [review] Fix resuming after paused Hi Philippe, I took use of your patch to expose the vmethods to child sinks, in my case to alsasink. The vmethods I wanted to expose was the following; pause, resume and stop. Pause worked as expected, however when using resume, I noticed that the audioringbuffer never receives a start signal and is therefore stuck in a waiting state. To solve this I changed in gst_audio_sink_ring_buffer_resume() to always call gst_audio_sink_ring_buffer_start() and thereby a start signal is sent to the audioringbuffer. Best regards, Axel
Hi Axel, Not sure your change is correct. Looks like now, resume will call the resume vmethod (if it exists) and start vmethod (always). This will probably break other audio sinks. You probably want to call start() from the alsasink resume (if that is what alsasink requires/needs). Best regards, Philippe.
From my understanding when paused is triggered, the audioringbuffer is signaled to paused (see gst_audio_ring_buffer_pause_unlocked()). To resume the audioringbuffer gst_audio_sink_ring_buffer_start() have to be called to signal the buffer. The alsasink can not signal the audioringbuffer to start(), due to that it is a child class and have no information about the audioringbuffer. That is why audiosink signals the audioringbuffer to resume/start. Best regards, Axel
It's been a while that I worked on that. What about not implementing resume() in alsasink? Base class will then default to calling start().
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/387.