diff --git a/src/filter/mod.rs b/src/filter/mod.rs index 271d9ad..d675ab7 100644 --- a/src/filter/mod.rs +++ b/src/filter/mod.rs @@ -17,22 +17,7 @@ use std::{ }; pub use self::graph::Graph; -use crate::{ffi::*, Error}; - -pub fn register_all() { - unsafe { - avfilter_register_all(); - } -} - -pub fn register(filter: &Filter) -> Result<(), Error> { - unsafe { - match avfilter_register(filter.as_ptr() as *mut _) { - 0 => Ok(()), - _ => Err(Error::InvalidData), - } - } -} +use crate::ffi::*; pub fn version() -> u32 { unsafe { avfilter_version() } diff --git a/src/format/mod.rs b/src/format/mod.rs index 1cc766f..6f1353c 100644 --- a/src/format/mod.rs +++ b/src/format/mod.rs @@ -22,24 +22,6 @@ use std::{ use crate::{ffi::*, util::from_os_str, Dictionary, Error, Format}; -pub fn register_all() { - unsafe { - av_register_all(); - } -} - -pub fn register(format: &Format) { - match *format { - Format::Input(ref format) => unsafe { - av_register_input_format(format.as_ptr() as *mut _); - }, - - Format::Output(ref format) => unsafe { - av_register_output_format(format.as_ptr() as *mut _); - }, - } -} - pub fn version() -> u32 { unsafe { avformat_version() } } diff --git a/src/lib.rs b/src/lib.rs index 444584c..1c8fcb3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -70,14 +70,6 @@ fn init_util() { util::log::register(); } -#[cfg(feature = "format")] -fn init_format() { - format::register_all(); -} - -#[cfg(not(feature = "format"))] -fn init_format() {} - #[cfg(feature = "device")] fn init_device() { device::register_all(); @@ -86,19 +78,9 @@ fn init_device() { #[cfg(not(feature = "device"))] fn init_device() {} -#[cfg(feature = "filter")] -fn init_filter() { - filter::register_all(); -} - -#[cfg(not(feature = "filter"))] -fn init_filter() {} - pub fn init() -> Result<()> { init_util(); - init_format(); init_device(); - init_filter(); Ok(()) }