util: add base
This commit is contained in:
parent
8763fd5d4c
commit
5468ea5051
@ -3,3 +3,5 @@
|
||||
extern crate libc;
|
||||
extern crate ffmpeg_sys as ffi;
|
||||
#[macro_use] extern crate bitflags;
|
||||
|
||||
pub mod util;
|
||||
|
22
src/util/mod.rs
Normal file
22
src/util/mod.rs
Normal file
@ -0,0 +1,22 @@
|
||||
use std::ffi::CStr;
|
||||
use std::str::from_utf8_unchecked;
|
||||
|
||||
use ffi::*;
|
||||
|
||||
pub fn version() -> u32 {
|
||||
unsafe {
|
||||
avutil_version()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn configuration() -> &'static str {
|
||||
unsafe {
|
||||
from_utf8_unchecked(CStr::from_ptr(avutil_configuration()).to_bytes())
|
||||
}
|
||||
}
|
||||
|
||||
pub fn license() -> &'static str {
|
||||
unsafe {
|
||||
from_utf8_unchecked(CStr::from_ptr(avutil_license()).to_bytes())
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user