Commit 2962f186 authored by Thibault Saunier's avatar Thibault Saunier 🌵 Committed by Sebastian Dröge

Print pointer value when formatting debug strings

parent be646e78
......@@ -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())
......
......@@ -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())
......
......@@ -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()
......
......@@ -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()
......
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment