Skip to content

encodedstream: Replace setActive() with an explicit start()/stop() API

Arjen Hiemstra requested to merge work/ahiemstra/startstop into master
  • encodedstream: Replace setActive() with an explicit start()/stop() 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, remove 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.

  • Disable pedantic warnings when including pipewire headers

Pipewire headers include a bunch of stuff that's not strictly valid C++ so we get a lot of warnings that we can do nothing with, that obscure actually relevant information. So disable those warnings when including Pipewire stuff.

Note that this currently includes !173 without which the change to API does not make that much sense. I'll rebase it to master once that is merged.

Edited by Arjen Hiemstra

Merge request reports