mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-27 14:01:04 +00:00
threadshare: Push io-context sharing event before stream-start and anything else
This commit is contained in:
parent
0b54cdb8ea
commit
135ec5ee7d
2 changed files with 14 additions and 12 deletions
|
@ -379,6 +379,13 @@ impl AppSrc {
|
|||
if state.need_initial_events {
|
||||
gst_debug!(self.cat, obj: element, "Pushing initial events");
|
||||
|
||||
if let Some(event) = Self::create_io_context_event(&state) {
|
||||
events.push(event);
|
||||
|
||||
// Get rid of reconfigure flag
|
||||
self.src_pad.check_reconfigure();
|
||||
}
|
||||
|
||||
let stream_id = format!("{:08x}{:08x}", rand::random::<u32>(), rand::random::<u32>());
|
||||
events.push(gst::Event::new_stream_start(&stream_id).build());
|
||||
if let Some(ref caps) = self.settings.lock().unwrap().caps {
|
||||
|
@ -389,12 +396,6 @@ impl AppSrc {
|
|||
gst::Event::new_segment(&gst::FormattedSegment::<gst::format::Time>::new()).build(),
|
||||
);
|
||||
|
||||
if let Some(event) = Self::create_io_context_event(&state) {
|
||||
events.push(event);
|
||||
|
||||
// Get rid of reconfigure flag
|
||||
self.src_pad.check_reconfigure();
|
||||
}
|
||||
state.need_initial_events = false;
|
||||
} else if self.src_pad.check_reconfigure() {
|
||||
if let Some(event) = Self::create_io_context_event(&state) {
|
||||
|
|
|
@ -317,6 +317,13 @@ impl UdpSrc {
|
|||
if state.need_initial_events {
|
||||
gst_debug!(self.cat, obj: element, "Pushing initial events");
|
||||
|
||||
if let Some(event) = Self::create_io_context_event(&state) {
|
||||
events.push(event);
|
||||
|
||||
// Get rid of reconfigure flag
|
||||
self.src_pad.check_reconfigure();
|
||||
}
|
||||
|
||||
let stream_id = format!("{:08x}{:08x}", rand::random::<u32>(), rand::random::<u32>());
|
||||
events.push(gst::Event::new_stream_start(&stream_id).build());
|
||||
if let Some(ref caps) = self.settings.lock().unwrap().caps {
|
||||
|
@ -327,12 +334,6 @@ impl UdpSrc {
|
|||
gst::Event::new_segment(&gst::FormattedSegment::<gst::format::Time>::new()).build(),
|
||||
);
|
||||
|
||||
if let Some(event) = Self::create_io_context_event(&state) {
|
||||
events.push(event);
|
||||
|
||||
// Get rid of reconfigure flag
|
||||
self.src_pad.check_reconfigure();
|
||||
}
|
||||
state.need_initial_events = false;
|
||||
} else if self.src_pad.check_reconfigure() {
|
||||
if let Some(event) = Self::create_io_context_event(&state) {
|
||||
|
|
Loading…
Reference in a new issue