120 lines
3.1 KiB
Rust
Raw Normal View History

2016-05-23 23:05:41 +02:00
#![allow(non_camel_case_types)]
#![allow(clippy::missing_safety_doc)]
#![allow(clippy::module_inception)]
#![allow(clippy::too_many_arguments)]
// FFI Types may differ across platforms, making casts necessary
#![allow(clippy::unnecessary_cast)]
2015-05-07 04:28:34 +02:00
#[macro_use]
extern crate bitflags;
2023-01-23 10:22:10 -05:00
pub extern crate ffmpeg_sys_the_third as sys;
#[cfg(feature = "image")]
extern crate image;
extern crate libc;
2023-01-24 02:38:11 -05:00
#[cfg(feature = "serialize")]
extern crate serde;
2015-05-07 04:32:07 +02:00
pub use crate::sys as ffi;
2015-09-04 16:36:04 +02:00
#[macro_use]
2015-05-07 04:32:07 +02:00
pub mod util;
pub use crate::util::channel_layout::{self, ChannelLayoutMask};
#[cfg(feature = "ffmpeg_5_1")]
pub use crate::util::channel_layout::{
Channel, ChannelCustom, ChannelLayout, ChannelLayoutIter, ChannelOrder,
};
pub use crate::util::chroma;
pub use crate::util::color;
pub use crate::util::dictionary;
pub use crate::util::dictionary::Mut as DictionaryMut;
pub use crate::util::dictionary::Owned as Dictionary;
pub use crate::util::dictionary::Ref as DictionaryRef;
pub use crate::util::error::{self, Error};
pub use crate::util::frame::{self, Frame};
pub use crate::util::log;
pub use crate::util::mathematics::{self, rescale, Rescale, Rounding};
pub use crate::util::media;
pub use crate::util::option;
pub use crate::util::picture;
pub use crate::util::rational::{self, Rational};
pub use crate::util::time;
2015-05-12 03:33:13 +02:00
2015-05-15 21:28:03 +02:00
#[cfg(feature = "format")]
2015-05-12 03:53:19 +02:00
pub mod format;
2015-05-15 21:28:03 +02:00
#[cfg(feature = "format")]
pub use crate::format::chapter::{Chapter, ChapterMut};
#[cfg(feature = "format")]
pub use crate::format::format::Format;
2015-05-15 21:28:03 +02:00
#[cfg(feature = "format")]
pub use crate::format::stream::{Stream, StreamMut};
2015-05-12 03:53:19 +02:00
2015-05-15 21:28:03 +02:00
#[cfg(feature = "codec")]
2015-05-12 03:33:13 +02:00
pub mod codec;
2015-05-15 21:28:03 +02:00
#[cfg(feature = "codec")]
pub use crate::codec::audio_service::AudioService;
2015-05-15 21:28:03 +02:00
#[cfg(feature = "codec")]
pub use crate::codec::codec::Codec;
2015-05-15 21:28:03 +02:00
#[cfg(feature = "codec")]
pub use crate::codec::discard::Discard;
2015-05-15 21:28:03 +02:00
#[cfg(feature = "codec")]
pub use crate::codec::field_order::FieldOrder;
2015-05-16 17:20:45 +02:00
#[cfg(feature = "codec")]
pub use crate::codec::packet::{self, Packet};
2022-01-24 21:03:47 +01:00
#[cfg(all(feature = "codec", not(feature = "ffmpeg_5_0")))]
pub use crate::codec::picture::Picture;
2015-05-16 17:24:33 +02:00
#[cfg(feature = "codec")]
pub use crate::codec::subtitle::{self, Subtitle};
#[cfg(feature = "codec")]
pub use crate::codec::threading;
#[cfg(feature = "codec")]
pub use crate::codec::{decoder, encoder};
2015-05-12 03:58:26 +02:00
2015-05-15 21:28:03 +02:00
#[cfg(feature = "device")]
2015-05-12 03:58:26 +02:00
pub mod device;
2015-05-24 18:52:28 +02:00
2015-09-04 16:36:04 +02:00
#[cfg(feature = "filter")]
pub mod filter;
#[cfg(feature = "filter")]
pub use crate::filter::Filter;
2015-09-04 16:36:04 +02:00
pub mod software;
2015-05-24 18:52:28 +02:00
fn init_error() {
util::error::register_all();
2015-05-24 18:52:28 +02:00
}
2022-01-24 21:03:47 +01:00
#[cfg(all(feature = "format", not(feature = "ffmpeg_5_0")))]
2015-05-24 18:52:28 +02:00
fn init_format() {
format::register_all();
2015-05-24 18:52:28 +02:00
}
#[cfg(not(feature = "format"))]
fn init_format() {}
2015-05-24 18:52:28 +02:00
#[cfg(feature = "device")]
fn init_device() {
device::register_all();
2015-05-24 18:52:28 +02:00
}
#[cfg(not(feature = "device"))]
fn init_device() {}
2015-05-24 18:52:28 +02:00
2022-01-24 21:03:47 +01:00
#[cfg(all(feature = "filter", not(feature = "ffmpeg_5_0")))]
2015-09-04 16:36:04 +02:00
fn init_filter() {
filter::register_all();
2015-09-04 16:36:04 +02:00
}
#[cfg(not(feature = "filter"))]
fn init_filter() {}
2015-09-04 16:36:04 +02:00
2015-05-24 18:52:28 +02:00
pub fn init() -> Result<(), Error> {
init_error();
2022-01-24 21:03:47 +01:00
#[cfg(not(feature = "ffmpeg_5_0"))]
init_format();
init_device();
2022-01-24 21:03:47 +01:00
#[cfg(not(feature = "ffmpeg_5_0"))]
init_filter();
2015-05-24 18:52:28 +02:00
Ok(())
2015-05-24 18:52:28 +02:00
}