Skip to content

Child clock improvements#4637

Open
toots wants to merge 1 commit intomainfrom
permanent-on-child-tick
Open

Child clock improvements#4637
toots wants to merge 1 commit intomainfrom
permanent-on-child-tick

Conversation

@toots
Copy link
Member

@toots toots commented Aug 19, 2025

Description

This PR simplifies the handling of sub-clocks and sources belonging to sub clocks.

Generally, the way to handle sub-clocks become strictly through ticking the subclocks.

All sources associated with that clock will then be animated.

If a source is declared as a child source of interest, it is wrapped into an output and that output populates a buffer.

This allows multiple operators to read data from sub-source belonging to a subclock: if the clock needs to be ticked when the operator needs data, it is ticked and all the data generated during the tick is stored in a buffer.

Then, if another operator also needs data from a source inside that clock, if the clock has been ticked and some data was generated, then it can access that data without the need to tick the clock again.

Example

Drawing

In this example, two inline encoders consume from different sources of the child clock.

When the main clock ticks, ffmpeg.encode.audio 1 can tick the child clock first, generating a fresh round of data for playlist, single and add.

Then, ffmpeg.encode.audio 2 can take the data buffered from the child tick generated by ffmpeg.encode.audio 1 and proceed without having to also tick the child clock.

Changes

Operating this way, the old Child_support and Producer_consumer APIs are merged into a single one. Also, Child_support now applies to a single source since all sources are now wrapped into their own output.

Lastly, a warning is issued when too much data accumulates in the child buffers.

@toots toots changed the base branch from main to main-clock August 19, 2025 15:50
@toots toots force-pushed the permanent-on-child-tick branch from ec4d14c to b98472b Compare August 19, 2025 15:52
Base automatically changed from main-clock to main August 19, 2025 17:00
@toots toots force-pushed the permanent-on-child-tick branch 5 times, most recently from a1635c2 to 30262aa Compare August 20, 2025 14:17
@toots toots marked this pull request as ready for review August 20, 2025 14:58
@toots toots force-pushed the permanent-on-child-tick branch 3 times, most recently from 09076b5 to edd08f5 Compare August 20, 2025 20:40
@toots toots marked this pull request as draft August 20, 2025 20:42
@toots toots force-pushed the permanent-on-child-tick branch 6 times, most recently from 624ab0e to c85b5df Compare August 22, 2025 01:24
@toots toots force-pushed the permanent-on-child-tick branch from c85b5df to 5407553 Compare September 3, 2025 13:00
@toots toots marked this pull request as ready for review September 3, 2025 13:47
@toots toots force-pushed the permanent-on-child-tick branch from df3bb9a to 194e809 Compare October 10, 2025 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant