mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-23 16:16:25 +00:00
fmp4mux: Added mut_ prefix for stream_from_pad()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1975>
This commit is contained in:
parent
57f24efc62
commit
aeb37c5ab1
1 changed files with 22 additions and 20 deletions
|
@ -426,7 +426,7 @@ impl State {
|
||||||
self.fragment_end_pts = None;
|
self.fragment_end_pts = None;
|
||||||
self.chunk_start_pts = None;
|
self.chunk_start_pts = None;
|
||||||
}
|
}
|
||||||
fn stream_from_pad(&mut self, pad: &gst_base::AggregatorPad) -> Option<&mut Stream> {
|
fn mut_stream_from_pad(&mut self, pad: &gst_base::AggregatorPad) -> Option<&mut Stream> {
|
||||||
self.streams.iter_mut().find(|s| *pad == s.sinkpad)
|
self.streams.iter_mut().find(|s| *pad == s.sinkpad)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3704,22 +3704,24 @@ impl AggregatorImpl for FMP4Mux {
|
||||||
let mut state = self.state.lock().unwrap();
|
let mut state = self.state.lock().unwrap();
|
||||||
if !state.streams.is_empty() {
|
if !state.streams.is_empty() {
|
||||||
state.need_new_header =
|
state.need_new_header =
|
||||||
state.stream_from_pad(aggregator_pad).is_some_and(|stream| {
|
state
|
||||||
if !self.caps_compatible(stream, caps.caps())
|
.mut_stream_from_pad(aggregator_pad)
|
||||||
&& self.header_update_allowed("caps")
|
.is_some_and(|stream| {
|
||||||
{
|
if !self.caps_compatible(stream, caps.caps())
|
||||||
gst::trace!(
|
&& self.header_update_allowed("caps")
|
||||||
CAT,
|
{
|
||||||
obj = aggregator_pad,
|
gst::trace!(
|
||||||
"Update caps and send new headers {:?}",
|
CAT,
|
||||||
caps
|
obj = aggregator_pad,
|
||||||
);
|
"Update caps and send new headers {:?}",
|
||||||
stream.next_caps = Some(caps.caps_owned());
|
caps
|
||||||
true
|
);
|
||||||
} else {
|
stream.next_caps = Some(caps.caps_owned());
|
||||||
false
|
true
|
||||||
}
|
} else {
|
||||||
});
|
false
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
drop(state);
|
drop(state);
|
||||||
self.parent_sink_event(aggregator_pad, event)
|
self.parent_sink_event(aggregator_pad, event)
|
||||||
|
@ -3750,7 +3752,7 @@ impl AggregatorImpl for FMP4Mux {
|
||||||
}
|
}
|
||||||
|
|
||||||
state.need_new_header = true;
|
state.need_new_header = true;
|
||||||
let stream = state.stream_from_pad(aggregator_pad).unwrap();
|
let stream = state.mut_stream_from_pad(aggregator_pad).unwrap();
|
||||||
stream.language_code = Some(language_code);
|
stream.language_code = Some(language_code);
|
||||||
stream.tag_changed = true;
|
stream.tag_changed = true;
|
||||||
}
|
}
|
||||||
|
@ -3769,7 +3771,7 @@ impl AggregatorImpl for FMP4Mux {
|
||||||
if !state.streams.is_empty() && self.header_update_allowed("orientation") {
|
if !state.streams.is_empty() && self.header_update_allowed("orientation") {
|
||||||
state.need_new_header = true;
|
state.need_new_header = true;
|
||||||
if tag.scope() == gst::TagScope::Stream {
|
if tag.scope() == gst::TagScope::Stream {
|
||||||
let stream = state.stream_from_pad(aggregator_pad).unwrap();
|
let stream = state.mut_stream_from_pad(aggregator_pad).unwrap();
|
||||||
stream.orientation = gst_video::VideoOrientationMethod::from_tag(tag);
|
stream.orientation = gst_video::VideoOrientationMethod::from_tag(tag);
|
||||||
stream.tag_changed = true;
|
stream.tag_changed = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -4574,7 +4576,7 @@ impl AggregatorPadImpl for FMP4MuxPad {
|
||||||
let mut mux_state = mux.imp().state.lock().unwrap();
|
let mut mux_state = mux.imp().state.lock().unwrap();
|
||||||
|
|
||||||
if let Some(stream) =
|
if let Some(stream) =
|
||||||
mux_state.stream_from_pad(self.obj().upcast_ref::<gst_base::AggregatorPad>())
|
mux_state.mut_stream_from_pad(self.obj().upcast_ref::<gst_base::AggregatorPad>())
|
||||||
{
|
{
|
||||||
stream.flush();
|
stream.flush();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue