@@ -3,11 +3,13 @@ use ironrdp::connector::connection_activation::ConnectionActivationState;
33use ironrdp:: connector:: { ConnectionResult , ConnectorResult } ;
44use ironrdp:: displaycontrol:: client:: DisplayControlClient ;
55use ironrdp:: displaycontrol:: pdu:: MonitorLayoutEntry ;
6+ use ironrdp:: egfx:: client:: { GraphicsPipelineClient , GraphicsPipelineHandler } ;
7+ use ironrdp:: egfx:: pdu:: { GfxPdu , StartFramePdu } ;
68use ironrdp:: graphics:: image_processing:: PixelFormat ;
79use ironrdp:: pdu:: input:: fast_path:: FastPathInputEvent ;
810use ironrdp:: session:: image:: DecodedImage ;
911use 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} ;
1113use ironrdp_core:: WriteBuf ;
1214use ironrdp_rdpsnd_native:: cpal;
1315use ironrdp_tokio:: { single_sequence_step_read, split_tokio_framed, FramedWrite } ;
@@ -92,6 +94,49 @@ impl RdpClient {
9294 }
9395}
9496
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+
95140enum RdpControlFlow {
96141 ReconnectWithNewSize { width : u16 , height : u16 } ,
97142 TerminatedGracefully ( GracefulDisconnectReason ) ,
@@ -118,7 +163,9 @@ async fn connect(
118163 let mut connector = connector:: ClientConnector :: new ( config. connector . clone ( ) )
119164 . with_server_addr ( server_addr)
120165 . 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 ( ) ) ) ) ,
122169 )
123170 . with_static_channel ( rdpsnd:: client:: Rdpsnd :: new ( Box :: new ( cpal:: RdpsndBackend :: new ( ) ) ) )
124171 . with_static_channel ( rdpdr:: Rdpdr :: new ( Box :: new ( NoopRdpdrBackend { } ) , "IronRDP" . to_owned ( ) ) . with_smartcard ( 0 ) ) ;
0 commit comments