reqwesthttpsrc: Answer the SCHEDULING query correctly

We don't really want to operate in pull mode and also hint that we're
bandwidth limited.
This commit is contained in:
Sebastian Dröge 2019-10-01 22:55:25 +03:00
parent cecc0804d5
commit 2a6ee4b959

View file

@ -662,6 +662,24 @@ impl BaseSrcImpl for ReqwestHttpSrc {
Ok(())
}
fn query(&self, element: &gst_base::BaseSrc, query: &mut gst::QueryRef) -> bool {
use gst::QueryView;
match query.view_mut() {
QueryView::Scheduling(ref mut q) => {
q.set(
gst::SchedulingFlags::SEQUENTIAL | gst::SchedulingFlags::BANDWIDTH_LIMITED,
1,
-1,
0,
);
q.add_scheduling_modes(&[gst::PadMode::Push]);
true
}
_ => BaseSrcImplExt::parent_query(self, element, query),
}
}
fn do_seek(&self, src: &gst_base::BaseSrc, segment: &mut gst::Segment) -> bool {
let segment = segment.downcast_mut::<gst::format::Bytes>().unwrap();