codec: introduce Parameters

As of ffmpeg 3.1, a new `AVCodecParameters` type and related API introduced.
This commit contains minimal changes to support new API.
This commit is contained in:
Tae-il Lim
2016-11-30 11:21:04 +09:00
committed by meh
parent 00ff69021d
commit 606847cc50
6 changed files with 92 additions and 4 deletions

View File

@ -27,6 +27,12 @@ impl<'a> Stream<'a> {
}
}
pub fn codec_parameters(&self) -> codec::Parameters {
unsafe {
codec::Parameters::wrap((*self.as_ptr()).codecpar, Some(self.context.destructor()))
}
}
pub fn index(&self) -> usize {
unsafe {
(*self.as_ptr()).index as usize