mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-01-09 16:55:27 +00:00
1df5b0d028
The default Debug implementation is not very useful but unfortunately cannot be overridden. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1276>
26 lines
652 B
Rust
26 lines
652 B
Rust
// Take a look at the license at the top of the repository in the LICENSE file.
|
|
|
|
use std::fmt;
|
|
|
|
use glib::Cast;
|
|
|
|
use crate::{DiscovererStreamInfo, DiscovererSubtitleInfo};
|
|
|
|
pub struct Debug<'a>(&'a DiscovererSubtitleInfo);
|
|
|
|
impl<'a> fmt::Debug for Debug<'a> {
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
let info = self.0.upcast_ref::<DiscovererStreamInfo>();
|
|
|
|
f.debug_struct("DiscovererSubtitleInfo")
|
|
.field("language", &self.0.language())
|
|
.field("stream", &info.debug())
|
|
.finish()
|
|
}
|
|
}
|
|
|
|
impl DiscovererSubtitleInfo {
|
|
pub fn debug(&self) -> Debug {
|
|
Debug(self)
|
|
}
|
|
}
|