webrtcsrc: Do not pass raw caps in the transceiver

That was not making sense.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1216>
This commit is contained in:
Thibault Saunier 2023-05-18 10:48:25 -04:00 committed by Sebastian Dröge
parent 482ff879a4
commit 0b65a2f8af

View file

@ -637,7 +637,7 @@ impl WebRTCSrc {
// Creates and adds our `WebRTCSrcPad` source pad, returning caps accepted
// downstream
fn create_and_probe_src_pad(&self, caps: &gst::Caps, stream_id: &str) -> Option<gst::Caps> {
fn create_and_probe_src_pad(&self, caps: &gst::Caps, stream_id: &str) -> bool {
gst::log!(CAT, "Creating pad for {caps:?}, stream: {stream_id}");
let obj = self.obj();
@ -662,7 +662,7 @@ impl WebRTCSrc {
} else {
gst::info!(CAT, imp: self, "Not an audio or video media {media_type:?}");
return None;
return false;
};
let caps_with_raw = [caps.clone(), raw_caps.clone()]
@ -683,11 +683,7 @@ impl WebRTCSrc {
}
}
if ghost.imp().needs_decoding() {
Some(caps.clone())
} else {
Some(downstream_caps)
}
true
}
fn handle_offer(&self, offer: &gst_webrtc::WebRTCSessionDescription) {
@ -733,11 +729,11 @@ impl WebRTCSrc {
if !caps.is_empty() {
let stream_id = self.get_stream_id(None, Some(i as u32)).unwrap();
if let Some(caps) = self.create_and_probe_src_pad(&caps, &stream_id) {
if self.create_and_probe_src_pad(&caps, &stream_id) {
gst::info!(
CAT,
imp: self,
"Adding transceiver for {stream_id} with caps: {caps:?}"
"Adding transceiver for {stream_id} with caps: {caps:#?}"
);
let transceiver = webrtcbin.emit_by_name::<gst_webrtc::WebRTCRTPTransceiver>(
"add-transceiver",