gstreamer_pbutils/
discoverer_container_info.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2use std::fmt;
3
4use crate::{prelude::*, DiscovererContainerInfo};
5
6pub struct Debug<'a>(&'a DiscovererContainerInfo);
7
8impl fmt::Debug for Debug<'_> {
9    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
10        let streams = self.0.streams();
11
12        let mut d = f.debug_struct("DiscovererContainerInfo");
13
14        d.field("tags", &self.0.tags()).field(
15            "streams",
16            &streams.iter().map(|info| info.debug()).collect::<Vec<_>>(),
17        );
18
19        #[cfg(feature = "v1_20")]
20        d.field("stream-number", &self.0.stream_number());
21        #[cfg(feature = "v1_20")]
22        d.field("tags", &self.0.tags());
23
24        d.finish()
25    }
26}
27
28impl DiscovererContainerInfo {
29    pub fn debug(&self) -> Debug {
30        Debug(self)
31    }
32}