diff --git a/src/format/mod.rs b/src/format/mod.rs new file mode 100644 index 0000000..38ba03b --- /dev/null +++ b/src/format/mod.rs @@ -0,0 +1,22 @@ +use std::ffi::CStr; +use std::str::from_utf8_unchecked; + +use ffi::*; + +pub fn version() -> u32 { + unsafe { + avformat_version() + } +} + +pub fn configuration() -> &'static str { + unsafe { + from_utf8_unchecked(CStr::from_ptr(avformat_configuration()).to_bytes()) + } +} + +pub fn license() -> &'static str { + unsafe { + from_utf8_unchecked(CStr::from_ptr(avformat_license()).to_bytes()) + } +} diff --git a/src/lib.rs b/src/lib.rs index 0007dcb..f36d76d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,6 +14,8 @@ pub use util::color_range::ColorRange; pub use util::media; pub use util::frame::{self, Frame}; +pub mod format; + pub mod codec; pub use codec::packet::{self, Packet}; pub use codec::subtitle::Subtitle;