Debug for Context

This commit is contained in:
Kornel Lesiński 2020-06-26 22:01:09 +01:00 committed by Zhiming Wang
parent aa8df7d0d2
commit f73dca70b4
No known key found for this signature in database
GPG Key ID: 5B58F95EC95965D8
2 changed files with 12 additions and 0 deletions

View File

@ -382,3 +382,14 @@ impl<'a> Iterator for ChapterIterMut<'a> {
} }
impl<'a> ExactSizeIterator for ChapterIterMut<'a> {} impl<'a> ExactSizeIterator for ChapterIterMut<'a> {}
impl fmt::Debug for Context {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
let mut s = fmt.debug_struct("AVFormatContext");
s.field("bit_rate", &self.bit_rate());
s.field("duration", &self.duration());
s.field("nb_chapters", &self.nb_chapters());
s.field("nb_streams", &self.nb_streams());
s.finish()
}
}

View File

@ -5,6 +5,7 @@ use format::context::common::Context;
use libc::c_int; use libc::c_int;
use {DictionaryRef, Discard, Rational}; use {DictionaryRef, Discard, Rational};
#[derive(Debug)]
pub struct Stream<'a> { pub struct Stream<'a> {
context: &'a Context, context: &'a Context,
index: usize, index: usize,