mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-09-03 02:13:49 +00:00
streamproducer: Only configure the appsrc once when creating the ConsumptionLink
Otherwise the application has no way to reconfigure any properties as they might get reset on the next re-link again. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1705>
This commit is contained in:
parent
10b66eda23
commit
95f903b2d4
1 changed files with 8 additions and 1 deletions
|
@ -125,6 +125,8 @@ pub struct ConsumptionLink {
|
||||||
impl ConsumptionLink {
|
impl ConsumptionLink {
|
||||||
/// Create a new disconnected `ConsumptionLink`.
|
/// Create a new disconnected `ConsumptionLink`.
|
||||||
pub fn disconnected(consumer: gst_app::AppSrc) -> ConsumptionLink {
|
pub fn disconnected(consumer: gst_app::AppSrc) -> ConsumptionLink {
|
||||||
|
StreamProducer::configure_consumer(&consumer);
|
||||||
|
|
||||||
ConsumptionLink {
|
ConsumptionLink {
|
||||||
consumer,
|
consumer,
|
||||||
producer: None,
|
producer: None,
|
||||||
|
@ -148,6 +150,7 @@ impl ConsumptionLink {
|
||||||
}
|
}
|
||||||
new_producer.add_consumer_internal(
|
new_producer.add_consumer_internal(
|
||||||
&self.consumer,
|
&self.consumer,
|
||||||
|
false,
|
||||||
self.dropped.clone(),
|
self.dropped.clone(),
|
||||||
self.pushed.clone(),
|
self.pushed.clone(),
|
||||||
self.discard.clone(),
|
self.discard.clone(),
|
||||||
|
@ -247,6 +250,7 @@ impl StreamProducer {
|
||||||
|
|
||||||
self.add_consumer_internal(
|
self.add_consumer_internal(
|
||||||
consumer,
|
consumer,
|
||||||
|
true,
|
||||||
dropped.clone(),
|
dropped.clone(),
|
||||||
pushed.clone(),
|
pushed.clone(),
|
||||||
discard.clone(),
|
discard.clone(),
|
||||||
|
@ -266,6 +270,7 @@ impl StreamProducer {
|
||||||
fn add_consumer_internal(
|
fn add_consumer_internal(
|
||||||
&self,
|
&self,
|
||||||
consumer: &gst_app::AppSrc,
|
consumer: &gst_app::AppSrc,
|
||||||
|
configure_consumer: bool,
|
||||||
dropped: Arc<WrappedAtomicU64>,
|
dropped: Arc<WrappedAtomicU64>,
|
||||||
pushed: Arc<WrappedAtomicU64>,
|
pushed: Arc<WrappedAtomicU64>,
|
||||||
discard: Arc<atomic::AtomicBool>,
|
discard: Arc<atomic::AtomicBool>,
|
||||||
|
@ -291,7 +296,9 @@ impl StreamProducer {
|
||||||
consumer
|
consumer
|
||||||
);
|
);
|
||||||
|
|
||||||
Self::configure_consumer(consumer);
|
if configure_consumer {
|
||||||
|
Self::configure_consumer(consumer);
|
||||||
|
}
|
||||||
|
|
||||||
// Forward force-keyunit events upstream to the appsink
|
// Forward force-keyunit events upstream to the appsink
|
||||||
let srcpad = consumer.static_pad("src").unwrap();
|
let srcpad = consumer.static_pad("src").unwrap();
|
||||||
|
|
Loading…
Reference in a new issue