From cde2e75bcc856fb6ec87de5697a2294d2c65e393 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 22 Apr 2022 11:49:49 +0200 Subject: [PATCH] uriplaylistbin: implement Debug on State Help debugging. --- utils/uriplaylistbin/src/uriplaylistbin/imp.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/utils/uriplaylistbin/src/uriplaylistbin/imp.rs b/utils/uriplaylistbin/src/uriplaylistbin/imp.rs index 803b1386..38da133d 100644 --- a/utils/uriplaylistbin/src/uriplaylistbin/imp.rs +++ b/utils/uriplaylistbin/src/uriplaylistbin/imp.rs @@ -101,6 +101,7 @@ impl Default for Settings { } } +#[derive(Debug)] enum Status { /// all good element is working Running, @@ -120,6 +121,7 @@ impl Status { } } +#[derive(Debug)] struct State { streamsynchronizer: gst::Element, concat_audio: Vec, @@ -705,6 +707,14 @@ impl Playlist { } } +impl std::fmt::Debug for Playlist { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Playlist") + .field("uris", &self.uris) + .finish() + } +} + fn stream_type_from_pad_name(name: &str) -> anyhow::Result<(gst::StreamType, usize)> { if let Some(index) = name.strip_prefix("audio_") { Ok((gst::StreamType::AUDIO, index.parse().unwrap()))