Revert "vp8"

This commit is contained in:
RustDesk
2023-04-01 10:13:39 +08:00
committed by GitHub
parent 582e025145
commit 83b7518897
22 changed files with 440 additions and 469 deletions

View File

@@ -161,8 +161,8 @@ class Header: Reactor.Component {
}
function renderDisplayPop() {
var codecs = handler.alternative_codecs();
var show_codec = codecs[0] || codecs[1] || codecs[2];
var codecs = handler.supported_hwcodec();
var show_codec = handler.has_hwcodec() && (codecs[0] || codecs[1]);
var cursor_embedded = false;
if ((pi.displays || []).length > 0) {
@@ -186,10 +186,9 @@ class Header: Reactor.Component {
{show_codec ? <div>
<div .separator />
<li #auto type="codec-preference"><span>{svg_checkmark}</span>Auto</li>
{codecs[0] ? <li #vp8 type="codec-preference"><span>{svg_checkmark}</span>VP8</li> : ""}
<li #vp9 type="codec-preference"><span>{svg_checkmark}</span>VP9</li>
{codecs[1] ? <li #h264 type="codec-preference"><span>{svg_checkmark}</span>H264</li> : ""}
{codecs[2] ? <li #h265 type="codec-preference"><span>{svg_checkmark}</span>H265</li> : ""}
{codecs[0] ? <li #h264 type="codec-preference"><span>{svg_checkmark}</span>H264</li> : ""}
{codecs[1] ? <li #h265 type="codec-preference"><span>{svg_checkmark}</span>H265</li> : ""}
</div> : ""}
<div .separator />
{!cursor_embedded && <li #show-remote-cursor .toggle-option><span>{svg_checkmark}</span>{translate('Show remote cursor')}</li>}

View File

@@ -20,6 +20,7 @@ use hbb_common::{
use crate::{
client::*,
ui_interface::has_hwcodec,
ui_session_interface::{InvokeUiSession, Session},
};
@@ -196,14 +197,7 @@ impl InvokeUiSession for SciterHandler {
self.call("confirmDeleteFiles", &make_args!(id, i, name));
}
fn override_file_confirm(
&self,
id: i32,
file_num: i32,
to: String,
is_upload: bool,
is_identical: bool,
) {
fn override_file_confirm(&self, id: i32, file_num: i32, to: String, is_upload: bool, is_identical: bool) {
self.call(
"overrideFileConfirm",
&make_args!(id, file_num, to, is_upload, is_identical),
@@ -457,7 +451,8 @@ impl sciter::EventHandler for SciterSession {
fn set_write_override(i32, i32, bool, bool, bool);
fn get_keyboard_mode();
fn save_keyboard_mode(String);
fn alternative_codecs();
fn has_hwcodec();
fn supported_hwcodec();
fn change_prefer_codec();
fn restart_remote_device();
fn request_voice_call();
@@ -509,6 +504,10 @@ impl SciterSession {
v
}
fn has_hwcodec(&self) -> bool {
has_hwcodec()
}
pub fn t(&self, name: String) -> String {
crate::client::translate(name)
}
@@ -517,10 +516,9 @@ impl SciterSession {
super::get_icon()
}
fn alternative_codecs(&self) -> Value {
let (vp8, h264, h265) = self.0.alternative_codecs();
fn supported_hwcodec(&self) -> Value {
let (h264, h265) = self.0.supported_hwcodec();
let mut v = Value::array(0);
v.push(vp8);
v.push(h264);
v.push(h265);
v