mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-25 14:11:14 +03:00
update hwcodec, add windows ffmpeg vram encoding (#7876)
* windows add ffmpeg vram encoding * windows add missing nvenc and qsv ram encoding, linux add vaapi, current codec table: https://github.com/21pages/hwcodec?tab=readme-ov-file#codec Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -208,12 +208,13 @@ impl Encoder {
|
||||
let mut h265hw_encoding = None;
|
||||
#[cfg(feature = "hwcodec")]
|
||||
if enable_hwcodec_option() {
|
||||
let best = HwRamEncoder::best();
|
||||
if _all_support_h264_decoding {
|
||||
h264hw_encoding = best.h264.map_or(None, |c| Some(c.name));
|
||||
h264hw_encoding =
|
||||
HwRamEncoder::try_get(CodecFormat::H264).map_or(None, |c| Some(c.name));
|
||||
}
|
||||
if _all_support_h265_decoding {
|
||||
h265hw_encoding = best.h265.map_or(None, |c| Some(c.name));
|
||||
h265hw_encoding =
|
||||
HwRamEncoder::try_get(CodecFormat::H265).map_or(None, |c| Some(c.name));
|
||||
}
|
||||
}
|
||||
let h264_useable =
|
||||
@@ -317,9 +318,8 @@ impl Encoder {
|
||||
};
|
||||
#[cfg(feature = "hwcodec")]
|
||||
if enable_hwcodec_option() {
|
||||
let best = HwRamEncoder::best();
|
||||
encoding.h264 |= best.h264.is_some();
|
||||
encoding.h265 |= best.h265.is_some();
|
||||
encoding.h264 |= HwRamEncoder::try_get(CodecFormat::H264).is_some();
|
||||
encoding.h265 |= HwRamEncoder::try_get(CodecFormat::H265).is_some();
|
||||
}
|
||||
#[cfg(feature = "vram")]
|
||||
if enable_vram_option() {
|
||||
@@ -410,9 +410,16 @@ impl Decoder {
|
||||
};
|
||||
#[cfg(feature = "hwcodec")]
|
||||
{
|
||||
let best = HwRamDecoder::best();
|
||||
decoding.ability_h264 |= if best.h264.is_some() { 1 } else { 0 };
|
||||
decoding.ability_h265 |= if best.h265.is_some() { 1 } else { 0 };
|
||||
decoding.ability_h264 |= if HwRamDecoder::try_get(CodecFormat::H264).is_some() {
|
||||
1
|
||||
} else {
|
||||
0
|
||||
};
|
||||
decoding.ability_h265 |= if HwRamDecoder::try_get(CodecFormat::H265).is_some() {
|
||||
1
|
||||
} else {
|
||||
0
|
||||
};
|
||||
}
|
||||
#[cfg(feature = "vram")]
|
||||
if enable_vram_option() && _flutter {
|
||||
|
||||
Reference in New Issue
Block a user