On Fri Jun 30 04:01:30 2023 +0000, Zebediah Figura wrote:
I think the idea here was to detach the stream decodebin if we're outputting compressed samples, and use the same actual sink pad for both compressed and uncompressed cases? Using a probe means that the samples will get fed into the decodebin anyway, which ends up just wasting CPU on decoding.
I tried the unlinking/linking stream decodebin approach. However, it's really complex to implement that, because changing pipeline dynamically needs to consider a lot of stuff (eg. renegotiate caps, seek to restart pipeline, flush previous buffers). Also, buffer loss happens because of the pipeline changes.
Instead, adding a probe is quite simple and easy to implement.
Using a probe means that the samples will get fed into the decodebin anyway, which ends up just wasting CPU on decoding.
We can prevent the buffer from going into stream decodebin by return GST_PAD_PROBE_DROP or GST_PAD_PROBE_HANDLED in probe.