mirror of
https://github.com/encounter/rust-ffmpeg.git
synced 2026-07-10 21:18:39 -07:00
chore: remove no-op register_all initializers
This commit is contained in:
+1
-16
@@ -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() }
|
||||
|
||||
@@ -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() }
|
||||
}
|
||||
|
||||
-18
@@ -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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user