mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-09-13 11:04:25 +08:00
feat: 适配 RK 原生 HDMI IN 适配采集
This commit is contained in:
@@ -243,7 +243,8 @@ fn enumerate_candidate_codecs(ctx: &EncodeContext) -> Vec<CodecInfo> {
|
||||
}
|
||||
|
||||
codecs.retain(|codec| {
|
||||
!(ctx.pixfmt == AVPixelFormat::AV_PIX_FMT_YUV420P && codec.name.contains("qsv"))
|
||||
!(ctx.pixfmt == AVPixelFormat::AV_PIX_FMT_YUV420P as i32
|
||||
&& codec.name.contains("qsv"))
|
||||
});
|
||||
codecs
|
||||
}
|
||||
@@ -428,7 +429,7 @@ pub struct EncodeContext {
|
||||
pub mc_name: Option<String>,
|
||||
pub width: i32,
|
||||
pub height: i32,
|
||||
pub pixfmt: AVPixelFormat,
|
||||
pub pixfmt: i32,
|
||||
pub align: i32,
|
||||
pub fps: i32,
|
||||
pub gop: i32,
|
||||
@@ -483,7 +484,7 @@ impl Encoder {
|
||||
CString::new(mc_name.as_str()).map_err(|_| ())?.as_ptr(),
|
||||
ctx.width,
|
||||
ctx.height,
|
||||
ctx.pixfmt as c_int,
|
||||
ctx.pixfmt,
|
||||
ctx.align,
|
||||
ctx.fps,
|
||||
ctx.gop,
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
use crate::common::DataFormat::{self, *};
|
||||
use crate::ffmpeg::{
|
||||
AVHWDeviceType::{self, *},
|
||||
AVPixelFormat,
|
||||
};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use std::ffi::c_int;
|
||||
@@ -234,7 +233,7 @@ impl CodecInfos {
|
||||
}
|
||||
|
||||
pub fn ffmpeg_linesize_offset_length(
|
||||
pixfmt: AVPixelFormat,
|
||||
pixfmt: i32,
|
||||
width: usize,
|
||||
height: usize,
|
||||
align: usize,
|
||||
@@ -247,7 +246,7 @@ pub fn ffmpeg_linesize_offset_length(
|
||||
length.resize(1, 0);
|
||||
unsafe {
|
||||
if ffmpeg_ram_get_linesize_offset_length(
|
||||
pixfmt as _,
|
||||
pixfmt,
|
||||
width as _,
|
||||
height as _,
|
||||
align as _,
|
||||
|
||||
Reference in New Issue
Block a user