Skip to content

Commit

Permalink
src: lib: stream: sink: Update to new gstramear SDP API
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso authored and patrickelectric committed Dec 10, 2024
1 parent 1a58d32 commit 8e32a8c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/stream/sink/webrtc_sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ impl WebRTCBinInterface for WebRTCSinkWeakProxy {
// Recreate the SDP answer with our customized SDP
let answer = gst_webrtc::WebRTCSessionDescription::new(
answer.type_(),
customize_sent_sdp(&answer.sdp())?,
customize_sent_sdp(answer.sdp())?,
);

let Ok(sdp) = answer.sdp().as_text() else {
Expand Down Expand Up @@ -775,7 +775,7 @@ impl WebRTCBinInterface for WebRTCSinkWeakProxy {
/// Because GStreamer's WebRTCBin often crashes when receiving an invalid SDP,
/// we use Mozzila's SDP parser to manipulate the SDP Message before giving it to GStreamer
#[instrument(level = "debug", skip_all)]
fn sanitize_sdp(sdp: &gst_sdp::SDPMessage) -> Result<gst_sdp::SDPMessage> {
fn sanitize_sdp(sdp: &gst_sdp::SDPMessageRef) -> Result<gst_sdp::SDPMessage> {
gst_sdp::SDPMessage::parse_buffer(
webrtc_sdp::parse_sdp(sdp.as_text()?.as_str(), false)?
.to_string()
Expand All @@ -785,8 +785,8 @@ fn sanitize_sdp(sdp: &gst_sdp::SDPMessage) -> Result<gst_sdp::SDPMessage> {
}

#[instrument(level = "debug", skip_all)]
fn customize_sent_sdp(sdp: &gst_sdp::SDPMessage) -> Result<gst_sdp::SDPMessage> {
let mut new_sdp = sdp.clone();
fn customize_sent_sdp(sdp: &gst_sdp::SDPMessageRef) -> Result<gst_sdp::SDPMessage> {
let mut new_sdp = sdp.to_owned();

trace!("SDP: {:?}", new_sdp.as_text());

Expand Down

0 comments on commit 8e32a8c

Please sign in to comment.