Update for API changes

This commit is contained in:
Sebastian Dröge 2023-01-05 12:32:01 +02:00
parent d846f527af
commit 27435ad82e
8 changed files with 11 additions and 11 deletions

View file

@ -110,7 +110,7 @@ fn run() -> Result<(), Error> {
match msg.view() {
MessageView::StateChanged(state_changed) => {
if state_changed.src().map(|s| s == pipeline).unwrap_or(false)
if state_changed.src().map(|s| s == &pipeline).unwrap_or(false)
&& state_changed.current() == gst::State::Playing
{
let (lock, cvar) = &*state_cond;

View file

@ -382,7 +382,7 @@ impl BinImpl for HlsSink3 {
let event_is_from_splitmuxsink = {
let settings = self.settings.lock().unwrap();
msg.src().as_ref() == Some(settings.splitmuxsink.upcast_ref())
msg.src() == Some(settings.splitmuxsink.upcast_ref())
};
if !event_is_from_splitmuxsink {
return;

View file

@ -1695,7 +1695,7 @@ impl WebRTCSink {
}
gst::MessageView::StateChanged(state_changed) => {
if let Some(pipeline) = pipeline_clone.upgrade() {
if Some(pipeline.clone().upcast()) == state_changed.src() {
if state_changed.src() == Some(pipeline.upcast_ref()) {
pipeline.debug_to_dot_file_with_ts(
gst::DebugGraphDetails::all(),
format!(

View file

@ -223,7 +223,7 @@ impl BinImpl for ProgressBin {
// handling of the parent class, i.e. forwarding to the parent
// bins and the application.
MessageView::Element(msg)
if msg.src().as_ref() == Some(self.progress.upcast_ref())
if msg.src() == Some(self.progress.upcast_ref())
&& msg
.structure()
.map(|s| s.name() == "progress")

View file

@ -344,7 +344,7 @@ impl CustomSource {
.map(|p| p.stream.clone())
.collect::<Vec<_>>();
let collection = gst::StreamCollection::builder(None)
.streams(&streams)
.streams(streams)
.build();
drop(state);

View file

@ -2778,7 +2778,7 @@ impl FallbackSrc {
Some(state) => state,
};
let src = match m.src().and_then(|s| s.downcast::<gst::Element>().ok()) {
let src = match m.src().and_then(|s| s.downcast_ref::<gst::Element>()) {
None => return false,
Some(src) => src,
};
@ -2790,7 +2790,7 @@ impl FallbackSrc {
src.path_string()
);
if src == state.source.source || src.has_as_ancestor(&state.source.source) {
if src == &state.source.source || src.has_as_ancestor(&state.source.source) {
self.handle_source_error(state, RetryReason::Error, false);
drop(state_guard);
self.obj().notify("status");
@ -2800,7 +2800,7 @@ impl FallbackSrc {
// Check if error is from fallback input and if so, use a dummy fallback
if let Some(ref source) = state.fallback_source {
if src == source.source || src.has_as_ancestor(&source.source) {
if src == &source.source || src.has_as_ancestor(&source.source) {
self.handle_source_error(state, RetryReason::Error, true);
drop(state_guard);
self.obj().notify("status");

View file

@ -213,7 +213,7 @@ fn assert_stream_collection(msg: gst::Message, n_streams: usize) -> gst::Object
MessageView::StreamCollection(sc) => {
let collection = sc.stream_collection();
assert_eq!(collection.len(), n_streams);
sc.src().unwrap()
sc.src().unwrap().clone()
}
_ => {
panic!("message is not a stream collection");
@ -226,7 +226,7 @@ fn assert_stream_selected(msg: gst::Message, n_streams: usize) -> gst::Object {
MessageView::StreamsSelected(ss) => {
let collection = ss.stream_collection();
assert_eq!(collection.len(), n_streams);
ss.src().unwrap()
ss.src().unwrap().clone()
}
_ => {
panic!("message is not stream selected");

View file

@ -878,7 +878,7 @@ impl BinImpl for TranscriberBin {
let s = self.state.lock().unwrap();
if let Some(state) = s.as_ref() {
if msg.src().as_ref() == Some(state.transcriber.upcast_ref()) {
if msg.src() == Some(state.transcriber.upcast_ref()) {
gst::error!(
CAT,
imp: self,