Skip to main content

ffmpeg_the_third/
lib.rs

1pub use ffmpeg_sys_the_third as sys;
2pub use ffmpeg_sys_the_third as ffi;
3
4pub mod util;
5pub use crate::util::channel_layout::{
6    self, Channel, ChannelCustom, ChannelLayout, ChannelLayoutIter, ChannelLayoutMask, ChannelOrder,
7};
8pub use crate::util::{
9    chroma, color, dictionary,
10    dictionary::{Dictionary, DictionaryMut, DictionaryRef},
11    error::{self, Error},
12    frame::{self, Frame},
13    log,
14    mathematics::{self, rescale, Rescale, Rounding},
15    media, option, picture,
16    rational::{self, Rational},
17    time,
18};
19
20#[cfg(feature = "ffmpeg_8_1")]
21pub use crate::util::format::pixel::AlphaMode;
22
23#[cfg(feature = "format")]
24pub mod format;
25#[cfg(feature = "format")]
26pub use crate::format::{
27    chapter::{Chapter, ChapterMut},
28    stream::{Stream, StreamMut},
29};
30
31#[cfg(feature = "codec")]
32pub mod codec;
33#[cfg(feature = "codec")]
34pub use crate::codec::{
35    audio_service::AudioService,
36    codec::Codec,
37    decoder,
38    discard::Discard,
39    encoder,
40    field_order::FieldOrder,
41    packet::{self, Packet},
42    subtitle::{self, Subtitle},
43    threading,
44};
45
46#[cfg(feature = "device")]
47pub mod device;
48
49#[cfg(feature = "filter")]
50pub mod filter;
51#[cfg(feature = "filter")]
52pub use crate::filter::Filter;
53
54pub mod software;
55
56mod as_ptr;
57pub use as_ptr::{AsMutPtr, AsPtr};
58
59pub(crate) mod iters;
60pub(crate) mod macros;
61pub(crate) mod utils;
62
63#[cfg(not(feature = "format"))]
64fn init_format() {}
65
66#[cfg(feature = "device")]
67fn init_device() {
68    device::register_all();
69}
70
71#[cfg(not(feature = "device"))]
72fn init_device() {}
73
74#[cfg(not(feature = "filter"))]
75fn init_filter() {}
76
77pub fn init() -> Result<(), Error> {
78    init_device();
79
80    Ok(())
81}