rdpgfx.h (6663B)
1/** 2 * FreeRDP: A Remote Desktop Protocol Implementation 3 * Graphics Pipeline Extension 4 * 5 * Copyright 2016 Jiang Zihao <zihao.jiang@yahoo.com> 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 */ 19 20#ifndef FREERDP_CHANNEL_RDPGFX_SERVER_RDPGFX_H 21#define FREERDP_CHANNEL_RDPGFX_SERVER_RDPGFX_H 22 23#include <freerdp/channels/rdpgfx.h> 24#include <freerdp/freerdp.h> 25 26typedef struct _rdpgfx_server_context RdpgfxServerContext; 27typedef struct _rdpgfx_server_private RdpgfxServerPrivate; 28 29typedef BOOL (*psRdpgfxServerOpen)(RdpgfxServerContext* context); 30typedef BOOL (*psRdpgfxServerClose)(RdpgfxServerContext* context); 31 32typedef BOOL (*psRdpgfxServerChannelIdAssigned)(RdpgfxServerContext* context, UINT32 channelId); 33 34typedef UINT (*psRdpgfxResetGraphics)(RdpgfxServerContext* context, 35 const RDPGFX_RESET_GRAPHICS_PDU* resetGraphics); 36typedef UINT (*psRdpgfxStartFrame)(RdpgfxServerContext* context, 37 const RDPGFX_START_FRAME_PDU* startFrame); 38typedef UINT (*psRdpgfxEndFrame)(RdpgfxServerContext* context, 39 const RDPGFX_END_FRAME_PDU* endFrame); 40typedef UINT (*psRdpgfxSurfaceCommand)(RdpgfxServerContext* context, 41 const RDPGFX_SURFACE_COMMAND* cmd); 42typedef UINT (*psRdpgfxSurfaceFrameCommand)(RdpgfxServerContext* context, 43 const RDPGFX_SURFACE_COMMAND* cmd, 44 const RDPGFX_START_FRAME_PDU* startFrame, 45 const RDPGFX_END_FRAME_PDU* endFrame); 46typedef UINT (*psRdpgfxDeleteEncodingContext)( 47 RdpgfxServerContext* context, const RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext); 48typedef UINT (*psRdpgfxCreateSurface)(RdpgfxServerContext* context, 49 const RDPGFX_CREATE_SURFACE_PDU* createSurface); 50typedef UINT (*psRdpgfxDeleteSurface)(RdpgfxServerContext* context, 51 const RDPGFX_DELETE_SURFACE_PDU* deleteSurface); 52typedef UINT (*psRdpgfxSolidFill)(RdpgfxServerContext* context, 53 const RDPGFX_SOLID_FILL_PDU* solidFill); 54typedef UINT (*psRdpgfxSurfaceToSurface)(RdpgfxServerContext* context, 55 const RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface); 56typedef UINT (*psRdpgfxSurfaceToCache)(RdpgfxServerContext* context, 57 const RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache); 58typedef UINT (*psRdpgfxCacheToSurface)(RdpgfxServerContext* context, 59 const RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface); 60typedef UINT (*psRdpgfxCacheImportOffer)(RdpgfxServerContext* context, 61 const RDPGFX_CACHE_IMPORT_OFFER_PDU* cacheImportOffer); 62typedef UINT (*psRdpgfxCacheImportReply)(RdpgfxServerContext* context, 63 const RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply); 64typedef UINT (*psRdpgfxEvictCacheEntry)(RdpgfxServerContext* context, 65 const RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry); 66typedef UINT (*psRdpgfxMapSurfaceToOutput)(RdpgfxServerContext* context, 67 const RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput); 68typedef UINT (*psRdpgfxMapSurfaceToWindow)(RdpgfxServerContext* context, 69 const RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow); 70typedef UINT (*psRdpgfxMapSurfaceToScaledOutput)( 71 RdpgfxServerContext* context, const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* surfaceToOutput); 72typedef UINT (*psRdpgfxMapSurfaceToScaledWindow)( 73 RdpgfxServerContext* context, const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* surfaceToWindow); 74typedef UINT (*psRdpgfxCapsAdvertise)(RdpgfxServerContext* context, 75 const RDPGFX_CAPS_ADVERTISE_PDU* capsAdvertise); 76typedef UINT (*psRdpgfxCapsConfirm)(RdpgfxServerContext* context, 77 const RDPGFX_CAPS_CONFIRM_PDU* capsConfirm); 78typedef UINT (*psRdpgfxFrameAcknowledge)(RdpgfxServerContext* context, 79 const RDPGFX_FRAME_ACKNOWLEDGE_PDU* frameAcknowledge); 80typedef UINT (*psRdpgfxQoeFrameAcknowledge)( 81 RdpgfxServerContext* context, const RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU* qoeFrameAcknowledge); 82 83struct _rdpgfx_server_context 84{ 85 HANDLE vcm; 86 void* custom; 87 88 psRdpgfxServerOpen Open; 89 psRdpgfxServerClose Close; 90 91 psRdpgfxResetGraphics ResetGraphics; 92 psRdpgfxStartFrame StartFrame; 93 psRdpgfxEndFrame EndFrame; 94 psRdpgfxSurfaceCommand SurfaceCommand; 95 psRdpgfxSurfaceFrameCommand SurfaceFrameCommand; 96 psRdpgfxDeleteEncodingContext DeleteEncodingContext; 97 psRdpgfxCreateSurface CreateSurface; 98 psRdpgfxDeleteSurface DeleteSurface; 99 psRdpgfxSolidFill SolidFill; 100 psRdpgfxSurfaceToSurface SurfaceToSurface; 101 psRdpgfxSurfaceToCache SurfaceToCache; 102 psRdpgfxCacheToSurface CacheToSurface; 103 psRdpgfxCacheImportOffer CacheImportOffer; 104 psRdpgfxCacheImportReply CacheImportReply; 105 psRdpgfxEvictCacheEntry EvictCacheEntry; 106 psRdpgfxMapSurfaceToOutput MapSurfaceToOutput; 107 psRdpgfxMapSurfaceToWindow MapSurfaceToWindow; 108 psRdpgfxMapSurfaceToScaledOutput MapSurfaceToScaledOutput; 109 psRdpgfxMapSurfaceToScaledWindow MapSurfaceToScaledWindow; 110 psRdpgfxCapsAdvertise CapsAdvertise; 111 psRdpgfxCapsConfirm CapsConfirm; 112 psRdpgfxFrameAcknowledge FrameAcknowledge; 113 psRdpgfxQoeFrameAcknowledge QoeFrameAcknowledge; 114 115 RdpgfxServerPrivate* priv; 116 rdpContext* rdpcontext; 117 118 /** 119 * Callback, when the channel got its id assigned. 120 */ 121 psRdpgfxServerChannelIdAssigned ChannelIdAssigned; 122}; 123 124#ifdef __cplusplus 125extern "C" 126{ 127#endif 128 129 FREERDP_API RdpgfxServerContext* rdpgfx_server_context_new(HANDLE vcm); 130 FREERDP_API void rdpgfx_server_context_free(RdpgfxServerContext* context); 131 FREERDP_API HANDLE rdpgfx_server_get_event_handle(RdpgfxServerContext* context); 132 FREERDP_API UINT rdpgfx_server_handle_messages(RdpgfxServerContext* context); 133 134#ifdef __cplusplus 135} 136#endif 137 138#endif /* FREERDP_CHANNEL_RDPGFX_SERVER_RDPGFX_H */