mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-03 11:31:53 +08:00
init
This commit is contained in:
26
libs/hwcodec/src/lib.rs
Normal file
26
libs/hwcodec/src/lib.rs
Normal file
@@ -0,0 +1,26 @@
|
||||
pub mod common;
|
||||
pub mod ffmpeg;
|
||||
pub mod ffmpeg_ram;
|
||||
pub mod mux;
|
||||
#[cfg(all(windows, feature = "vram"))]
|
||||
pub mod vram;
|
||||
#[cfg(target_os = "android")]
|
||||
pub mod android;
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn hwcodec_log(level: i32, message: *const std::os::raw::c_char) {
|
||||
unsafe {
|
||||
let c_str = std::ffi::CStr::from_ptr(message);
|
||||
if let Ok(str_slice) = c_str.to_str() {
|
||||
let string = String::from(str_slice);
|
||||
match level {
|
||||
0 => log::error!("{}", string),
|
||||
1 => log::warn!("{}", string),
|
||||
2 => log::info!("{}", string),
|
||||
3 => log::debug!("{}", string),
|
||||
4 => log::trace!("{}", string),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user