FreeRDP
client/rdpgfx.h
1 
22 #ifndef FREERDP_CHANNEL_RDPGFX_CLIENT_RDPGFX_H
23 #define FREERDP_CHANNEL_RDPGFX_CLIENT_RDPGFX_H
24 
25 #include <freerdp/api.h>
26 #include <freerdp/types.h>
27 
28 #include <freerdp/codecs.h>
29 
30 #include <freerdp/channels/rdpgfx.h>
31 #include <freerdp/utils/profiler.h>
32 
33 #include <freerdp/cache/persistent.h>
34 
35 #ifdef __cplusplus
36 extern "C"
37 {
38 #endif
39 
43  typedef struct gdi_gfx_surface gdiGfxSurface;
44  typedef struct s_rdpgfx_client_context RdpgfxClientContext;
45 
46  typedef UINT (*pcRdpgfxResetGraphics)(RdpgfxClientContext* context,
47  const RDPGFX_RESET_GRAPHICS_PDU* resetGraphics);
48  typedef UINT (*pcRdpgfxStartFrame)(RdpgfxClientContext* context,
49  const RDPGFX_START_FRAME_PDU* startFrame);
50  typedef UINT (*pcRdpgfxEndFrame)(RdpgfxClientContext* context,
51  const RDPGFX_END_FRAME_PDU* endFrame);
52  typedef UINT (*pcRdpgfxSurfaceCommand)(RdpgfxClientContext* context,
53  const RDPGFX_SURFACE_COMMAND* cmd);
54  typedef UINT (*pcRdpgfxDeleteEncodingContext)(
55  RdpgfxClientContext* context,
56  const RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext);
57  typedef UINT (*pcRdpgfxCreateSurface)(RdpgfxClientContext* context,
58  const RDPGFX_CREATE_SURFACE_PDU* createSurface);
59  typedef UINT (*pcRdpgfxDeleteSurface)(RdpgfxClientContext* context,
60  const RDPGFX_DELETE_SURFACE_PDU* deleteSurface);
61  typedef UINT (*pcRdpgfxSolidFill)(RdpgfxClientContext* context,
62  const RDPGFX_SOLID_FILL_PDU* solidFill);
63  typedef UINT (*pcRdpgfxSurfaceToSurface)(RdpgfxClientContext* context,
64  const RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface);
65  typedef UINT (*pcRdpgfxSurfaceToCache)(RdpgfxClientContext* context,
66  const RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache);
67  typedef UINT (*pcRdpgfxCacheToSurface)(RdpgfxClientContext* context,
68  const RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface);
69  typedef UINT (*pcRdpgfxCacheImportOffer)(RdpgfxClientContext* context,
70  const RDPGFX_CACHE_IMPORT_OFFER_PDU* cacheImportOffer);
71  typedef UINT (*pcRdpgfxCacheImportReply)(RdpgfxClientContext* context,
72  const RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply);
73  typedef UINT (*pcRdpgfxEvictCacheEntry)(RdpgfxClientContext* context,
74  const RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry);
75  typedef UINT (*pcRdpgfxImportCacheEntry)(RdpgfxClientContext* context, UINT16 cacheSlot,
76  const PERSISTENT_CACHE_ENTRY* importCacheEntry);
77  typedef UINT (*pcRdpgfxExportCacheEntry)(RdpgfxClientContext* context, UINT16 cacheSlot,
78  PERSISTENT_CACHE_ENTRY* importCacheEntry);
79  typedef UINT (*pcRdpgfxMapSurfaceToOutput)(
80  RdpgfxClientContext* context, const RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput);
81  typedef UINT (*pcRdpgfxMapSurfaceToScaledOutput)(
82  RdpgfxClientContext* context,
83  const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* surfaceToOutput);
84  typedef UINT (*pcRdpgfxMapSurfaceToWindow)(
85  RdpgfxClientContext* context, const RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow);
86  typedef UINT (*pcRdpgfxMapSurfaceToScaledWindow)(
87  RdpgfxClientContext* context,
88  const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* surfaceToWindow);
89  typedef UINT (*pcRdpgfxSetSurfaceData)(RdpgfxClientContext* context, UINT16 surfaceId,
90  void* pData);
91  typedef void* (*pcRdpgfxGetSurfaceData)(RdpgfxClientContext* context, UINT16 surfaceId);
92  typedef UINT (*pcRdpgfxGetSurfaceIds)(RdpgfxClientContext* context, UINT16** ppSurfaceIds,
93  UINT16* count);
94  typedef UINT (*pcRdpgfxSetCacheSlotData)(RdpgfxClientContext* context, UINT16 cacheSlot,
95  void* pData);
96  typedef void* (*pcRdpgfxGetCacheSlotData)(RdpgfxClientContext* context, UINT16 cacheSlot);
97 
98  typedef UINT (*pcRdpgfxUpdateSurfaces)(RdpgfxClientContext* context);
99 
100  typedef UINT (*pcRdpgfxUpdateWindowFromSurface)(RdpgfxClientContext* context,
101  gdiGfxSurface* surface);
102 
103  typedef UINT (*pcRdpgfxUpdateSurfaceArea)(RdpgfxClientContext* context, UINT16 surfaceId,
104  UINT32 nrRects, const RECTANGLE_16* rects);
105 
106  typedef UINT (*pcRdpgfxOnOpen)(RdpgfxClientContext* context, BOOL* do_caps_advertise,
107  BOOL* do_frame_acks);
108  typedef UINT (*pcRdpgfxOnClose)(RdpgfxClientContext* context);
109  typedef UINT (*pcRdpgfxCapsAdvertise)(RdpgfxClientContext* context,
110  const RDPGFX_CAPS_ADVERTISE_PDU* capsAdvertise);
111  typedef UINT (*pcRdpgfxCapsConfirm)(RdpgfxClientContext* context,
112  const RDPGFX_CAPS_CONFIRM_PDU* capsConfirm);
113  typedef UINT (*pcRdpgfxFrameAcknowledge)(RdpgfxClientContext* context,
114  const RDPGFX_FRAME_ACKNOWLEDGE_PDU* frameAcknowledge);
115  typedef UINT (*pcRdpgfxQoeFrameAcknowledge)(
116  RdpgfxClientContext* context, const RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU* qoeFrameAcknowledge);
117 
118  typedef UINT (*pcRdpgfxMapWindowForSurface)(RdpgfxClientContext* context, UINT16 surfaceID,
119  UINT64 windowID);
120  typedef UINT (*pcRdpgfxUnmapWindowForSurface)(RdpgfxClientContext* context, UINT64 windowID);
121 
123  {
124  void* handle;
125  void* custom;
126 
127  /* Implementations require locking */
128  pcRdpgfxResetGraphics ResetGraphics;
129  pcRdpgfxStartFrame StartFrame;
130  pcRdpgfxEndFrame EndFrame;
131  pcRdpgfxSurfaceCommand SurfaceCommand;
132  pcRdpgfxDeleteEncodingContext DeleteEncodingContext;
133  pcRdpgfxCreateSurface CreateSurface;
134  pcRdpgfxDeleteSurface DeleteSurface;
135  pcRdpgfxSolidFill SolidFill;
136  pcRdpgfxSurfaceToSurface SurfaceToSurface;
137  pcRdpgfxSurfaceToCache SurfaceToCache;
138  pcRdpgfxCacheToSurface CacheToSurface;
139  pcRdpgfxCacheImportOffer CacheImportOffer;
140  pcRdpgfxCacheImportReply CacheImportReply;
141  pcRdpgfxImportCacheEntry ImportCacheEntry;
142  pcRdpgfxExportCacheEntry ExportCacheEntry;
143  pcRdpgfxEvictCacheEntry EvictCacheEntry;
144  pcRdpgfxMapSurfaceToOutput MapSurfaceToOutput;
145  pcRdpgfxMapSurfaceToScaledOutput MapSurfaceToScaledOutput;
146  pcRdpgfxMapSurfaceToWindow MapSurfaceToWindow;
147  pcRdpgfxMapSurfaceToScaledWindow MapSurfaceToScaledWindow;
148 
149  pcRdpgfxGetSurfaceIds GetSurfaceIds;
150  pcRdpgfxSetSurfaceData SetSurfaceData;
151  pcRdpgfxGetSurfaceData GetSurfaceData;
152  pcRdpgfxSetCacheSlotData SetCacheSlotData;
153  pcRdpgfxGetCacheSlotData GetCacheSlotData;
154 
155  /* Proxy callbacks */
156  pcRdpgfxOnOpen OnOpen;
157  pcRdpgfxOnClose OnClose;
158  pcRdpgfxCapsAdvertise CapsAdvertise;
159  pcRdpgfxCapsConfirm CapsConfirm;
160  pcRdpgfxFrameAcknowledge FrameAcknowledge;
161  pcRdpgfxQoeFrameAcknowledge QoeFrameAcknowledge;
162 
163  /* No locking required */
164  pcRdpgfxUpdateSurfaces UpdateSurfaces;
165  pcRdpgfxUpdateSurfaceArea UpdateSurfaceArea;
166  pcRdpgfxUpdateWindowFromSurface UpdateWindowFromSurface;
167 
168  /* These callbacks allow creating/destroying a window directly
169  * mapped to a surface.
170  * NOTE: The surface is already locked.
171  */
172  pcRdpgfxMapWindowForSurface MapWindowForSurface;
173  pcRdpgfxUnmapWindowForSurface UnmapWindowForSurface;
174 
175  CRITICAL_SECTION mux;
176  rdpCodecs* codecs;
177  PROFILER_DEFINE(SurfaceProfiler)
178  };
179 
180  FREERDP_API void rdpgfx_client_context_free(RdpgfxClientContext* context);
181 
182  WINPR_ATTR_MALLOC(rdpgfx_client_context_free, 1)
183  FREERDP_API RdpgfxClientContext* rdpgfx_client_context_new(rdpContext* context);
184 
185 #ifdef __cplusplus
186 }
187 #endif
188 
189 #endif /* FREERDP_CHANNEL_RDPGFX_CLIENT_RDPGFX_H */
Definition: persistent.h:70