Skip to content

encodedstream: Deprecate setActive() and replace with an explicit start()/stop() API

Arjen Hiemstra requested to merge work/ahiemstra/startstop into master
  • encodedstream: Deprecate setActive() and replace with an explicit API

setActive() currently implies starting/stopping the recording process. However, this is somewhat awkward as everything is rather asynchronous with multiple threads involved, which means calling setActive() may mean things are not actually active or may still be active.

To avoid this awkwardness, deprecate setActive() and replace it with an explicit start() and stop() method that are clearly documented to be purely requests, with the real active/inactive state matching the stream state.

This also makes the "Rendering" state more explicit, when "Stop" is called we immediately switch to the "Rendering" state to indicate we may still be processing frames but are no longer receiving new frames.

  • encodedstream: Don't query VAAPI in the constructor

Querying VAAPI is expensive, so we should only do that when necessary. So rather than querying what encoder to use on construction, query it on start and only if we don't already have an encoder set. This also avoids duplicate lookups if the user already set the encoder.

Edited by Arjen Hiemstra

Merge request reports

Loading