*: 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

@ -7,6 +7,7 @@ use std::mem;
use libc::{c_int, uint8_t};
use ffi::*;
use ffi::AVSampleFormat::*;
#[derive(Eq, PartialEq, Copy, Clone, Debug)]
pub enum Sample {
@ -15,6 +16,7 @@ pub enum Sample {
U8(Type),
I16(Type),
I32(Type),
I64(Type),
F32(Type),
F64(Type),
}
@ -81,12 +83,14 @@ impl From<AVSampleFormat> for Sample {
AV_SAMPLE_FMT_U8 => Sample::U8(Type::Packed),
AV_SAMPLE_FMT_S16 => Sample::I16(Type::Packed),
AV_SAMPLE_FMT_S32 => Sample::I32(Type::Packed),
AV_SAMPLE_FMT_S64 => Sample::I64(Type::Packed),
AV_SAMPLE_FMT_FLT => Sample::F32(Type::Packed),
AV_SAMPLE_FMT_DBL => Sample::F64(Type::Packed),
AV_SAMPLE_FMT_U8P => Sample::U8(Type::Planar),
AV_SAMPLE_FMT_S16P => Sample::I16(Type::Planar),
AV_SAMPLE_FMT_S32P => Sample::I32(Type::Planar),
AV_SAMPLE_FMT_S64P => Sample::I64(Type::Planar),
AV_SAMPLE_FMT_FLTP => Sample::F32(Type::Planar),
AV_SAMPLE_FMT_DBLP => Sample::F64(Type::Planar),
@ -115,12 +119,14 @@ impl Into<AVSampleFormat> for Sample {
Sample::U8(Type::Packed) => AV_SAMPLE_FMT_U8,
Sample::I16(Type::Packed) => AV_SAMPLE_FMT_S16,
Sample::I32(Type::Packed) => AV_SAMPLE_FMT_S32,
Sample::I64(Type::Packed) => AV_SAMPLE_FMT_S64,
Sample::F32(Type::Packed) => AV_SAMPLE_FMT_FLT,
Sample::F64(Type::Packed) => AV_SAMPLE_FMT_DBL,
Sample::U8(Type::Planar) => AV_SAMPLE_FMT_U8P,
Sample::I16(Type::Planar) => AV_SAMPLE_FMT_S16P,
Sample::I32(Type::Planar) => AV_SAMPLE_FMT_S32P,
Sample::I64(Type::Planar) => AV_SAMPLE_FMT_S64P,
Sample::F32(Type::Planar) => AV_SAMPLE_FMT_FLTP,
Sample::F64(Type::Planar) => AV_SAMPLE_FMT_DBLP,
}