format: refactor format handling

This commit is contained in:
lummax
2015-09-06 17:26:22 +02:00
committed by meh
parent d1e693965c
commit 87ea1bd196
7 changed files with 264 additions and 224 deletions

View File

@ -3,7 +3,7 @@ use std::ptr;
use std::ffi::CString;
use ffi::*;
use ::{Error, Codec, Stream, Packet};
use ::{Error, Codec, Stream, Packet, format};
use super::common::Context;
pub struct Input {
@ -28,6 +28,12 @@ impl Input {
}
impl Input {
pub fn format(&self) -> format::Input {
unsafe {
format::Input::wrap((*self.as_ptr()).iformat)
}
}
pub fn video_codec(&self) -> Option<Codec> {
unsafe {
let ptr = av_format_get_video_codec(self.as_ptr());