Commit graph

130 commits

Author SHA1 Message Date
Marc-André Lureau
d8f2d10558 fix(server): add BitmapUpdate stride support follow-up
Fixes a73e0b7870

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-19 06:44:15 -04:00
Marc-André Lureau
8843e11b55 fix(server): error early for bitmap encoding if width % 4 != 0
This is not supported yet, and I am not sure how to do it atm.

Generally, server uses multiple of 4 widths, and client has surface
capabilities, so this path is unlikely.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-19 06:44:15 -04:00
Benoît Cortier
a6d6c2728b
refactor: follow up to PR 530 (#531) 2024-08-14 07:30:51 -04:00
Marc-André Lureau
a73e0b7870 feat(server): add BitmapUpdate stride support
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-14 00:37:06 -04:00
Marc-André Lureau
c73330b491 fix(server): fix rfx channel dimensions
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-14 00:37:06 -04:00
Marc-André Lureau
36a08292d5 feat(server): add DisplayUpdate::Resize event
Trigger a deactivation-reactivation sequence to handle desktop resize.

dfc234ce-481a-4674-9a5d-2a7bafb14432

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-14 00:37:06 -04:00
Marc-André Lureau
1df06f43c6 refactor(server): factorize out attaching channels
So the function can be reused for deactivation-reactivation sequence.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-14 00:37:06 -04:00
Marc-André Lureau
2c036c4217 refactor(server): introduce RunState
Use an explicit enum to return the client loop/run state from the
handlers. This will allow to return a DeactivationReactivation sequence
state from the display handler next.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-14 00:37:06 -04:00
Marc-André Lureau
ba97d5ceb5 refactor(server): report error!() at run_connection() level
Instead of reporting the error in various places, move error reporting
code to one place and simplify a bit the code thanks for anyhow::Context
and Result handling.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-14 00:37:06 -04:00
Marc-André Lureau
194763fd6d refactor(server): move finalize phase
Move finalize phase to a separate function, so we can introduce common
code for looping next, with deactivation-reactivation sequence. Also use
anyhow::Context instead of manually handling errors.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-14 00:37:06 -04:00
Marc-André Lureau
e0657b07d2 feat(displaycontrol): add DisplayControlHandler
Teach the server to call a DisplayControlHandler to
notify of monitor layout requests.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-14 00:37:06 -04:00
Marc-André Lureau
757b50941c refactor(server): manually implement Debug for RGBAPointer
So we can skip dumping the "data" field.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-14 00:37:06 -04:00
Marc-Andre Lureau
43157f64e9
RFC: feat(server): flush server events, avoid audio buffer filling up (#518)
When display updates and server events are competing, tokio::select!()
will randomly pick one branch and process one event.

This is good for fairness, except when the display updates are big, and
delay other messages for example wave data. We may end up in a situation
where the server events queue grows and audio data gets delayed.

To avoid this situation, let's flush all server events and drop audio
frames when they are queuing up.

This introduce some bias for server events, since all pending server
events will be processed before other updates/inputs.

There are many different ways to tackle the problem, this simple
approach seems to work fine atm.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-05 14:52:21 +00:00
Marc-André Lureau
902b5b392d refactor(server): refactor to split fn client_loop()
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-05 10:24:45 -04:00
Marc-André Lureau
9171cd7083 refactor(server): refactor to fn dispatch_server_event()
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-05 10:24:45 -04:00
Marc-André Lureau
c53b88ebac refactor(server): refactor to fn dispatch_display_update()
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-05 10:24:45 -04:00
Marc-André Lureau
da53d45b44 refactor(server): refactor to fn dispatch_pdu()
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-05 10:24:45 -04:00
Marc-André Lureau
f4476ec69a feat(server): derive PartialEq for PixelOrder
To allow simple comparisons.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-08-05 10:24:45 -04:00
Marc-Andre Lureau
b6a839e248
feat(server): add Quit event (#505)
Learn to exit the run() loop from user.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-07-26 02:11:39 -04:00
Marc-André Lureau
7307148cb8 chore: use workspace lints
Among other things, this allows tools and LSP to pick up our settings.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-07-24 04:35:32 -04:00
Marc-André Lureau
adf2797ef7 fix: unnecessary qualification
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-07-24 04:35:32 -04:00
Marc-Andre Lureau
fe293cd144
feat(server): re-export external dependencies whose types appear in API (#501)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-07-23 08:37:48 -04:00
Benoît Cortier
0c352c4711
chore(deps): update rustls dependency (#492) 2024-07-10 10:11:17 -04:00
Benoît Cortier
cae242bbe4
refactor: follow up to PR #467 (#491) 2024-07-10 08:41:08 -04:00
Marc-André Lureau
43b6cdb93f feat(server): start sound support
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-07-09 21:55:01 -04:00
Marc-André Lureau
d8d2326ad3 feat(server): drop static channels on end of client loop
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-07-09 21:55:01 -04:00
Marc-André Lureau
dfad96c3bc build(server): add tokio 'sync' feature as dev-dependency
In order to succesfully build the server example.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-07-09 21:55:01 -04:00
Isaiah Becker-Mayer
fd105e4b56
feat(displaycontrol): hook up resize for ironrdp-client crate (#430) 2024-04-29 22:20:02 +03:00
Marc-André Lureau
4035543d13 feat(server): set the server event sender on the clipboard
Introduce a ServerEventSender trait to set the ServerEvent channel on a
clipboard handler/factory.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-04-05 13:05:04 -04:00
Marc-André Lureau
649478baa4 feat(server): add clipboard events
Teach the clipboard implementation to emit events/reply.

This follows the client event dispatch mechanism, although I would
rather have a way for the clipboard backend to directly call to the
channel to emit messages (rather than having to dispatch explicitly all
possible events at the top-level server loop)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-04-05 13:05:04 -04:00
Marc-André Lureau
3fe6577d15 fix(server): drop the need for Send on clipboard
It looks like this was introduced by mistake.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-04-05 13:05:04 -04:00
Marc-André Lureau
7b5c4a73fb feat(server): add ServerEvent
Add a channel to send events to the server loop.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-04-05 13:05:04 -04:00
Marc-André Lureau
d46e7964bf feat(server): add pointer DisplayUpdate
Add DisplayUpdate API to set the pointer simply (no cache, with 32bpp
RGBA etc)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-04-03 11:59:10 -04:00
Marc-André Lureau
704084952f refactor(server): convert encoder to use anyhow::Result
This is a bit more idiomatic than returning None for errors, and allows
to push up the reporting.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-04-03 11:59:10 -04:00
Marc-André Lureau
2cef7e56fd refactor(server): factor out UpdateEncoder::encode_pdu()
The function is reusable.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-04-03 11:59:10 -04:00
Marc-André Lureau
f2ee34ffc2 feat(server): add some debug statements
Remove 'main label too.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-04-03 11:59:10 -04:00
Marc-Andre Lureau
c8f6fe5181
feat: RemoteFX encoder (#379) 2024-04-02 11:38:38 -04:00
Isaiah Becker-Mayer
04d78b6581
refactor: dynamic resize follow up (#425) 2024-04-01 12:21:54 -04:00
Isaiah Becker-Mayer
1e53669b11
feat: add support for dydynvc (#419) 2024-03-29 04:18:12 -04:00
Marc-André Lureau
31feec5b79 refactor(pdu): convert ShareDataHeader and ShareControl to PduEncode/Decode 2024-03-21 02:43:50 +09:00
Marc-André Lureau
9faf1ff08d refactor(pdu): convert input module to PduEncode/Decode
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-03-21 02:43:50 +09:00
Marc-André Lureau
b0dd0677a4 refactor(dvc): switch to PduEncode/Decode
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-03-21 02:43:50 +09:00
Vladyslav Nikonov
d53a5321b2
feat(displaycontrol): dynamic resolution PDUs (#366) 2024-02-14 19:32:02 +02:00
Marc-André Lureau
60080191aa fix(server): make Debug for BitmapUpdate less verbose
Skip the data part, it's usually noisy.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-02-06 18:49:42 +09:00
Marc-André Lureau
42329b326d feat(connector): make DesktopSize Partial/Eq/Copy
The type is simple, let's avoid the need for explicit clone()

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-02-06 18:49:42 +09:00
Marc-André Lureau
df165129fa fix(server): flip bitmap data when necessary
Bitmaps are encoded from bottom to top...

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-02-06 18:49:42 +09:00
Marc-André Lureau
aecc29b780 refactor(server): replace get_updates() with a receiver
When there are no clients connected, we are not processing display
updates. Let the server implementation react when client start and stop
listening for updates. For example, the initial update should be a
whole-display, and on disconnect, the server can stop processing updates
too.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-02-06 18:49:42 +09:00
Marc-André Lureau
f29f2c64c3 feat(server): add basic Display Control channel
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-01-25 01:01:59 +09:00
Marc-André Lureau
3c76c76705 feat(server): add ainput DVC channel
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-01-25 01:01:59 +09:00
Marc-André Lureau
203f39eb88 refactor(server): require RdpServerInputHandler to be Send
So we can share it with different tasks more easily.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2024-01-25 01:01:59 +09:00