mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-10-28 00:10:50 +08:00
支持原生 HDMI 和 UVC 缓冲区导出,增加同步 RKMPP 编码及可选 MJPEG 硬件转码。 校验帧布局和缓冲区租约,在 DMA 不可用或编码失败时回退到复制通路。 保留自定义码率和 GOP 策略,重开采集时同步 HDMI 源帧率,并区分 UVC 超时状态。 验证:88 个视频测试通过(含 4 个新增回归测试);ARM64 cargo check --tests 通过。
31 lines
898 B
Rust
31 lines
898 B
Rust
#[cfg(windows)]
|
|
pub mod capture;
|
|
pub mod common;
|
|
pub mod ffmpeg;
|
|
#[cfg(any(target_arch = "aarch64", target_arch = "arm", feature = "rkmpp"))]
|
|
pub mod ffmpeg_hw;
|
|
pub mod ffmpeg_ram;
|
|
#[cfg(all(
|
|
target_os = "linux",
|
|
any(target_arch = "aarch64", target_arch = "arm", feature = "rkmpp")
|
|
))]
|
|
pub mod rkmpp_dmabuf;
|
|
|
|
#[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),
|
|
_ => {}
|
|
}
|
|
}
|
|
}
|
|
}
|