membraneframework / membrane_core

The core of the Membrane Framework, advanced multimedia processing framework
https://membrane.stream
Apache License 2.0
1.22k stars 34 forks source link

Bin internal pads linking fails if setup of any of its children takes too long #786

Closed varsill closed 2 weeks ago

varsill commented 2 months ago

Consider the following scenario: 1) There is a pipeline that spawns a bin, with bin's external pads being linked immediately 2) In the bin, on handle_init, an element is spawned, which setup (for instance: duration of handle_setup) takes a long time (more than 5 seconds) 3) The bin goes to the setup: :complete mode and starts linking of its pads, which results in linking the pads externally and starting the 5000ms timeout to let the bin's children link 4) Because internal linking of the bin pads won't happen before all the bin's elements are after the setup, the linking fails after the 5000ms timeout

Possible solutions:

FelonEkonom commented 1 month ago

After merging https://github.com/membraneframework/membrane_core/pull/801 this issue will be solved by returning setup: :incomplete from handle_setup/2 and setup: :complete from a proper handle_child_setup_completed/3