mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-29 06:50:59 +00:00
webrtcsink: prevent video-info error log for audio streams
The following error is logged when `webrtcsink` is feeded with an audio stream: > ERROR video-info video-info.c:540:gst_video_info_from_caps: > wrong name 'audio/x-raw', expected video/ or image/ This commit bypasses `VideoInfo::from_caps` for audio streams. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1508>
This commit is contained in:
parent
158fe80779
commit
ede354d7a5
1 changed files with 15 additions and 12 deletions
|
@ -3537,19 +3537,22 @@ impl BaseWebRTCSink {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if let Ok(video_info) = gst_video::VideoInfo::from_caps(e.caps()) {
|
if e.caps().structure(0).unwrap().name().starts_with("video/") {
|
||||||
// update video encoder info used when downscaling/downsampling the input
|
if let Ok(video_info) = gst_video::VideoInfo::from_caps(e.caps()) {
|
||||||
let stream_name = pad.name().to_string();
|
// update video encoder info used when downscaling/downsampling the input
|
||||||
|
let stream_name = pad.name().to_string();
|
||||||
|
|
||||||
state
|
state
|
||||||
.sessions
|
.sessions
|
||||||
.values_mut()
|
.values_mut()
|
||||||
.flat_map(|session| session.unwrap_mut().encoders.iter_mut())
|
.flat_map(|session| session.unwrap_mut().encoders.iter_mut())
|
||||||
.filter(|encoder| encoder.stream_name == stream_name)
|
.filter(|encoder| encoder.stream_name == stream_name)
|
||||||
.for_each(|encoder| {
|
.for_each(|encoder| {
|
||||||
encoder.halved_framerate = video_info.fps().mul(gst::Fraction::new(1, 2));
|
encoder.halved_framerate =
|
||||||
encoder.video_info = video_info.clone();
|
video_info.fps().mul(gst::Fraction::new(1, 2));
|
||||||
});
|
encoder.video_info = video_info.clone();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue