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 790114 - decklinkaudiosink: Re-implement around GstBaseSink instead of GstAudioBaseSink
decklinkaudiosink: Re-implement around GstBaseSink instead of GstAudioBaseSink
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other All
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-11-09 10:50 UTC by Sebastian Dröge (slomo)
Modified: 2017-12-14 08:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
decklinkaudiosink: Re-implement around GstBaseSink instead of GstAudioBaseSink (52.15 KB, patch)
2017-11-09 10:50 UTC, Sebastian Dröge (slomo)
none Details | Review
decklinkaudiosink: Re-implement around GstBaseSink instead of GstAudioBaseSink (52.22 KB, patch)
2017-11-09 10:52 UTC, Sebastian Dröge (slomo)
none Details | Review
decklinkaudiosink: Re-implement around GstBaseSink instead of GstAudioBaseSink (52.18 KB, patch)
2017-11-22 14:39 UTC, Sebastian Dröge (slomo)
none Details | Review
decklinkaudio/videosink: Wait until scheduled playback is actually stopped before continuing (6.49 KB, patch)
2017-11-22 14:39 UTC, Sebastian Dröge (slomo)
none Details | Review
decklinkaudiosink: Start audio pre-rolling if the output is not started yet in render() (4.23 KB, patch)
2017-11-22 14:39 UTC, Sebastian Dröge (slomo)
none Details | Review
decklinkaudiosink: Implement resampling/buffer reversing for trick-modes (8.71 KB, patch)
2017-11-22 14:39 UTC, Sebastian Dröge (slomo)
none Details | Review
decklinkaudiosink: Implement resampling/buffer reversing for trick-modes (8.71 KB, patch)
2017-11-22 14:43 UTC, Sebastian Dröge (slomo)
none Details | Review
decklinkaudiosink: Implement resampling/buffer reversing for trick-modes (8.62 KB, patch)
2017-11-22 14:44 UTC, Sebastian Dröge (slomo)
none Details | Review
decklinkaudiosink: Don't return FLUSHING when we're stopping (5.08 KB, patch)
2017-11-27 15:46 UTC, Sebastian Dröge (slomo)
none Details | Review
decklinkaudiosink: Check also against the clock if we run ahead of the clock too much (2.52 KB, patch)
2017-11-27 15:46 UTC, Sebastian Dröge (slomo)
none Details | Review
decklinkvideosink: Wait until scheduled playback is actually stopped before continuing (3.58 KB, patch)
2017-11-29 09:54 UTC, Sebastian Dröge (slomo)
committed Details | Review
decklinkaudiosink: Re-implement around GstBaseSink instead of GstAudioBaseSink (52.32 KB, patch)
2017-11-29 09:55 UTC, Sebastian Dröge (slomo)
none Details | Review
decklinkaudiosink: Start audio pre-rolling if the output is not started yet in render() (4.10 KB, patch)
2017-11-29 09:55 UTC, Sebastian Dröge (slomo)
none Details | Review
decklinkaudiosink: Implement resampling/buffer reversing for trick-modes (8.63 KB, patch)
2017-11-29 09:55 UTC, Sebastian Dröge (slomo)
none Details | Review
decklinkaudiosink: Check also against the clock if we run ahead of the clock too much (3.91 KB, patch)
2017-11-29 09:55 UTC, Sebastian Dröge (slomo)
none Details | Review
decklinkaudiosink: Re-implement around GstBaseSink instead of GstAudioBaseSink (52.32 KB, patch)
2017-12-06 18:03 UTC, Sebastian Dröge (slomo)
committed Details | Review
decklinkaudiosink: Implement resampling/buffer reversing for trick-modes (9.40 KB, patch)
2017-12-06 18:04 UTC, Sebastian Dröge (slomo)
committed Details | Review
decklinkaudiosink: Check also against the clock if we run ahead of the clock too much (3.58 KB, patch)
2017-12-06 18:04 UTC, Sebastian Dröge (slomo)
committed Details | Review
decklinkaudiosink: Include final flow return in debug output (880 bytes, patch)
2017-12-06 18:04 UTC, Sebastian Dröge (slomo)
committed Details | Review
decklinkaudiosink: Start audio pre-rolling if the output is not started yet in render() (4.79 KB, patch)
2017-12-06 18:04 UTC, Sebastian Dröge (slomo)
committed Details | Review
decklinkvideosink: Only start if both sinks are set to PLAYING already (8.42 KB, patch)
2017-12-06 18:38 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2017-11-09 10:50:34 UTC
Putting this here for review and comments and questions for now. See commit
message for (known) TODO items.
Comment 1 Sebastian Dröge (slomo) 2017-11-09 10:50:38 UTC
Created attachment 363286 [details] [review]
decklinkaudiosink: Re-implement around GstBaseSink instead of GstAudioBaseSink

The Decklink and GstAudioBaseSink APIs don't fit very well together,
which causes various problems due to inaccuracies in the clock
calculations and the actual ringbuffer and GStreamer's copy getting of
sync.

Problems are audio drop-outs and A/V sync getting wrong after
pausing/seeking.

TODO:
- Trick mode support (resampling)
Comment 2 Sebastian Dröge (slomo) 2017-11-09 10:52:03 UTC
Created attachment 363287 [details] [review]
decklinkaudiosink: Re-implement around GstBaseSink instead of GstAudioBaseSink

The Decklink and GstAudioBaseSink APIs don't fit very well together,
which causes various problems due to inaccuracies in the clock
calculations and the actual ringbuffer and GStreamer's copy getting of
sync.

Problems are audio drop-outs and A/V sync getting wrong after
pausing/seeking.

TODO:
- Trick mode support (resampling)
- Replay after pause
Comment 3 Sebastian Dröge (slomo) 2017-11-22 14:39:05 UTC
Created attachment 364192 [details] [review]
decklinkaudiosink: Re-implement around GstBaseSink instead of GstAudioBaseSink

The Decklink and GstAudioBaseSink APIs don't fit very well together,
which causes various problems due to inaccuracies in the clock
calculations and the actual ringbuffer and GStreamer's copy getting of
sync.

Problems are audio drop-outs and A/V sync getting wrong after
pausing/seeking.
Comment 4 Sebastian Dröge (slomo) 2017-11-22 14:39:11 UTC
Created attachment 364193 [details] [review]
decklinkaudio/videosink: Wait until scheduled playback is actually stopped before continuing

Otherwise we might "start" again, just to get finally stopped and then
getting errors all over the place.
Comment 5 Sebastian Dröge (slomo) 2017-11-22 14:39:16 UTC
Created attachment 364194 [details] [review]
decklinkaudiosink: Start audio pre-rolling if the output is not started yet in render()

This seems to allow to schedule audio samples correctly at their right
times already.
Comment 6 Sebastian Dröge (slomo) 2017-11-22 14:39:22 UTC
Created attachment 364195 [details] [review]
decklinkaudiosink: Implement resampling/buffer reversing for trick-modes
Comment 7 Sebastian Dröge (slomo) 2017-11-22 14:43:33 UTC
Created attachment 364196 [details] [review]
decklinkaudiosink: Implement resampling/buffer reversing for trick-modes
Comment 8 Sebastian Dröge (slomo) 2017-11-22 14:44:34 UTC
Created attachment 364197 [details] [review]
decklinkaudiosink: Implement resampling/buffer reversing for trick-modes
Comment 9 Sebastian Dröge (slomo) 2017-11-27 15:46:24 UTC
Created attachment 364510 [details] [review]
decklinkaudiosink: Don't return FLUSHING when we're stopping

Otherwise we might return FLUSHING while pausing, which is less than
ideal. Instead check basesink's flushing flag only.
Comment 10 Sebastian Dröge (slomo) 2017-11-27 15:46:29 UTC
Created attachment 364511 [details] [review]
decklinkaudiosink: Check also against the clock if we run ahead of the clock too much

The buffer level as reported by the Decklink driver is completely
unreliable, and we could otherwise easily run ahead >1s if we're
unlucky.
Comment 11 Sebastian Dröge (slomo) 2017-11-29 09:54:57 UTC
Created attachment 364608 [details] [review]
decklinkvideosink: Wait until scheduled playback is actually stopped before continuing

Otherwise we might "start" again, just to get finally stopped and then
getting errors all over the place.
Comment 12 Sebastian Dröge (slomo) 2017-11-29 09:55:03 UTC
Created attachment 364609 [details] [review]
decklinkaudiosink: Re-implement around GstBaseSink instead of GstAudioBaseSink

The Decklink and GstAudioBaseSink APIs don't fit very well together,
which causes various problems due to inaccuracies in the clock
calculations and the actual ringbuffer and GStreamer's copy getting of
sync.

Problems are audio drop-outs and A/V sync getting wrong after
pausing/seeking.
Comment 13 Sebastian Dröge (slomo) 2017-11-29 09:55:09 UTC
Created attachment 364610 [details] [review]
decklinkaudiosink: Start audio pre-rolling if the output is not started yet in render()

This seems to allow to schedule audio samples correctly at their right
times already.
Comment 14 Sebastian Dröge (slomo) 2017-11-29 09:55:15 UTC
Created attachment 364611 [details] [review]
decklinkaudiosink: Implement resampling/buffer reversing for trick-modes
Comment 15 Sebastian Dröge (slomo) 2017-11-29 09:55:20 UTC
Created attachment 364612 [details] [review]
decklinkaudiosink: Check also against the clock if we run ahead of the clock too much

The buffer level as reported by the Decklink driver is completely
unreliable, and we could otherwise easily run ahead >1s if we're
unlucky.
Comment 16 Sebastian Dröge (slomo) 2017-12-06 18:03:55 UTC
Created attachment 365131 [details] [review]
decklinkaudiosink: Re-implement around GstBaseSink instead of GstAudioBaseSink

The Decklink and GstAudioBaseSink APIs don't fit very well together,
which causes various problems due to inaccuracies in the clock
calculations and the actual ringbuffer and GStreamer's copy getting of
sync.

Problems are audio drop-outs and A/V sync getting wrong after
pausing/seeking.
Comment 17 Sebastian Dröge (slomo) 2017-12-06 18:04:01 UTC
Created attachment 365132 [details] [review]
decklinkaudiosink: Implement resampling/buffer reversing for trick-modes
Comment 18 Sebastian Dröge (slomo) 2017-12-06 18:04:07 UTC
Created attachment 365133 [details] [review]
decklinkaudiosink: Check also against the clock if we run ahead of the clock too much

The buffer level as reported by the Decklink driver is completely
unreliable, and we could otherwise easily run ahead >1s if we're
unlucky.
Comment 19 Sebastian Dröge (slomo) 2017-12-06 18:04:13 UTC
Created attachment 365134 [details] [review]
decklinkaudiosink: Include final flow return in debug output
Comment 20 Sebastian Dröge (slomo) 2017-12-06 18:04:19 UTC
Created attachment 365135 [details] [review]
decklinkaudiosink: Start audio pre-rolling if the output is not started yet in render()

This seems to allow to schedule audio samples correctly at their right
times already.
Comment 21 Sebastian Dröge (slomo) 2017-12-06 18:38:40 UTC
Created attachment 365137 [details] [review]
decklinkvideosink: Only start if both sinks are set to PLAYING already

Not only if the video sink is set to PLAYING so far. Also give more
useful debug output about why we don't start, and don't start if already
started.

Also refactor the function to early-return instead of having a huge
if-else block over the whole function.
Comment 22 Sebastian Dröge (slomo) 2017-12-14 08:37:34 UTC
Attachment 365131 [details] pushed as 86888d9 - decklinkaudiosink: Re-implement around GstBaseSink instead of GstAudioBaseSink
Attachment 365132 [details] pushed as 118b296 - decklinkaudiosink: Implement resampling/buffer reversing for trick-modes
Attachment 365133 [details] pushed as 3e70f00 - decklinkaudiosink: Check also against the clock if we run ahead of the clock too much
Attachment 365134 [details] pushed as a38cf7d - decklinkaudiosink: Include final flow return in debug output
Attachment 365135 [details] pushed as 2b8f82f - decklinkaudiosink: Start audio pre-rolling if the output is not started yet in render()
Attachment 365137 [details] pushed as 0116497 - decklinkvideosink: Only start if both sinks are set to PLAYING already