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:
21pages
2024-03-08 17:24:02 +08:00
committed by GitHub
parent 262814391a
commit dcbe2805e6
4 changed files with 12 additions and 12 deletions

View File

@@ -400,7 +400,6 @@ impl VideoRenderer {
return false;
}
// It is also Ok to skip this check.
if info.size.0 != rgba.w || info.size.1 != rgba.h {
log::error!(
"width/height mismatch: ({},{}) != ({},{})",
@@ -409,7 +408,11 @@ impl VideoRenderer {
rgba.w,
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 {
unsafe {
@@ -763,6 +766,7 @@ impl InvokeUiSession for FlutterHandler {
} else {
let mut rgba_data = RgbaData::default();
std::mem::swap::<Vec<u8>>(&mut rgba.raw, &mut rgba_data.data);
rgba_data.valid = true;
rgba_write_lock.insert(display, rgba_data);
}
drop(rgba_write_lock);