Introduce a fallback mechanism for gstreamer pipelines that allows to define multiple pipelines and prefer them over each other.
The way this works is that we introduce a new STARTING PipelineState. During the Recorder is in that state, it is allowed to tear down the current pipeline and start another one whenever an error happens.
With this we now have five gstreamer pipelines:
-
A vaapi h264 pipeline that runs completely on the dedicated hardware, including vaapi-preprocessing to convert to the right color format. Together with dmabuf sharing of buffers and reusing the actual buffers from the monitor, this allows for excellent performance with almost no extra CPU usage.
-
A nvenc h264 pipeline to make use of the encoding hardware on nvidia graphics cards. Since nvh264enc can't handle our BGRx color format, we need to run videoconvert on the CPU before passing it to the hw encoder.
-
An x264enc pipeline that uses the popular x264 encoder. Very stable and very fast, it does have patent issues though and is not available in the official Fedora repos.
-
An openh264 pipeline using the openh264 encoder provided by Cisco. Still pretty fast (enough for 60fps recording in real time on newer machines). Also not in the official repos, but very easy to install on Fedora via gnome-software.
-
And the existing vp8 pipeline. Not very fast, but also good enough for 30 fps on most setups. Has the benefit of being available by default almost everywhere.
WIP because this depends on !2609.