mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-22 17:41:05 +00:00
Print pointer value when formatting debug strings
This commit is contained in:
parent
be646e78d9
commit
2962f186f7
5 changed files with 5 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue