Skip to main content
The RDPGFX channel implements the [MS-RDPEGFX] Graphics Pipeline Extension — the modern RDP graphics path that supersedes the legacy bitmap update pipeline. It supports progressive codecs, surface compositing, and H.264/AVC hardware acceleration. DVC channel name: Microsoft::Windows::RDS::Graphics (RDPGFX_DVC_CHANNEL_NAME) Client header: <freerdp/client/rdpgfx.h>
Protocol types: <freerdp/channels/rdpgfx.h>

Context Lifecycle

The context is normally created and destroyed automatically by the channel framework. Access it from the channel manager after the DVC is connected.

RdpgfxClientContext

typedef struct s_rdpgfx_client_context RdpgfxClientContext
void*
Application private pointer.
rdpCodecs*
Codec suite used by this channel for decoding surface commands.

Capability Negotiation

pcRdpgfxCapsAdvertise
Proxy/intercept callback: called when the client is about to send a CAPS_ADVERTISE PDU listing supported capability versions. The capsSets array contains one entry per version (e.g. RDPGFX_CAPVERSION_107). Modify or inspect before the channel sends it.
pcRdpgfxCapsConfirm
Called when the server confirms a capability version. capsConfirm->capsSet->version identifies the negotiated version.
pcRdpgfxOnOpen
Called when the DVC is opened. Set *do_caps_advertise = TRUE to let the channel automatically send caps. Set *do_frame_acks = TRUE to enable frame acknowledgement.
pcRdpgfxOnClose
Called when the DVC is closed (e.g. session ended or reconnect).

Frame Lifecycle

pcRdpgfxResetGraphics
Called at session start or after a resize. resetGraphics->width/height give the new desktop dimensions. All surfaces from previous sessions are invalidated.
pcRdpgfxStartFrame
Marks the beginning of a graphics frame. startFrame->frameId and startFrame->timestamp can be used for latency measurement.
pcRdpgfxEndFrame
Marks the end of a frame. After rendering all SurfaceCommands between StartFrame and EndFrame, call FrameAcknowledge to signal completion.
pcRdpgfxSurfaceCommand
The primary rendering callback. cmd->codecId determines the encoding:
pcRdpgfxFrameAcknowledge
Send a frame acknowledgement to the server. frameAcknowledge->queueDepth reports the client-side decode queue depth to assist server-side rate control.

Surface Management

pcRdpgfxCreateSurface
Allocate a backing surface buffer. createSurface->surfaceId, width, height, and pixelFormat define it. Surfaces persist across frames until DeleteSurface.
pcRdpgfxDeleteSurface
Frees the backing buffer for deleteSurface->surfaceId.
pcRdpgfxMapSurfaceToOutput
Maps a surface at a given output origin. The surface content becomes visible at (outputOriginX, outputOriginY) in screen coordinates.
pcRdpgfxSetSurfaceData
Associates application data with a surface ID. Retrieve it later with GetSurfaceData.

Cache Operations

pcRdpgfxSurfaceToCache
Copies a rectangle from a surface into the persistent bitmap cache at cacheSlot with cacheKey.
pcRdpgfxCacheToSurface
Blits a cached bitmap to a set of destination points on a surface.
pcRdpgfxCacheImportOffer
Called when the server offers to pre-populate the cache from a persistent store. Respond with CacheImportReply.

H.264 / AVC Support

H.264 decoding in RDPGFX is handled transparently when the codec is available. Surface commands with codecId = RDPGFX_CODECID_AVC420 or RDPGFX_CODECID_AVC444 carry AVC bitstreams described by RDPGFX_AVC420_BITMAP_STREAM / RDPGFX_AVC444_BITMAP_STREAM.
Build with -DWITH_OPENH264=ON and provide the Cisco OpenH264 library to enable H.264 decode via libopenh264.
AVC capability flags in RDPGFX_CAPS_FLAG_AVC420_ENABLED and RDPGFX_CAPS_FLAG_AVC_DISABLED control whether AVC is advertised during caps negotiation. They are set automatically based on build-time codec availability.

Capability Versions

The RDPGFX channel requires the Dynamic Virtual Channel infrastructure (drdynvc). Ensure drdynvc is loaded before attempting to use RDPGFX.