FreeRDP
channels/rdpgfx.h
1 
20 #ifndef FREERDP_CHANNEL_RDPGFX_H
21 #define FREERDP_CHANNEL_RDPGFX_H
22 
23 #include <freerdp/api.h>
24 #include <freerdp/dvc.h>
25 #include <freerdp/types.h>
26 
31 #define RDPGFX_CHANNEL_NAME "rdpgfx"
32 #define RDPGFX_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::Graphics"
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
42  typedef struct
43  {
44  UINT16 x;
45  UINT16 y;
47 
48  typedef struct
49  {
50  BYTE B;
51  BYTE G;
52  BYTE R;
53  BYTE XA;
55 
56 #define GFX_PIXEL_FORMAT_XRGB_8888 0x20
57 #define GFX_PIXEL_FORMAT_ARGB_8888 0x21
58 
59 typedef BYTE RDPGFX_PIXELFORMAT;
60 
61 #define RDPGFX_CMDID_UNUSED_0000 0x0000
62 #define RDPGFX_CMDID_WIRETOSURFACE_1 0x0001
63 #define RDPGFX_CMDID_WIRETOSURFACE_2 0x0002
64 #define RDPGFX_CMDID_DELETEENCODINGCONTEXT 0x0003
65 #define RDPGFX_CMDID_SOLIDFILL 0x0004
66 #define RDPGFX_CMDID_SURFACETOSURFACE 0x0005
67 #define RDPGFX_CMDID_SURFACETOCACHE 0x0006
68 #define RDPGFX_CMDID_CACHETOSURFACE 0x0007
69 #define RDPGFX_CMDID_EVICTCACHEENTRY 0x0008
70 #define RDPGFX_CMDID_CREATESURFACE 0x0009
71 #define RDPGFX_CMDID_DELETESURFACE 0x000A
72 #define RDPGFX_CMDID_STARTFRAME 0x000B
73 #define RDPGFX_CMDID_ENDFRAME 0x000C
74 #define RDPGFX_CMDID_FRAMEACKNOWLEDGE 0x000D
75 #define RDPGFX_CMDID_RESETGRAPHICS 0x000E
76 #define RDPGFX_CMDID_MAPSURFACETOOUTPUT 0x000F
77 #define RDPGFX_CMDID_CACHEIMPORTOFFER 0x0010
78 #define RDPGFX_CMDID_CACHEIMPORTREPLY 0x0011
79 #define RDPGFX_CMDID_CAPSADVERTISE 0x0012
80 #define RDPGFX_CMDID_CAPSCONFIRM 0x0013
81 #define RDPGFX_CMDID_UNUSED_0014 0x0014
82 #define RDPGFX_CMDID_MAPSURFACETOWINDOW 0x0015
83 #define RDPGFX_CMDID_QOEFRAMEACKNOWLEDGE 0x0016
84 #define RDPGFX_CMDID_MAPSURFACETOSCALEDOUTPUT 0x0017
85 #define RDPGFX_CMDID_MAPSURFACETOSCALEDWINDOW 0x0018
86 
87 #define RDPGFX_HEADER_SIZE 8
88 
89 typedef struct
90 {
91  UINT16 cmdId;
92  UINT16 flags;
93  UINT32 pduLength;
95 
100 #define RDPGFX_CAPVERSION_8 0x00080004
101 #define RDPGFX_CAPVERSION_81 0x00080105
102 #define RDPGFX_CAPVERSION_10 0x000A0002
103 #define RDPGFX_CAPVERSION_101 0x000A0100
104 #define RDPGFX_CAPVERSION_102 0x000A0200
105 #define RDPGFX_CAPVERSION_103 0x000A0301
106 #define RDPGFX_CAPVERSION_104 0x000A0400
107 #define RDPGFX_CAPVERSION_105 0x000A0502
108 #define RDPGFX_CAPVERSION_106 \
109  0x000A0600
114 #define RDPGFX_CAPVERSION_106_ERR 0x000A0601
115 #define RDPGFX_CAPVERSION_107 0x000A0701
117 #define RDPGFX_NUMBER_CAPSETS 11
118 #define RDPGFX_CAPSET_BASE_SIZE 8
119 
120 typedef struct
121 {
122  UINT32 version;
123  UINT32 length;
124  UINT32 flags;
125 } RDPGFX_CAPSET;
126 
127 #define RDPGFX_CAPS_FLAG_THINCLIENT 0x00000001U /* 8.0+ */
128 #define RDPGFX_CAPS_FLAG_SMALL_CACHE 0x00000002U /* 8.0+ */
129 #define RDPGFX_CAPS_FLAG_AVC420_ENABLED 0x00000010U /* 8.1+ */
130 #define RDPGFX_CAPS_FLAG_AVC_DISABLED 0x00000020U /* 10.0+ */
131 #define RDPGFX_CAPS_FLAG_AVC_THINCLIENT 0x00000040U /* 10.3+ */
132 #define RDPGFX_CAPS_FLAG_SCALEDMAP_DISABLE 0x00000080U /* 10.7+ */
133 
134 typedef struct
135 {
136  UINT32 version;
137  UINT32 capsDataLength;
138  UINT32 flags;
140 
141 typedef struct
142 {
143  UINT32 version;
144  UINT32 capsDataLength;
145  UINT32 flags;
147 
148 typedef struct
149 {
150  UINT32 version;
151  UINT32 capsDataLength;
152  UINT32 flags;
154 
159 #define RDPGFX_CODECID_UNCOMPRESSED 0x0000
160 #define RDPGFX_CODECID_CAVIDEO 0x0003
161 #define RDPGFX_CODECID_CLEARCODEC 0x0008
162 #define RDPGFX_CODECID_PLANAR 0x000A
163 #define RDPGFX_CODECID_AVC420 0x000B
164 #define RDPGFX_CODECID_ALPHA 0x000C
165 #define RDPGFX_CODECID_AVC444 0x000E
166 #define RDPGFX_CODECID_AVC444v2 0x000F
167 
168 #define RDPGFX_WIRE_TO_SURFACE_PDU_1_SIZE 17
169 
170 typedef struct
171 {
172  UINT16 surfaceId;
173  UINT16 codecId;
174  RDPGFX_PIXELFORMAT pixelFormat;
175  RECTANGLE_16 destRect;
176  UINT32 bitmapDataLength;
177  BYTE* bitmapData;
179 
180 #define RDPGFX_CODECID_CAPROGRESSIVE 0x0009
181 #define RDPGFX_CODECID_CAPROGRESSIVE_V2 0x000D
182 
183 #define RDPGFX_WIRE_TO_SURFACE_PDU_2_SIZE 13
184 
185 typedef struct
186 {
187  UINT16 surfaceId;
188  UINT16 codecId;
189  UINT32 codecContextId;
190  RDPGFX_PIXELFORMAT pixelFormat;
191  UINT32 bitmapDataLength;
192  BYTE* bitmapData;
194 
195 typedef struct
196 {
197  UINT32 surfaceId;
198  UINT32 codecId;
199  UINT32 contextId;
200  UINT32 format; /* FreeRDP color format. @see freerdp/codec/color.h */
201  UINT32 left;
202  UINT32 top;
203  UINT32 right;
204  UINT32 bottom;
205  UINT32 width;
206  UINT32 height;
207  UINT32 length;
208  BYTE* data;
209  void* extra;
211 
212 typedef struct
213 {
214  UINT16 surfaceId;
215  UINT32 codecContextId;
217 
218 typedef struct
219 {
220  UINT16 surfaceId;
221  RDPGFX_COLOR32 fillPixel;
222  UINT16 fillRectCount;
223  RECTANGLE_16* fillRects;
225 
226 typedef struct
227 {
228  UINT16 surfaceIdSrc;
229  UINT16 surfaceIdDest;
230  RECTANGLE_16 rectSrc;
231  UINT16 destPtsCount;
232  RDPGFX_POINT16* destPts;
234 
235 typedef struct
236 {
237  UINT16 surfaceId;
238  UINT64 cacheKey;
239  UINT16 cacheSlot;
240  RECTANGLE_16 rectSrc;
242 
243 typedef struct
244 {
245  UINT16 cacheSlot;
246  UINT16 surfaceId;
247  UINT16 destPtsCount;
248  RDPGFX_POINT16* destPts;
250 
251 typedef struct
252 {
253  UINT16 cacheSlot;
255 
256 typedef struct
257 {
258  UINT16 surfaceId;
259  UINT16 width;
260  UINT16 height;
261  RDPGFX_PIXELFORMAT pixelFormat;
263 
264 typedef struct
265 {
266  UINT16 surfaceId;
268 
269 #define RDPGFX_START_FRAME_PDU_SIZE 8
270 
271 typedef struct
272 {
273  UINT32 timestamp;
274  UINT32 frameId;
276 
277 #define RDPGFX_END_FRAME_PDU_SIZE 4
278 
279 typedef struct
280 {
281  UINT32 frameId;
283 
284 #define QUEUE_DEPTH_UNAVAILABLE 0x00000000
285 #define SUSPEND_FRAME_ACKNOWLEDGEMENT 0xFFFFFFFF
286 
287 typedef struct
288 {
289  UINT32 queueDepth;
290  UINT32 frameId;
291  UINT32 totalFramesDecoded;
293 
294 typedef struct
295 {
296  UINT32 width;
297  UINT32 height;
298  UINT32 monitorCount;
299  MONITOR_DEF* monitorDefArray;
301 
302 typedef struct
303 {
304  UINT16 surfaceId;
305  UINT16 reserved;
306  UINT32 outputOriginX;
307  UINT32 outputOriginY;
309 
310 typedef struct
311 {
312  UINT16 surfaceId;
313  UINT16 reserved;
314  UINT32 outputOriginX;
315  UINT32 outputOriginY;
316  UINT32 targetWidth;
317  UINT32 targetHeight;
319 
320 typedef struct
321 {
322  UINT64 cacheKey;
323  UINT32 bitmapLength;
325 
326 #define RDPGFX_CACHE_ENTRY_MAX_COUNT 5462
327 
328 typedef struct
329 {
330  UINT16 cacheEntriesCount;
331  RDPGFX_CACHE_ENTRY_METADATA cacheEntries[RDPGFX_CACHE_ENTRY_MAX_COUNT];
333 
334 typedef struct
335 {
336  UINT16 importedEntriesCount;
337  UINT16 cacheSlots[RDPGFX_CACHE_ENTRY_MAX_COUNT];
339 
340 typedef struct
341 {
342  UINT16 capsSetCount;
343  RDPGFX_CAPSET* capsSets;
345 
346 typedef struct
347 {
348  RDPGFX_CAPSET* capsSet;
350 
351 typedef struct
352 {
353  UINT16 surfaceId;
354  UINT64 windowId;
355  UINT32 mappedWidth;
356  UINT32 mappedHeight;
358 
359 typedef struct
360 {
361  UINT16 surfaceId;
362  UINT64 windowId;
363  UINT32 mappedWidth;
364  UINT32 mappedHeight;
365  UINT32 targetWidth;
366  UINT32 targetHeight;
368 
369 /* H264 */
370 
371 typedef struct
372 {
373  BYTE qpVal;
374  BYTE qualityVal;
375 
376  BYTE qp;
377  BYTE r;
378  BYTE p;
380 
381 typedef struct
382 {
383  UINT32 numRegionRects;
384  RECTANGLE_16* regionRects;
385  RDPGFX_H264_QUANT_QUALITY* quantQualityVals;
387 
388 typedef struct
389 {
391  UINT32 length;
392  BYTE* data;
394 
395 typedef struct
396 {
397  UINT32 cbAvc420EncodedBitstream1;
398  BYTE LC;
399  RDPGFX_AVC420_BITMAP_STREAM bitstream[2];
401 
402 typedef struct
403 {
404  UINT32 frameId;
405  UINT32 timestamp;
406  UINT16 timeDiffSE;
407  UINT16 timeDiffEDR;
409 
410 #ifdef __cplusplus
411 }
412 #endif
413 #endif /* FREERDP_CHANNEL_RDPGFX_H */