From 2962f186f7d4736a46a18221fbe21d4ad81f3077 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Sat, 5 May 2018 12:22:27 +0200 Subject: [PATCH] Print pointer value when formatting debug strings --- gstreamer/src/buffer.rs | 1 + gstreamer/src/bufferlist.rs | 1 + gstreamer/src/event.rs | 1 + gstreamer/src/message.rs | 1 + gstreamer/src/query.rs | 1 + 5 files changed, 5 insertions(+) diff --git a/gstreamer/src/buffer.rs b/gstreamer/src/buffer.rs index 263e5436c..5a7631d38 100644 --- a/gstreamer/src/buffer.rs +++ b/gstreamer/src/buffer.rs @@ -390,6 +390,7 @@ impl ToOwned for BufferRef { impl fmt::Debug for BufferRef { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Buffer") + .field("ptr", unsafe { &self.as_ptr() } ) .field("pts", &self.get_pts().to_string()) .field("dts", &self.get_dts().to_string()) .field("duration", &self.get_duration().to_string()) diff --git a/gstreamer/src/bufferlist.rs b/gstreamer/src/bufferlist.rs index e19ffc6a2..b7c6ee7c7 100644 --- a/gstreamer/src/bufferlist.rs +++ b/gstreamer/src/bufferlist.rs @@ -117,6 +117,7 @@ impl fmt::Debug for BufferListRef { .unwrap_or((::ClockTime::none(), ::ClockTime::none())); f.debug_struct("BufferList") + .field("ptr", unsafe { &self.as_ptr() } ) .field("buffers", &self.len()) .field("pts", &pts.to_string()) .field("dts", &dts.to_string()) diff --git a/gstreamer/src/event.rs b/gstreamer/src/event.rs index e3593495f..67794732e 100644 --- a/gstreamer/src/event.rs +++ b/gstreamer/src/event.rs @@ -440,6 +440,7 @@ impl glib::types::StaticType for EventRef { impl fmt::Debug for EventRef { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Event") + .field("ptr", unsafe { &self.as_ptr() } ) .field("type", &unsafe { let type_ = ffi::gst_event_type_get_name((*self.as_ptr()).type_); CStr::from_ptr(type_).to_str().unwrap() diff --git a/gstreamer/src/message.rs b/gstreamer/src/message.rs index 3ee33a5be..1d27597f2 100644 --- a/gstreamer/src/message.rs +++ b/gstreamer/src/message.rs @@ -357,6 +357,7 @@ impl glib::types::StaticType for MessageRef { impl fmt::Debug for MessageRef { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Message") + .field("ptr", unsafe { &self.as_ptr() } ) .field("type", &unsafe { let type_ = ffi::gst_message_type_get_name((*self.as_ptr()).type_); CStr::from_ptr(type_).to_str().unwrap() diff --git a/gstreamer/src/query.rs b/gstreamer/src/query.rs index c1beac6c2..37b03a6e2 100644 --- a/gstreamer/src/query.rs +++ b/gstreamer/src/query.rs @@ -208,6 +208,7 @@ impl glib::types::StaticType for QueryRef { impl fmt::Debug for QueryRef { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Query") + .field("ptr", unsafe { &self.as_ptr() }) .field("type", &unsafe { let type_ = ffi::gst_query_type_get_name((*self.as_ptr()).type_); CStr::from_ptr(type_).to_str().unwrap()