mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-19 19:21:13 +03:00
This reverts commit 80afa98d66.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::{
|
||||
codec::{base_bitrate, codec_thread_num, EncoderApi, EncoderCfg, ExtraEncoderCfg},
|
||||
codec::{base_bitrate, codec_thread_num, EncoderApi, EncoderCfg},
|
||||
hw, ImageFormat, ImageRgb, Pixfmt, HW_STRIDE_ALIGN,
|
||||
};
|
||||
use hbb_common::{
|
||||
@@ -36,11 +36,10 @@ pub struct HwEncoder {
|
||||
width: u32,
|
||||
height: u32,
|
||||
bitrate: u32, //kbs
|
||||
extra: ExtraEncoderCfg,
|
||||
}
|
||||
|
||||
impl EncoderApi for HwEncoder {
|
||||
fn new(cfg: EncoderCfg, extra: ExtraEncoderCfg) -> ResultType<Self>
|
||||
fn new(cfg: EncoderCfg, _i444: bool) -> ResultType<Self>
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
@@ -83,7 +82,6 @@ impl EncoderApi for HwEncoder {
|
||||
width: ctx.width as _,
|
||||
height: ctx.height as _,
|
||||
bitrate,
|
||||
extra,
|
||||
}),
|
||||
Err(_) => Err(anyhow!(format!("Failed to create encoder"))),
|
||||
}
|
||||
@@ -122,7 +120,7 @@ impl EncoderApi for HwEncoder {
|
||||
let pixfmt = if self.pixfmt == AVPixelFormat::AV_PIX_FMT_NV12 {
|
||||
Pixfmt::NV12
|
||||
} else {
|
||||
Pixfmt::YUV420P
|
||||
Pixfmt::I420
|
||||
};
|
||||
let stride = self
|
||||
.encoder
|
||||
@@ -133,7 +131,6 @@ impl EncoderApi for HwEncoder {
|
||||
.collect();
|
||||
crate::EncodeYuvFormat {
|
||||
pixfmt,
|
||||
range: self.extra.range,
|
||||
w: self.encoder.ctx.width as _,
|
||||
h: self.encoder.ctx.height as _,
|
||||
stride,
|
||||
|
||||
Reference in New Issue
Block a user