diff --git a/gstreamer/src/buffer.rs b/gstreamer/src/buffer.rs index 68194b34b..80d89ac2a 100644 --- a/gstreamer/src/buffer.rs +++ b/gstreamer/src/buffer.rs @@ -941,9 +941,9 @@ impl fmt::Debug for BufferRef { f.debug_struct("Buffer") .field("ptr", unsafe { &self.as_ptr() }) - .field("pts", &self.pts().display().to_string()) - .field("dts", &self.dts().display().to_string()) - .field("duration", &self.duration().display().to_string()) + .field("pts", &self.pts().display()) + .field("dts", &self.dts().display()) + .field("duration", &self.duration().display()) .field("size", &self.size()) .field("offset", &self.offset()) .field("offset_end", &self.offset_end()) diff --git a/gstreamer/src/bufferlist.rs b/gstreamer/src/bufferlist.rs index c6fed6117..41d86a742 100644 --- a/gstreamer/src/bufferlist.rs +++ b/gstreamer/src/bufferlist.rs @@ -197,8 +197,8 @@ impl fmt::Debug for BufferListRef { f.debug_struct("BufferList") .field("ptr", unsafe { &self.as_ptr() }) .field("buffers", &self.len()) - .field("pts", &pts.display().to_string()) - .field("dts", &dts.display().to_string()) + .field("pts", &pts.display()) + .field("dts", &dts.display()) .field("size", &size) .finish() } diff --git a/gstreamer/src/clock_time.rs b/gstreamer/src/clock_time.rs index 461eafcd8..0d7c18f33 100644 --- a/gstreamer/src/clock_time.rs +++ b/gstreamer/src/clock_time.rs @@ -7,7 +7,7 @@ use std::io::{self, prelude::*}; use std::time::Duration; use std::{cmp, convert, fmt, str}; -#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, Debug, Default)] +#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, Default)] pub struct ClockTime(pub(crate) u64); impl ClockTime { @@ -419,7 +419,12 @@ impl fmt::Display for ClockTime { } } -#[derive(Debug)] +impl fmt::Debug for ClockTime { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(self, f) + } +} + pub struct DisplayableOptClockTime(Option); impl fmt::Display for DisplayableOptClockTime { @@ -428,6 +433,12 @@ impl fmt::Display for DisplayableOptClockTime { } } +impl fmt::Debug for DisplayableOptClockTime { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(self, f) + } +} + impl crate::utils::Displayable for Option { type DisplayImpl = DisplayableOptClockTime; diff --git a/gstreamer/src/meta.rs b/gstreamer/src/meta.rs index 42e8e9744..b08403404 100644 --- a/gstreamer/src/meta.rs +++ b/gstreamer/src/meta.rs @@ -503,8 +503,8 @@ impl fmt::Debug for ReferenceTimestampMeta { f.debug_struct("ReferenceTimestampMeta") .field("reference", &self.reference()) - .field("timestamp", &self.timestamp().display().to_string()) - .field("duration", &self.duration().display().to_string()) + .field("timestamp", &self.timestamp().display()) + .field("duration", &self.duration().display()) .finish() } } diff --git a/gstreamer/src/segment.rs b/gstreamer/src/segment.rs index 8bc6d414a..625bdff67 100644 --- a/gstreamer/src/segment.rs +++ b/gstreamer/src/segment.rs @@ -591,16 +591,16 @@ impl fmt::Debug for FormattedSegment { let segment = segment.downcast_ref::().unwrap(); f.debug_struct("Segment") .field("format", &Format::Time) - .field("start", &segment.start().display().to_string()) - .field("offset", &segment.offset().display().to_string()) - .field("stop", &segment.stop().display().to_string()) + .field("start", &segment.start().display()) + .field("offset", &segment.offset().display()) + .field("stop", &segment.stop().display()) .field("rate", &segment.rate()) .field("applied_rate", &segment.applied_rate()) .field("flags", &segment.flags()) - .field("time", &segment.time().display().to_string()) - .field("base", &segment.base().display().to_string()) - .field("position", &segment.position().display().to_string()) - .field("duration", &segment.duration().display().to_string()) + .field("time", &segment.time().display()) + .field("base", &segment.base().display()) + .field("position", &segment.position().display()) + .field("duration", &segment.duration().display()) .finish() } _ => f