mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-25 13:01:07 +00:00
fmp4mux: Accept more data on already filled streams if the remaining streams need more data for finishing a GOP
In other words, continue queueing buffers in sync from all streams until all of them are ready for draining instead of stopping to queue buffers on every stream that is already filled individually. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/310 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1081>
This commit is contained in:
parent
f55c32ed37
commit
5965ff4364
1 changed files with 14 additions and 13 deletions
|
@ -602,6 +602,19 @@ impl FMP4Mux {
|
|||
timeout: bool,
|
||||
fragment_duration: gst::ClockTime,
|
||||
) -> Result<Option<&'a mut Stream>, gst::FlowError> {
|
||||
if state
|
||||
.streams
|
||||
.iter()
|
||||
.all(|s| s.fragment_filled || s.chunk_filled)
|
||||
{
|
||||
gst::trace!(
|
||||
CAT,
|
||||
imp: self,
|
||||
"All streams are currently filled and have to be drained"
|
||||
);
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
let mut earliest_stream = None;
|
||||
let mut all_have_data_or_eos = true;
|
||||
|
||||
|
@ -620,16 +633,6 @@ impl FMP4Mux {
|
|||
Err(err) => return Err(err),
|
||||
};
|
||||
|
||||
if stream.fragment_filled {
|
||||
gst::trace!(CAT, obj: stream.sinkpad, "Stream has current fragment filled");
|
||||
continue;
|
||||
}
|
||||
|
||||
if stream.chunk_filled {
|
||||
gst::trace!(CAT, obj: stream.sinkpad, "Stream has current chunk filled");
|
||||
continue;
|
||||
}
|
||||
|
||||
gst::trace!(
|
||||
CAT,
|
||||
obj: stream.sinkpad,
|
||||
|
@ -682,8 +685,6 @@ impl FMP4Mux {
|
|||
stream: &mut Stream,
|
||||
mut pre_queued_buffer: PreQueuedBuffer,
|
||||
) -> Result<(), gst::FlowError> {
|
||||
assert!(!stream.fragment_filled);
|
||||
|
||||
gst::trace!(CAT, obj: stream.sinkpad, "Handling buffer {:?}", pre_queued_buffer);
|
||||
|
||||
let delta_frames = stream.delta_frames;
|
||||
|
|
Loading…
Reference in a new issue