From 455996c60b9ae13bdd2a588713bd9149c76b8f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 10 May 2024 10:35:19 +0300 Subject: [PATCH] rtsp-server: Fix compilation after `from_glib_ptr_borrow()` API improvements Part-of: --- gstreamer-rtsp-server/src/rtsp_context.rs | 25 ++++++----------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/gstreamer-rtsp-server/src/rtsp_context.rs b/gstreamer-rtsp-server/src/rtsp_context.rs index 4b738d00b..f6be16f1c 100644 --- a/gstreamer-rtsp-server/src/rtsp_context.rs +++ b/gstreamer-rtsp-server/src/rtsp_context.rs @@ -1,9 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use std::{ - marker::PhantomData, - ptr::{self, addr_of}, -}; +use std::{marker::PhantomData, ptr}; use glib::{prelude::*, translate::*}; use gst_rtsp::{rtsp_message::RTSPMessage, RTSPUrl}; @@ -36,9 +33,7 @@ impl RTSPContext { if (*ptr).uri.is_null() { None } else { - let uri = RTSPUrl::from_glib_ptr_borrow( - addr_of!((*ptr).uri) as *const *const gst_rtsp::ffi::GstRTSPUrl - ); + let uri = RTSPUrl::from_glib_ptr_borrow(&(*ptr).uri); Some(uri) } } @@ -51,9 +46,7 @@ impl RTSPContext { if (*ptr).client.is_null() { None } else { - let client = RTSPClient::from_glib_ptr_borrow( - addr_of!((*ptr).client) as *const *const ffi::GstRTSPClient - ); + let client = RTSPClient::from_glib_ptr_borrow(&(*ptr).client); Some(client) } } @@ -66,9 +59,7 @@ impl RTSPContext { if (*ptr).request.is_null() { None } else { - let msg = RTSPMessage::from_glib_ptr_borrow( - addr_of!((*ptr).request) as *const *const gst_rtsp::ffi::GstRTSPMessage - ); + let msg = RTSPMessage::from_glib_ptr_borrow(&(*ptr).request); Some(msg) } } @@ -81,9 +72,7 @@ impl RTSPContext { if (*ptr).response.is_null() { None } else { - let msg = RTSPMessage::from_glib_ptr_borrow( - addr_of!((*ptr).response) as *const *const gst_rtsp::ffi::GstRTSPMessage - ); + let msg = RTSPMessage::from_glib_ptr_borrow(&(*ptr).response); Some(msg) } } @@ -96,9 +85,7 @@ impl RTSPContext { if (*ptr).session.is_null() { None } else { - let sess = RTSPSession::from_glib_ptr_borrow( - addr_of!((*ptr).session) as *const *const ffi::GstRTSPSession - ); + let sess = RTSPSession::from_glib_ptr_borrow(&(*ptr).session); Some(sess) } }