2013-10-22 06:53:55 +04:00
|
|
|
/**
|
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
|
|
|
* Graphics Pipeline Extension
|
|
|
|
*
|
|
|
|
* Copyright 2013 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
2015-06-09 16:22:26 +03:00
|
|
|
* Copyright 2015 Thincast Technologies GmbH
|
|
|
|
* Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
|
2013-10-22 06:53:55 +04:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2017-06-06 15:01:41 +03:00
|
|
|
#ifndef FREERDP_CHANNEL_RDPGFX_CLIENT_RDPGFX_H
|
|
|
|
#define FREERDP_CHANNEL_RDPGFX_CLIENT_RDPGFX_H
|
2013-10-22 06:53:55 +04:00
|
|
|
|
|
|
|
#include <freerdp/channels/rdpgfx.h>
|
2017-02-15 17:34:50 +03:00
|
|
|
#include <freerdp/utils/profiler.h>
|
2013-10-22 06:53:55 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Client Interface
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct _rdpgfx_client_context RdpgfxClientContext;
|
|
|
|
|
2016-10-04 10:00:01 +03:00
|
|
|
typedef UINT(*pcRdpgfxResetGraphics)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_RESET_GRAPHICS_PDU* resetGraphics);
|
|
|
|
typedef UINT(*pcRdpgfxStartFrame)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_START_FRAME_PDU* startFrame);
|
|
|
|
typedef UINT(*pcRdpgfxEndFrame)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_END_FRAME_PDU* endFrame);
|
|
|
|
typedef UINT(*pcRdpgfxSurfaceCommand)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_SURFACE_COMMAND* cmd);
|
|
|
|
typedef UINT(*pcRdpgfxDeleteEncodingContext)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext);
|
|
|
|
typedef UINT(*pcRdpgfxCreateSurface)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_CREATE_SURFACE_PDU* createSurface);
|
|
|
|
typedef UINT(*pcRdpgfxDeleteSurface)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_DELETE_SURFACE_PDU* deleteSurface);
|
|
|
|
typedef UINT(*pcRdpgfxSolidFill)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_SOLID_FILL_PDU* solidFill);
|
|
|
|
typedef UINT(*pcRdpgfxSurfaceToSurface)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface);
|
|
|
|
typedef UINT(*pcRdpgfxSurfaceToCache)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache);
|
|
|
|
typedef UINT(*pcRdpgfxCacheToSurface)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface);
|
|
|
|
typedef UINT(*pcRdpgfxCacheImportOffer)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_CACHE_IMPORT_OFFER_PDU* cacheImportOffer);
|
|
|
|
typedef UINT(*pcRdpgfxCacheImportReply)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply);
|
|
|
|
typedef UINT(*pcRdpgfxEvictCacheEntry)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry);
|
|
|
|
typedef UINT(*pcRdpgfxMapSurfaceToOutput)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput);
|
2019-02-27 18:36:15 +03:00
|
|
|
typedef UINT(*pcRdpgfxMapSurfaceToScaledOutput)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* surfaceToOutput);
|
2016-10-04 10:00:01 +03:00
|
|
|
typedef UINT(*pcRdpgfxMapSurfaceToWindow)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow);
|
2019-02-27 18:36:15 +03:00
|
|
|
typedef UINT(*pcRdpgfxMapSurfaceToScaledWindow)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* surfaceToWindow);
|
2016-10-04 10:00:01 +03:00
|
|
|
typedef UINT(*pcRdpgfxSetSurfaceData)(RdpgfxClientContext* context,
|
|
|
|
UINT16 surfaceId, void* pData);
|
|
|
|
typedef void* (*pcRdpgfxGetSurfaceData)(RdpgfxClientContext* context,
|
|
|
|
UINT16 surfaceId);
|
|
|
|
typedef UINT(*pcRdpgfxGetSurfaceIds)(RdpgfxClientContext* context,
|
|
|
|
UINT16** ppSurfaceIds, UINT16* count);
|
|
|
|
typedef UINT(*pcRdpgfxSetCacheSlotData)(RdpgfxClientContext* context,
|
|
|
|
UINT16 cacheSlot, void* pData);
|
|
|
|
typedef void* (*pcRdpgfxGetCacheSlotData)(RdpgfxClientContext* context,
|
|
|
|
UINT16 cacheSlot);
|
2014-06-12 01:48:04 +04:00
|
|
|
|
2016-10-04 10:00:01 +03:00
|
|
|
typedef UINT(*pcRdpgfxUpdateSurfaces)(RdpgfxClientContext* context);
|
2016-04-05 18:07:45 +03:00
|
|
|
|
2017-04-19 14:00:26 +03:00
|
|
|
typedef UINT(*pcRdpgfxUpdateSurfaceArea)(RdpgfxClientContext* context, UINT16 surfaceId,
|
2018-10-23 12:52:06 +03:00
|
|
|
UINT32 nrRects, const RECTANGLE_16* rects);
|
2017-04-19 14:00:26 +03:00
|
|
|
|
2019-05-05 15:31:18 +03:00
|
|
|
typedef UINT(*pcRdpgfxOnOpen)(RdpgfxClientContext* context, BOOL* do_caps_advertise,
|
|
|
|
BOOL* do_frame_acks);
|
|
|
|
typedef UINT(*pcRdpgfxOnClose)(RdpgfxClientContext* context);
|
|
|
|
typedef UINT(*pcRdpgfxCapsAdvertise)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_CAPS_ADVERTISE_PDU* capsAdvertise);
|
|
|
|
typedef UINT(*pcRdpgfxCapsConfirm)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_CAPS_CONFIRM_PDU* capsConfirm);
|
|
|
|
typedef UINT(*pcRdpgfxFrameAcknowledge)(RdpgfxClientContext* context,
|
|
|
|
const RDPGFX_FRAME_ACKNOWLEDGE_PDU* frameAcknowledge);
|
2019-04-05 14:37:51 +03:00
|
|
|
|
2019-05-07 11:22:02 +03:00
|
|
|
typedef UINT(*pcRdpgfxMapWindowForSurface)(RdpgfxClientContext* context, UINT16 surfaceID,
|
|
|
|
UINT64 windowID);
|
|
|
|
typedef UINT(*pcRdpgfxUnmapWindowForSurface)(RdpgfxClientContext* context, UINT64 windowID);
|
|
|
|
|
2013-10-22 06:53:55 +04:00
|
|
|
struct _rdpgfx_client_context
|
|
|
|
{
|
|
|
|
void* handle;
|
|
|
|
void* custom;
|
|
|
|
|
2018-10-23 12:52:06 +03:00
|
|
|
/* Implementations require locking */
|
2014-06-04 23:18:02 +04:00
|
|
|
pcRdpgfxResetGraphics ResetGraphics;
|
|
|
|
pcRdpgfxStartFrame StartFrame;
|
|
|
|
pcRdpgfxEndFrame EndFrame;
|
|
|
|
pcRdpgfxSurfaceCommand SurfaceCommand;
|
|
|
|
pcRdpgfxDeleteEncodingContext DeleteEncodingContext;
|
|
|
|
pcRdpgfxCreateSurface CreateSurface;
|
|
|
|
pcRdpgfxDeleteSurface DeleteSurface;
|
|
|
|
pcRdpgfxSolidFill SolidFill;
|
|
|
|
pcRdpgfxSurfaceToSurface SurfaceToSurface;
|
|
|
|
pcRdpgfxSurfaceToCache SurfaceToCache;
|
|
|
|
pcRdpgfxCacheToSurface CacheToSurface;
|
|
|
|
pcRdpgfxCacheImportOffer CacheImportOffer;
|
|
|
|
pcRdpgfxCacheImportReply CacheImportReply;
|
|
|
|
pcRdpgfxEvictCacheEntry EvictCacheEntry;
|
|
|
|
pcRdpgfxMapSurfaceToOutput MapSurfaceToOutput;
|
2019-02-27 18:36:15 +03:00
|
|
|
pcRdpgfxMapSurfaceToScaledOutput MapSurfaceToScaledOutput;
|
2014-06-04 23:18:02 +04:00
|
|
|
pcRdpgfxMapSurfaceToWindow MapSurfaceToWindow;
|
2019-02-27 18:36:15 +03:00
|
|
|
pcRdpgfxMapSurfaceToScaledWindow MapSurfaceToScaledWindow;
|
2014-06-12 01:48:04 +04:00
|
|
|
|
2015-02-11 00:32:07 +03:00
|
|
|
pcRdpgfxGetSurfaceIds GetSurfaceIds;
|
2014-06-12 01:48:04 +04:00
|
|
|
pcRdpgfxSetSurfaceData SetSurfaceData;
|
|
|
|
pcRdpgfxGetSurfaceData GetSurfaceData;
|
2014-06-13 16:36:09 +04:00
|
|
|
pcRdpgfxSetCacheSlotData SetCacheSlotData;
|
|
|
|
pcRdpgfxGetCacheSlotData GetCacheSlotData;
|
2016-04-05 18:07:45 +03:00
|
|
|
|
2019-05-05 15:31:18 +03:00
|
|
|
/* Proxy callbacks */
|
|
|
|
pcRdpgfxOnOpen OnOpen;
|
|
|
|
pcRdpgfxOnClose OnClose;
|
|
|
|
pcRdpgfxCapsAdvertise CapsAdvertise;
|
|
|
|
pcRdpgfxCapsConfirm CapsConfirm;
|
|
|
|
pcRdpgfxFrameAcknowledge FrameAcknowledge;
|
|
|
|
|
2018-10-23 12:52:06 +03:00
|
|
|
/* No locking required */
|
2016-04-05 18:07:45 +03:00
|
|
|
pcRdpgfxUpdateSurfaces UpdateSurfaces;
|
2017-04-19 14:00:26 +03:00
|
|
|
pcRdpgfxUpdateSurfaceArea UpdateSurfaceArea;
|
2017-02-15 17:34:50 +03:00
|
|
|
|
2019-05-07 11:22:02 +03:00
|
|
|
/* These callbacks allow crating/destroying a window directly
|
|
|
|
* mapped to a surface.
|
|
|
|
* NOTE: The surface is already locked.
|
|
|
|
*/
|
|
|
|
pcRdpgfxMapWindowForSurface MapWindowForSurface;
|
|
|
|
pcRdpgfxUnmapWindowForSurface UnmapWindowForSurface;
|
|
|
|
|
2018-10-23 12:52:06 +03:00
|
|
|
CRITICAL_SECTION mux;
|
2018-02-15 12:19:15 +03:00
|
|
|
PROFILER_DEFINE(SurfaceProfiler)
|
2013-10-22 06:53:55 +04:00
|
|
|
};
|
|
|
|
|
2017-06-06 15:01:41 +03:00
|
|
|
#endif /* FREERDP_CHANNEL_RDPGFX_CLIENT_RDPGFX_H */
|