Skip to content

Refactor Encoding so it is easier to follow and easier to add different encoder formats

Arjen Hiemstra requested to merge work/ahiemstra/refactor into master

This refactors PipeWireProduce and related code to extract the encoding code into an Encoder class with Encoder-specific subclasses, so that the encoding code is encapsulated and more self contained. It changes the threading in PipeWireProduce to a model where we have three threads, one that we move the PipeWireProduce instance to which handles the incoming frames from PipeWireSourceStream, then two somewhat simpler threads are created, one for pulling things from FFMpeg's filtering pipeline to pass it on to the encoding queue, another to pull things from FFmpeg's encoding pipeline to pass back to PipeWireProduce for handling. We now rely on FFmpeg's internal queues for queuing frames for filtering/encoding rather than maintaining our own.

Merge request reports