improve waiting for image when only one image received (#7340)
* fix padding of mobile server page PopupMenuItem Signed-off-by: 21pages <pages21@163.com> * improve waiting for image when only one image received * For flutter texture late creation: create texture between session add and session start, it works not in principle but in test. * For late PeerInfo handling a. rgba texture render: allow zero size in on_rgba b. gpu texture render and rgba buffer render doesn't check size currently * Fix wrong valid flag of first frame in rgba texture render Other issues: * decodeImageFromPixels may fail on first image * Correct width/height when resolution changes Signed-off-by: 21pages <pages21@163.com> --------- Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
262814391a
commit
dcbe2805e6
@ -42,25 +42,21 @@ class ServerPage extends StatefulWidget implements PageShape {
|
|||||||
return [
|
return [
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
enabled: gFFI.serverModel.connectStatus > 0,
|
enabled: gFFI.serverModel.connectStatus > 0,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
|
||||||
value: "changeID",
|
value: "changeID",
|
||||||
child: Text(translate("Change ID")),
|
child: Text(translate("Change ID")),
|
||||||
),
|
),
|
||||||
const PopupMenuDivider(),
|
const PopupMenuDivider(),
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 0.0),
|
|
||||||
value: 'AcceptSessionsViaPassword',
|
value: 'AcceptSessionsViaPassword',
|
||||||
child: listTile(
|
child: listTile(
|
||||||
'Accept sessions via password', approveMode == 'password'),
|
'Accept sessions via password', approveMode == 'password'),
|
||||||
),
|
),
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 0.0),
|
|
||||||
value: 'AcceptSessionsViaClick',
|
value: 'AcceptSessionsViaClick',
|
||||||
child:
|
child:
|
||||||
listTile('Accept sessions via click', approveMode == 'click'),
|
listTile('Accept sessions via click', approveMode == 'click'),
|
||||||
),
|
),
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 0.0),
|
|
||||||
value: "AcceptSessionsViaBoth",
|
value: "AcceptSessionsViaBoth",
|
||||||
child: listTile("Accept sessions via both",
|
child: listTile("Accept sessions via both",
|
||||||
approveMode != 'password' && approveMode != 'click'),
|
approveMode != 'password' && approveMode != 'click'),
|
||||||
@ -69,35 +65,30 @@ class ServerPage extends StatefulWidget implements PageShape {
|
|||||||
if (showPasswordOption &&
|
if (showPasswordOption &&
|
||||||
verificationMethod != kUseTemporaryPassword)
|
verificationMethod != kUseTemporaryPassword)
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
|
||||||
value: "setPermanentPassword",
|
value: "setPermanentPassword",
|
||||||
child: Text(translate("Set permanent password")),
|
child: Text(translate("Set permanent password")),
|
||||||
),
|
),
|
||||||
if (showPasswordOption &&
|
if (showPasswordOption &&
|
||||||
verificationMethod != kUsePermanentPassword)
|
verificationMethod != kUsePermanentPassword)
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
|
||||||
value: "setTemporaryPasswordLength",
|
value: "setTemporaryPasswordLength",
|
||||||
child: Text(translate("One-time password length")),
|
child: Text(translate("One-time password length")),
|
||||||
),
|
),
|
||||||
if (showPasswordOption) const PopupMenuDivider(),
|
if (showPasswordOption) const PopupMenuDivider(),
|
||||||
if (showPasswordOption)
|
if (showPasswordOption)
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 0.0),
|
|
||||||
value: kUseTemporaryPassword,
|
value: kUseTemporaryPassword,
|
||||||
child: listTile('Use one-time password',
|
child: listTile('Use one-time password',
|
||||||
verificationMethod == kUseTemporaryPassword),
|
verificationMethod == kUseTemporaryPassword),
|
||||||
),
|
),
|
||||||
if (showPasswordOption)
|
if (showPasswordOption)
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 0.0),
|
|
||||||
value: kUsePermanentPassword,
|
value: kUsePermanentPassword,
|
||||||
child: listTile('Use permanent password',
|
child: listTile('Use permanent password',
|
||||||
verificationMethod == kUsePermanentPassword),
|
verificationMethod == kUsePermanentPassword),
|
||||||
),
|
),
|
||||||
if (showPasswordOption)
|
if (showPasswordOption)
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 0.0),
|
|
||||||
value: kUseBothPasswords,
|
value: kUseBothPasswords,
|
||||||
child: listTile(
|
child: listTile(
|
||||||
'Use both passwords',
|
'Use both passwords',
|
||||||
|
@ -8,6 +8,7 @@ import 'package:texture_rgba_renderer/texture_rgba_renderer.dart';
|
|||||||
import '../../common.dart';
|
import '../../common.dart';
|
||||||
import './platform_model.dart';
|
import './platform_model.dart';
|
||||||
|
|
||||||
|
// Feature flutter_texture_render need to be enabled if feature gpucodec is enabled.
|
||||||
final useTextureRender =
|
final useTextureRender =
|
||||||
bind.mainHasPixelbufferTextureRender() || bind.mainHasGpuTextureRender();
|
bind.mainHasPixelbufferTextureRender() || bind.mainHasGpuTextureRender();
|
||||||
|
|
||||||
|
@ -387,7 +387,8 @@ class FfiModel with ChangeNotifier {
|
|||||||
|
|
||||||
onUrlSchemeReceived(Map<String, dynamic> evt) {
|
onUrlSchemeReceived(Map<String, dynamic> evt) {
|
||||||
final url = evt['url'].toString().trim();
|
final url = evt['url'].toString().trim();
|
||||||
if (url.startsWith(bind.mainUriPrefixSync()) && handleUriLink(uriString: url)) {
|
if (url.startsWith(bind.mainUriPrefixSync()) &&
|
||||||
|
handleUriLink(uriString: url)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (url) {
|
switch (url) {
|
||||||
@ -2228,6 +2229,9 @@ class FFI {
|
|||||||
sessionId: sessionId, displays: Int32List.fromList(displays));
|
sessionId: sessionId, displays: Int32List.fromList(displays));
|
||||||
ffiModel.pi.currentDisplay = display;
|
ffiModel.pi.currentDisplay = display;
|
||||||
}
|
}
|
||||||
|
if (connType == ConnType.defaultConn && useTextureRender) {
|
||||||
|
textureModel.updateCurrentDisplay(display ?? 0);
|
||||||
|
}
|
||||||
final stream = bind.sessionStart(sessionId: sessionId, id: id);
|
final stream = bind.sessionStart(sessionId: sessionId, id: id);
|
||||||
final cb = ffiModel.startEventListener(sessionId, id);
|
final cb = ffiModel.startEventListener(sessionId, id);
|
||||||
|
|
||||||
|
@ -400,7 +400,6 @@ impl VideoRenderer {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// It is also Ok to skip this check.
|
|
||||||
if info.size.0 != rgba.w || info.size.1 != rgba.h {
|
if info.size.0 != rgba.w || info.size.1 != rgba.h {
|
||||||
log::error!(
|
log::error!(
|
||||||
"width/height mismatch: ({},{}) != ({},{})",
|
"width/height mismatch: ({},{}) != ({},{})",
|
||||||
@ -409,7 +408,11 @@ impl VideoRenderer {
|
|||||||
rgba.w,
|
rgba.w,
|
||||||
rgba.h
|
rgba.h
|
||||||
);
|
);
|
||||||
return false;
|
// Peer info's handling is async and may be late than video frame's handling
|
||||||
|
// Allow peer info not set, but not allow wrong width/height for correct local cursor position
|
||||||
|
if info.size != (0, 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if let Some(func) = &self.on_rgba_func {
|
if let Some(func) = &self.on_rgba_func {
|
||||||
unsafe {
|
unsafe {
|
||||||
@ -763,6 +766,7 @@ impl InvokeUiSession for FlutterHandler {
|
|||||||
} else {
|
} else {
|
||||||
let mut rgba_data = RgbaData::default();
|
let mut rgba_data = RgbaData::default();
|
||||||
std::mem::swap::<Vec<u8>>(&mut rgba.raw, &mut rgba_data.data);
|
std::mem::swap::<Vec<u8>>(&mut rgba.raw, &mut rgba_data.data);
|
||||||
|
rgba_data.valid = true;
|
||||||
rgba_write_lock.insert(display, rgba_data);
|
rgba_write_lock.insert(display, rgba_data);
|
||||||
}
|
}
|
||||||
drop(rgba_write_lock);
|
drop(rgba_write_lock);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user