mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
add enable directx option, android software encoding half resolution option (#8435)
* add option enable directx capture screen, default true Signed-off-by: 21pages <sunboeasy@gmail.com> * option android software encoding half scale, check isStart flag Signed-off-by: 21pages <sunboeasy@gmail.com> --------- Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@@ -103,6 +103,9 @@ class MainService : Service() {
|
||||
put("scale",SCREEN_INFO.scale)
|
||||
}.toString()
|
||||
}
|
||||
"is_start" -> {
|
||||
isStart.toString()
|
||||
}
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
@@ -172,10 +175,10 @@ class MainService : Service() {
|
||||
Log.d(logTag, "from rust:stop_capture")
|
||||
stopCapture()
|
||||
}
|
||||
"is_hardware_codec" -> {
|
||||
val isHwCodec = arg1.toBoolean()
|
||||
if (isHardwareCodec != isHwCodec) {
|
||||
isHardwareCodec = isHwCodec
|
||||
"half_scale" -> {
|
||||
val halfScale = arg1.toBoolean()
|
||||
if (isHalfScale != halfScale) {
|
||||
isHalfScale = halfScale
|
||||
updateScreenInfo(resources.configuration.orientation)
|
||||
}
|
||||
|
||||
@@ -251,7 +254,7 @@ class MainService : Service() {
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
private var isHardwareCodec: Boolean? = null;
|
||||
private var isHalfScale: Boolean? = null;
|
||||
private fun updateScreenInfo(orientation: Int) {
|
||||
var w: Int
|
||||
var h: Int
|
||||
@@ -284,7 +287,7 @@ class MainService : Service() {
|
||||
Log.d(logTag,"updateScreenInfo:w:$w,h:$h")
|
||||
var scale = 1
|
||||
if (w != 0 && h != 0) {
|
||||
if (isHardwareCodec == false && (w > MAX_SCREEN_SIZE || h > MAX_SCREEN_SIZE)) {
|
||||
if (isHalfScale == true && (w > MAX_SCREEN_SIZE || h > MAX_SCREEN_SIZE)) {
|
||||
scale = 2
|
||||
w /= scale
|
||||
h /= scale
|
||||
|
||||
Reference in New Issue
Block a user