uriplaylistbin: implement Debug on State

Help debugging.
This commit is contained in:
Guillaume Desmottes 2022-04-22 11:49:49 +02:00
parent 7ff998f925
commit 03fcc2cb9a

View file

@ -100,6 +100,7 @@ impl Default for Settings {
}
}
#[derive(Debug)]
enum Status {
/// all good element is working
Running,
@ -119,6 +120,7 @@ impl Status {
}
}
#[derive(Debug)]
struct State {
streamsynchronizer: gst::Element,
concat_audio: Vec<gst::Element>,
@ -704,6 +706,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()))