mirror of
https://github.com/netbirdio/IronRDP.git
synced 2026-05-22 18:43:12 -07:00
refactor(server)!: use bytes, allowing shareable bitmap data
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
committed by
Benoît Cortier
parent
7f57817805
commit
3c43fdda76
Generated
+1
@@ -2673,6 +2673,7 @@ version = "0.5.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
"bytes",
|
||||
"ironrdp-acceptor",
|
||||
"ironrdp-ainput",
|
||||
"ironrdp-async",
|
||||
|
||||
@@ -15,7 +15,7 @@ pub fn rfx_enc_tile_bench(c: &mut Criterion) {
|
||||
width: NonZero::new(64).unwrap(),
|
||||
height: NonZero::new(64).unwrap(),
|
||||
format: ironrdp_server::PixelFormat::ARgb32,
|
||||
data: vec![0; 64 * 64 * 4],
|
||||
data: vec![0; 64 * 64 * 4].into(),
|
||||
stride: 64 * 4,
|
||||
};
|
||||
c.bench_function("rfx_enc_tile", |b| b.iter(|| rfx_enc_tile(&bitmap, &quant, algo, 0, 0)));
|
||||
@@ -30,7 +30,7 @@ pub fn rfx_enc_bench(c: &mut Criterion) {
|
||||
width: NonZero::new(2048).unwrap(),
|
||||
height: NonZero::new(2048).unwrap(),
|
||||
format: ironrdp_server::PixelFormat::ARgb32,
|
||||
data: vec![0; 2048 * 2048 * 4],
|
||||
data: vec![0; 2048 * 2048 * 4].into(),
|
||||
stride: 64 * 4,
|
||||
};
|
||||
c.bench_function("rfx_enc", |b| b.iter(|| rfx_enc(&bitmap, &quant, algo)));
|
||||
|
||||
@@ -45,6 +45,7 @@ tracing = { version = "0.1", features = ["log"] }
|
||||
x509-cert = { version = "0.2.5", optional = true }
|
||||
rustls-pemfile = { version = "2.2.0", optional = true }
|
||||
rayon = { version = "1.10.0", optional = true }
|
||||
bytes = "1"
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "1", features = ["sync"] }
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use core::num::NonZeroU16;
|
||||
|
||||
use anyhow::Result;
|
||||
use bytes::Bytes;
|
||||
use ironrdp_displaycontrol::pdu::DisplayControlMonitorLayout;
|
||||
use ironrdp_pdu::pointer::PointerPositionAttribute;
|
||||
|
||||
@@ -67,7 +68,7 @@ pub struct BitmapUpdate {
|
||||
pub width: NonZeroU16,
|
||||
pub height: NonZeroU16,
|
||||
pub format: PixelFormat,
|
||||
pub data: Vec<u8>,
|
||||
pub data: Bytes,
|
||||
pub stride: usize,
|
||||
}
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ impl RdpServerDisplayUpdates for DisplayUpdates {
|
||||
width,
|
||||
height,
|
||||
format: PixelFormat::BgrA32,
|
||||
data,
|
||||
data: data.into(),
|
||||
stride: usize::from(width.get()).checked_mul(4).unwrap(),
|
||||
};
|
||||
Some(DisplayUpdate::Bitmap(bitmap))
|
||||
|
||||
Reference in New Issue
Block a user