2016-05-23 23:05:41 +02:00
|
|
|
#![allow(non_camel_case_types)]
|
2020-07-26 01:00:54 +08:00
|
|
|
#![allow(clippy::missing_safety_doc)]
|
|
|
|
#![allow(clippy::module_inception)]
|
|
|
|
#![allow(clippy::too_many_arguments)]
|
2023-02-02 13:25:17 -05:00
|
|
|
// FFI Types may differ across platforms, making casts necessary
|
|
|
|
#![allow(clippy::unnecessary_cast)]
|
2015-05-07 04:28:34 +02:00
|
|
|
|
2018-04-10 17:06:42 +03:00
|
|
|
#[macro_use]
|
|
|
|
extern crate bitflags;
|
2023-01-23 10:22:10 -05:00
|
|
|
pub extern crate ffmpeg_sys_the_third as sys;
|
2018-04-10 17:06:42 +03:00
|
|
|
#[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
|
|
|
|
2024-04-07 03:31:36 +02:00
|
|
|
pub use crate::sys as ffi;
|
2015-09-04 16:36:04 +02:00
|
|
|
|
2015-10-26 20:25:44 +01:00
|
|
|
#[macro_use]
|
2015-05-07 04:32:07 +02:00
|
|
|
pub mod util;
|
2024-04-23 14:59:15 +02:00
|
|
|
pub use crate::util::channel_layout::{self, ChannelLayoutMask};
|
|
|
|
#[cfg(feature = "ffmpeg_5_1")]
|
|
|
|
pub use crate::util::channel_layout::{
|
|
|
|
Channel, ChannelCustom, ChannelLayout, ChannelLayoutIter, ChannelOrder,
|
|
|
|
};
|
2024-04-07 03:31:36 +02:00
|
|
|
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")]
|
2024-04-07 03:31:36 +02:00
|
|
|
pub use crate::format::chapter::{Chapter, ChapterMut};
|
2018-04-10 17:06:42 +03:00
|
|
|
#[cfg(feature = "format")]
|
2024-04-07 03:31:36 +02:00
|
|
|
pub use crate::format::format::Format;
|
2015-05-15 21:28:03 +02:00
|
|
|
#[cfg(feature = "format")]
|
2024-04-07 03:31:36 +02:00
|
|
|
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")]
|
2024-04-07 03:31:36 +02:00
|
|
|
pub use crate::codec::audio_service::AudioService;
|
2015-05-15 21:28:03 +02:00
|
|
|
#[cfg(feature = "codec")]
|
2024-04-07 03:31:36 +02:00
|
|
|
pub use crate::codec::codec::Codec;
|
2015-05-15 21:28:03 +02:00
|
|
|
#[cfg(feature = "codec")]
|
2024-04-07 03:31:36 +02:00
|
|
|
pub use crate::codec::discard::Discard;
|
2015-05-15 21:28:03 +02:00
|
|
|
#[cfg(feature = "codec")]
|
2024-04-07 03:31:36 +02:00
|
|
|
pub use crate::codec::field_order::FieldOrder;
|
2015-05-16 17:20:45 +02:00
|
|
|
#[cfg(feature = "codec")]
|
2024-04-07 03:31:36 +02:00
|
|
|
pub use crate::codec::packet::{self, Packet};
|
2022-01-24 21:03:47 +01:00
|
|
|
#[cfg(all(feature = "codec", not(feature = "ffmpeg_5_0")))]
|
2024-04-07 03:31:36 +02:00
|
|
|
pub use crate::codec::picture::Picture;
|
2015-05-16 17:24:33 +02:00
|
|
|
#[cfg(feature = "codec")]
|
2024-04-07 03:31:36 +02:00
|
|
|
pub use crate::codec::subtitle::{self, Subtitle};
|
2015-05-16 19:18:26 +02:00
|
|
|
#[cfg(feature = "codec")]
|
2024-04-07 03:31:36 +02:00
|
|
|
pub use crate::codec::threading;
|
2018-04-10 17:06:42 +03:00
|
|
|
#[cfg(feature = "codec")]
|
2024-04-07 03:31:36 +02:00
|
|
|
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")]
|
2024-04-07 03:31:36 +02:00
|
|
|
pub use crate::filter::Filter;
|
2015-09-04 16:36:04 +02:00
|
|
|
|
2015-05-28 18:15:52 +02:00
|
|
|
pub mod software;
|
|
|
|
|
2015-05-24 18:52:28 +02:00
|
|
|
fn init_error() {
|
2018-04-10 17:06:42 +03:00
|
|
|
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() {
|
2018-04-10 17:06:42 +03:00
|
|
|
format::register_all();
|
2015-05-24 18:52:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(feature = "format"))]
|
2018-04-10 17:06:42 +03:00
|
|
|
fn init_format() {}
|
2015-05-24 18:52:28 +02:00
|
|
|
|
|
|
|
#[cfg(feature = "device")]
|
|
|
|
fn init_device() {
|
2018-04-10 17:06:42 +03:00
|
|
|
device::register_all();
|
2015-05-24 18:52:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(feature = "device"))]
|
2018-04-10 17:06:42 +03:00
|
|
|
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() {
|
2018-04-10 17:06:42 +03:00
|
|
|
filter::register_all();
|
2015-09-04 16:36:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(feature = "filter"))]
|
2018-04-10 17:06:42 +03:00
|
|
|
fn init_filter() {}
|
2015-09-04 16:36:04 +02:00
|
|
|
|
2015-05-24 18:52:28 +02:00
|
|
|
pub fn init() -> Result<(), Error> {
|
2018-04-10 17:06:42 +03:00
|
|
|
init_error();
|
2022-01-24 21:03:47 +01:00
|
|
|
#[cfg(not(feature = "ffmpeg_5_0"))]
|
2018-04-10 17:06:42 +03:00
|
|
|
init_format();
|
|
|
|
init_device();
|
2022-01-24 21:03:47 +01:00
|
|
|
#[cfg(not(feature = "ffmpeg_5_0"))]
|
2018-04-10 17:06:42 +03:00
|
|
|
init_filter();
|
2015-05-24 18:52:28 +02:00
|
|
|
|
2018-04-10 17:06:42 +03:00
|
|
|
Ok(())
|
2015-05-24 18:52:28 +02:00
|
|
|
}
|