Simplify GStreamer codecs by unifying members and functions used for encoding and decoding. If both are required two
gst_info objects can be created, without the possibility for typos to ruin the other pipeline.
The encoding and decoding pipeline are essentially identical: both push
data in via an
appsrc, route it through a codec-specific (opaque)
element, and finally pull data out of an
appsink. The code already makes
it impossible to have an encoding and decoding pipeline simultaneously
set up in
gst_info, and converting
bool for_encoding to a tri-state
(encode, decode, or both) would be messy; particularly when encoding and
decoding could possibly differ in format.
This change removes a swath of code and removes the possibility of
dec_ in the wrong place (ie. after copying a bit of
code and forgetting to rename one or two). When bidirectional codecs
come online a second codec instance (
gst_info) can simply be created
and controlled independently.
As always, a branch with the changes applied to AAC is available: https://gitlab.freedesktop.org/MarijnS95/pulseaudio/-/commits/gst-aac