Commit graph

7 commits

Author SHA1 Message Date
Guillaume Desmottes 351f070c8e utils/streamproducer: reset callbacks when removing consumer 2022-05-12 14:56:55 +02:00
Sebastian Dröge 98cc289bcc utils/streamproducer: Add StreamProducer::error() to signal an error message to all consumers 2022-05-12 10:51:56 +03:00
Sebastian Dröge e263bd8945 utils/streamproducer: Request keyframes without a lock held and also after an appsrc has dropped some data 2022-05-12 10:44:59 +03:00
Sebastian Dröge d6095900e9 utils/streamproducer: Improve debug output a bit 2022-05-12 10:37:14 +03:00
Sebastian Dröge e82d388410 utils/streamproducer: Index hashmap by appsrc instance instead of pointer
This behaves the same but requires a little bit less code.
2022-05-12 10:34:11 +03:00
Sebastian Dröge a51235048d utils/streamproducer: Add StreamProducer::configure_consumer()
This allows configuring an `appsrc` before actually adding it as
consumer at a later time, and can be useful if the pipeline with the
source should be started earlier than adding it to a consumer.

Also use strongly-typed property API for the `appsrc` properties.
2022-05-12 10:34:06 +03:00
Thibault Saunier f3bba21faa Introduce StreamProducer
Introduce a new `gstreamer-utils` crate where we implement a
`StreamProducer` structure that allows "producing" pipeline (Producers)
pushing their data to 0 or several "consuming" pipelines. The Producer
needs to push their data to an `appsink` which the `StreamProducer` controls
and the "consumer" pipelines need to have an AppSrc which the same
StreamProducer controls.

It allows similare behavior as a `tee` element but with a simpler to
handle addition and removal of "consumers" as well as a total decoupling
of the various consumer, both between each others and the producer
pipeline.

This has simply been extracted from
[webrtcsink](https://github.com/centricular/webrtcsink/blob/main/plugins/src/webrtcsink/utils.rs)
2022-05-11 10:14:54 -04:00