mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-25 13:01:07 +00:00
fmp4mux: adding headers when data resumes after EOS
This commit is contained in:
parent
90c203857a
commit
f908cbaffd
1 changed files with 8 additions and 2 deletions
|
@ -97,6 +97,8 @@ struct State {
|
||||||
// Start / end PTS of the whole stream
|
// Start / end PTS of the whole stream
|
||||||
earliest_pts: Option<gst::ClockTime>,
|
earliest_pts: Option<gst::ClockTime>,
|
||||||
end_pts: Option<gst::ClockTime>,
|
end_pts: Option<gst::ClockTime>,
|
||||||
|
|
||||||
|
headers_since_eos: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) struct FMP4Mux {
|
pub(crate) struct FMP4Mux {
|
||||||
|
@ -515,7 +517,7 @@ impl FMP4Mux {
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut fmp4_header = None;
|
let mut fmp4_header = None;
|
||||||
if state.sequence_number == 0 {
|
if !state.headers_since_eos {
|
||||||
let mut buffer = state.stream_header.as_ref().unwrap().copy();
|
let mut buffer = state.stream_header.as_ref().unwrap().copy();
|
||||||
{
|
{
|
||||||
let buffer = buffer.get_mut().unwrap();
|
let buffer = buffer.get_mut().unwrap();
|
||||||
|
@ -530,7 +532,7 @@ impl FMP4Mux {
|
||||||
fmp4_header = Some(buffer);
|
fmp4_header = Some(buffer);
|
||||||
|
|
||||||
state.earliest_pts = Some(earliest_pts);
|
state.earliest_pts = Some(earliest_pts);
|
||||||
state.sequence_number = 1;
|
state.headers_since_eos = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut buffers = drain_gops
|
let mut buffers = drain_gops
|
||||||
|
@ -542,6 +544,9 @@ impl FMP4Mux {
|
||||||
// TODO: Write prft boxes before moof
|
// TODO: Write prft boxes before moof
|
||||||
// TODO: Write sidx boxes before moof and rewrite once offsets are known
|
// TODO: Write sidx boxes before moof and rewrite once offsets are known
|
||||||
|
|
||||||
|
if state.sequence_number == 0 {
|
||||||
|
state.sequence_number = 1;
|
||||||
|
}
|
||||||
let sequence_number = state.sequence_number;
|
let sequence_number = state.sequence_number;
|
||||||
state.sequence_number += 1;
|
state.sequence_number += 1;
|
||||||
let (mut fmp4_fragment_header, moof_offset) =
|
let (mut fmp4_fragment_header, moof_offset) =
|
||||||
|
@ -923,6 +928,7 @@ impl FMP4Mux {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
self.state.lock().unwrap().headers_since_eos = false;
|
||||||
|
|
||||||
pad.event_default(Some(element), event)
|
pad.event_default(Some(element), event)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue