webrtcsink: improve debug

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/972>
This commit is contained in:
Mathieu Duponchelle 2022-11-09 13:03:00 +01:00 committed by GStreamer Marge Bot
parent 4d310434ab
commit 66e7b314f7

View file

@ -2066,7 +2066,7 @@ impl WebRTCSink {
}
async fn run_discovery_pipeline(
_element: &super::WebRTCSink,
element: &super::WebRTCSink,
codec: &Codec,
caps: &gst::Caps,
) -> Result<gst::Structure, Error> {
@ -2083,6 +2083,12 @@ impl WebRTCSink {
elements.push(make_converter_for_video_caps(caps)?);
}
gst::debug!(
CAT,
obj: element,
"Running discovery pipeline for caps {caps} with codec {codec:?}"
);
let capsfilter = make_element("capsfilter", None)?;
elements.push(capsfilter.clone());
let elements_slice = &elements.iter().collect::<Vec<_>>();
@ -2109,6 +2115,8 @@ impl WebRTCSink {
.set_state(gst::State::Playing)
.with_context(|| format!("Running discovery pipeline for caps {}", caps))?;
let in_caps = caps;
while let Some(msg) = stream.next().await {
match msg.view() {
gst::MessageView::Error(err) => {
@ -2136,6 +2144,11 @@ impl WebRTCSink {
"a-framerate",
]);
s.set("payload", codec.payload);
gst::debug!(
CAT,
obj: element,
"Codec discovery pipeline for caps {in_caps} with codec {codec:?} succeeded: {s}"
);
return Ok(s);
} else {
return Err(anyhow!("Discovered empty caps"));
@ -2196,6 +2209,9 @@ impl WebRTCSink {
async fn lookup_streams_caps(&self, element: &super::WebRTCSink) -> Result<(), Error> {
let codecs = self.lookup_codecs();
gst::debug!(CAT, obj: element, "Looked up codecs {codecs:?}");
let futs: Vec<_> = self
.state
.lock()