mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-27 05:51:01 +00:00
threadshare/inputselector: Implement a correct chain_list() function
Instead of directly forwarding the list, handle each buffer separately for now. Previously we would directly forward the lists from any pad, including inactive ones, downstream.
This commit is contained in:
parent
0b240b829e
commit
6c4108671f
1 changed files with 9 additions and 4 deletions
|
@ -148,7 +148,7 @@ impl InputSelectorPadSinkHandler {
|
|||
|
||||
async fn handle_item(
|
||||
&self,
|
||||
pad: PadSinkRef<'_>,
|
||||
pad: &PadSinkRef<'_>,
|
||||
element: &gst::Element,
|
||||
buffer: gst::Buffer,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
|
@ -220,7 +220,7 @@ impl PadSinkHandler for InputSelectorPadSinkHandler {
|
|||
let pad_weak = pad.downgrade();
|
||||
async move {
|
||||
let pad = pad_weak.upgrade().expect("PadSink no longer exists");
|
||||
this.handle_item(pad, &element, buffer).await
|
||||
this.handle_item(&pad, &element, buffer).await
|
||||
}
|
||||
.boxed()
|
||||
}
|
||||
|
@ -232,13 +232,18 @@ impl PadSinkHandler for InputSelectorPadSinkHandler {
|
|||
element: &gst::Element,
|
||||
list: gst::BufferList,
|
||||
) -> BoxFuture<'static, Result<gst::FlowSuccess, gst::FlowError>> {
|
||||
let this = self.clone();
|
||||
let element = element.clone();
|
||||
let pad_weak = pad.downgrade();
|
||||
async move {
|
||||
let inputselector = InputSelector::from_instance(&element);
|
||||
let pad = pad_weak.upgrade().expect("PadSink no longer exists");
|
||||
gst_log!(CAT, obj: pad.gst_pad(), "Handling buffer list {:?}", list);
|
||||
inputselector.src_pad.push_list(list).await
|
||||
// TODO: Ideally we would keep the list intact and forward it in one go
|
||||
for buffer in list.iter_owned() {
|
||||
this.handle_item(&pad, &element, buffer).await?;
|
||||
}
|
||||
|
||||
Ok(gst::FlowSuccess::Ok)
|
||||
}
|
||||
.boxed()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue