@@ -3,11 +3,13 @@ use ironrdp::connector::connection_activation::ConnectionActivationState;
3
3
use ironrdp:: connector:: { ConnectionResult , ConnectorResult } ;
4
4
use ironrdp:: displaycontrol:: client:: DisplayControlClient ;
5
5
use ironrdp:: displaycontrol:: pdu:: MonitorLayoutEntry ;
6
+ use ironrdp:: egfx:: client:: { GraphicsPipelineClient , GraphicsPipelineHandler } ;
7
+ use ironrdp:: egfx:: pdu:: { GfxPdu , StartFramePdu } ;
6
8
use ironrdp:: graphics:: image_processing:: PixelFormat ;
7
9
use ironrdp:: pdu:: input:: fast_path:: FastPathInputEvent ;
8
10
use ironrdp:: session:: image:: DecodedImage ;
9
11
use ironrdp:: session:: { fast_path, ActiveStage , ActiveStageOutput , GracefulDisconnectReason , SessionResult } ;
10
- use ironrdp:: { cliprdr, connector, rdpdr, rdpsnd, session} ;
12
+ use ironrdp:: { cliprdr, connector, egfx , rdpdr, rdpsnd, session} ;
11
13
use ironrdp_core:: WriteBuf ;
12
14
use ironrdp_rdpsnd_native:: cpal;
13
15
use ironrdp_tokio:: { single_sequence_step_read, split_tokio_framed, FramedWrite } ;
@@ -92,6 +94,49 @@ impl RdpClient {
92
94
}
93
95
}
94
96
97
+ struct GraphicsPipeline {
98
+ caps : Option < egfx:: pdu:: CapabilitySet > ,
99
+ start_frame : Option < StartFramePdu > ,
100
+ }
101
+
102
+ impl GraphicsPipeline {
103
+ fn new ( ) -> Self {
104
+ Self {
105
+ caps : None ,
106
+ start_frame : None ,
107
+ }
108
+ }
109
+ }
110
+
111
+ impl GraphicsPipelineHandler for GraphicsPipeline {
112
+ fn capabilities ( & self ) -> Vec < egfx:: pdu:: CapabilitySet > {
113
+ vec ! [ egfx:: pdu:: CapabilitySet :: V8 {
114
+ flags: egfx:: pdu:: CapabilitiesV8Flags :: empty( ) ,
115
+ } ]
116
+ }
117
+
118
+ fn handle_pdu ( & mut self , pdu : GfxPdu ) {
119
+ trace ! ( ?pdu) ;
120
+ match pdu {
121
+ GfxPdu :: CapabilitiesConfirm ( pdu) => {
122
+ trace ! ( ?pdu) ;
123
+ self . caps = Some ( pdu. 0 ) ;
124
+ }
125
+ GfxPdu :: StartFrame ( pdu) => {
126
+ trace ! ( ?pdu) ;
127
+ self . start_frame = Some ( pdu) ;
128
+ }
129
+ GfxPdu :: EndFrame ( pdu) => {
130
+ trace ! ( ?pdu) ;
131
+ self . start_frame = None ;
132
+ }
133
+ pdu => {
134
+ debug ! ( ?pdu) ;
135
+ }
136
+ }
137
+ }
138
+ }
139
+
95
140
enum RdpControlFlow {
96
141
ReconnectWithNewSize { width : u16 , height : u16 } ,
97
142
TerminatedGracefully ( GracefulDisconnectReason ) ,
@@ -118,7 +163,9 @@ async fn connect(
118
163
let mut connector = connector:: ClientConnector :: new ( config. connector . clone ( ) )
119
164
. with_server_addr ( server_addr)
120
165
. with_static_channel (
121
- ironrdp:: dvc:: DrdynvcClient :: new ( ) . with_dynamic_channel ( DisplayControlClient :: new ( |_| Ok ( Vec :: new ( ) ) ) ) ,
166
+ ironrdp:: dvc:: DrdynvcClient :: new ( )
167
+ . with_dynamic_channel ( DisplayControlClient :: new ( |_| Ok ( Vec :: new ( ) ) ) )
168
+ . with_dynamic_channel ( GraphicsPipelineClient :: new ( Box :: new ( GraphicsPipeline :: new ( ) ) ) ) ,
122
169
)
123
170
. with_static_channel ( rdpsnd:: client:: Rdpsnd :: new ( Box :: new ( cpal:: RdpsndBackend :: new ( ) ) ) )
124
171
. with_static_channel ( rdpdr:: Rdpdr :: new ( Box :: new ( NoopRdpdrBackend { } ) , "IronRDP" . to_owned ( ) ) . with_smartcard ( 0 ) ) ;
0 commit comments