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

@ -84,7 +84,7 @@ impl Context {
/// Get the remaining delay.
pub fn delay(&self) -> Option<Delay> {
unsafe {
match swr_get_delay(self.as_ptr(), 1) {
match swr_get_delay(self.as_ptr() as *mut _, 1) {
0 => None,
_ => Some(Delay::from(self))
}

View File

@ -14,10 +14,10 @@ impl Delay {
pub fn from(context: &Context) -> Self {
unsafe {
Delay {
seconds: swr_get_delay(context.as_ptr(), 1),
milliseconds: swr_get_delay(context.as_ptr(), 1000),
input: swr_get_delay(context.as_ptr(), context.input().rate as int64_t),
output: swr_get_delay(context.as_ptr(), context.output().rate as int64_t),
seconds: swr_get_delay(context.as_ptr() as *mut _, 1),
milliseconds: swr_get_delay(context.as_ptr() as *mut _, 1000),
input: swr_get_delay(context.as_ptr() as *mut _, context.input().rate as int64_t),
output: swr_get_delay(context.as_ptr() as *mut _, context.output().rate as int64_t),
}
}
}

View File

@ -1,4 +1,5 @@
use ffi::*;
use ffi::SwrDitherType::*;
#[derive(Eq, PartialEq, Copy, Clone, Debug)]
pub enum Dither {
@ -23,7 +24,7 @@ impl From<SwrDitherType> for Dither {
SWR_DITHER_RECTANGULAR => Dither::Rectangular,
SWR_DITHER_TRIANGULAR => Dither::Triangular,
SWR_DITHER_TRIANGULAR_HIGHPASS => Dither::TriangularHighPass,
SWR_DITHER_NS => Dither::None,
SWR_DITHER_NS_LIPSHITZ => Dither::NoiseShapingLipshitz,
SWR_DITHER_NS_F_WEIGHTED => Dither::NoiseShapingFWeighted,
@ -44,7 +45,7 @@ impl Into<SwrDitherType> for Dither {
Dither::Rectangular => SWR_DITHER_RECTANGULAR,
Dither::Triangular => SWR_DITHER_TRIANGULAR,
Dither::TriangularHighPass => SWR_DITHER_TRIANGULAR_HIGHPASS,
Dither::NoiseShapingLipshitz => SWR_DITHER_NS_LIPSHITZ,
Dither::NoiseShapingFWeighted => SWR_DITHER_NS_F_WEIGHTED,
Dither::NoiseShapingModifiedEWeighted => SWR_DITHER_NS_MODIFIED_E_WEIGHTED,

View File

@ -1,4 +1,5 @@
use ffi::*;
use sys::SwrEngine::*;
#[derive(Eq, PartialEq, Copy, Clone, Debug)]
pub enum Engine {

View File

@ -1,4 +1,5 @@
use ffi::*;
use ffi::SwrFilterType::*;
#[derive(Eq, PartialEq, Copy, Clone, Debug)]
pub enum Filter {