rtsp-server: Fix compilation after from_glib_ptr_borrow() API improvements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1440>
This commit is contained in:
Sebastian Dröge 2024-05-10 10:35:19 +03:00
parent 83fe420466
commit 455996c60b

View file

@ -1,9 +1,6 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use std::{ use std::{marker::PhantomData, ptr};
marker::PhantomData,
ptr::{self, addr_of},
};
use glib::{prelude::*, translate::*}; use glib::{prelude::*, translate::*};
use gst_rtsp::{rtsp_message::RTSPMessage, RTSPUrl}; use gst_rtsp::{rtsp_message::RTSPMessage, RTSPUrl};
@ -36,9 +33,7 @@ impl RTSPContext {
if (*ptr).uri.is_null() { if (*ptr).uri.is_null() {
None None
} else { } else {
let uri = RTSPUrl::from_glib_ptr_borrow( let uri = RTSPUrl::from_glib_ptr_borrow(&(*ptr).uri);
addr_of!((*ptr).uri) as *const *const gst_rtsp::ffi::GstRTSPUrl
);
Some(uri) Some(uri)
} }
} }
@ -51,9 +46,7 @@ impl RTSPContext {
if (*ptr).client.is_null() { if (*ptr).client.is_null() {
None None
} else { } else {
let client = RTSPClient::from_glib_ptr_borrow( let client = RTSPClient::from_glib_ptr_borrow(&(*ptr).client);
addr_of!((*ptr).client) as *const *const ffi::GstRTSPClient
);
Some(client) Some(client)
} }
} }
@ -66,9 +59,7 @@ impl RTSPContext {
if (*ptr).request.is_null() { if (*ptr).request.is_null() {
None None
} else { } else {
let msg = RTSPMessage::from_glib_ptr_borrow( let msg = RTSPMessage::from_glib_ptr_borrow(&(*ptr).request);
addr_of!((*ptr).request) as *const *const gst_rtsp::ffi::GstRTSPMessage
);
Some(msg) Some(msg)
} }
} }
@ -81,9 +72,7 @@ impl RTSPContext {
if (*ptr).response.is_null() { if (*ptr).response.is_null() {
None None
} else { } else {
let msg = RTSPMessage::from_glib_ptr_borrow( let msg = RTSPMessage::from_glib_ptr_borrow(&(*ptr).response);
addr_of!((*ptr).response) as *const *const gst_rtsp::ffi::GstRTSPMessage
);
Some(msg) Some(msg)
} }
} }
@ -96,9 +85,7 @@ impl RTSPContext {
if (*ptr).session.is_null() { if (*ptr).session.is_null() {
None None
} else { } else {
let sess = RTSPSession::from_glib_ptr_borrow( let sess = RTSPSession::from_glib_ptr_borrow(&(*ptr).session);
addr_of!((*ptr).session) as *const *const ffi::GstRTSPSession
);
Some(sess) Some(sess)
} }
} }