*: use latest ffmpeg-sys using bindgen

* Update bindings to newest ffmpeg version for new ffmpeg-sys, which is mostly generated by bindgen
* Bring back removed feature flags
* Fix whitespace formating
* Remove prepended enum names to enum variants
* Remove unneeded allows
This commit is contained in:
Tadas Barzdžius
2017-07-08 18:00:27 +03:00
committed by meh
parent 8cf47c7ec6
commit 5ac0527bdc
41 changed files with 208 additions and 99 deletions

View File

@ -4,6 +4,7 @@ use std::ffi::CStr;
use std::str::from_utf8_unchecked;
use ffi::*;
use ffi::AVFrameSideDataType::*;
use super::Frame;
use ::DictionaryRef;
@ -22,6 +23,7 @@ pub enum Type {
AudioServiceType,
MasteringDisplayMetadata,
GOPTimecode,
Spherical,
}
impl Type {
@ -50,6 +52,7 @@ impl From<AVFrameSideDataType> for Type {
AV_FRAME_DATA_AUDIO_SERVICE_TYPE => Type::AudioServiceType,
AV_FRAME_DATA_MASTERING_DISPLAY_METADATA => Type::MasteringDisplayMetadata,
AV_FRAME_DATA_GOP_TIMECODE => Type::GOPTimecode,
AV_FRAME_DATA_SPHERICAL => Type::Spherical,
}
}
}
@ -71,6 +74,7 @@ impl Into<AVFrameSideDataType> for Type {
Type::AudioServiceType => AV_FRAME_DATA_AUDIO_SERVICE_TYPE,
Type::MasteringDisplayMetadata => AV_FRAME_DATA_MASTERING_DISPLAY_METADATA,
Type::GOPTimecode => AV_FRAME_DATA_GOP_TIMECODE,
Type::Spherical => AV_FRAME_DATA_SPHERICAL,
}
}
}
@ -102,7 +106,7 @@ impl<'a> SideData<'a> {
#[inline]
pub fn kind(&self) -> Type {
unsafe {
Type::from((*self.as_ptr()).kind)
Type::from((*self.as_ptr()).type_)
}
}