Parsec SDK Overview

The Parsec SDK allows your application to make interactive, low–latency peer–to–peer connections for the purpose of game streaming. The SDK handles the low level internals of peer–to–peer connectivity, networking, and hardware accelerated video/audio processing. It is lightweight, consisting of a single header file and a shared object < 5MB.

Instance Functions

Instance functions operate either globally or on the top–level Parsec instance.

ParsecInitInitialize Parsec instance.
ParsecDestroyDestroy Parsec instance.
ParsecGetConfigGet Parsec runtime configuration.
ParsecGetBufferGet an internal dynamically allocated buffer by 32-bit lookup key.
ParsecFreeFree a dynamically allocated buffer returned by ParsecGetBuffer.
ParsecSetLogCallbackReceive log messages accross all Parsec instances.
ParsecVersionRetrieve the Parsec SDK internal PARSEC_VER.
ParsecGetOutputsGet a list of currently available outputs. Windows only.
ParsecGetDecodersGet a list of currently available video decoders.

Client Functions

Client functions deal with making a connection to a host, sending input, rendering frames, and playing audio.

ParsecClientConnectBegin connecting to a remote Parsec host.
ParsecClientDisconnectDisconnect client.
ParsecClientGetStatusGet client connection health and status information.
ParsecClientGetGuestsGet a list of all guests currently connected to the host.
ParsecClientSetConfigSet client configuration.
ParsecClientSetDimensionsSet client window dimensions and screen scale.
ParsecClientPollFramePoll for a new video frame from the host and make it available in system memory.
ParsecClientPollAudioPoll for new audio from the host.
ParsecClientPollEventsPoll client events.
ParsecClientGLRenderFrameRenders a remote video frame with OpenGL/GLES.
ParsecClientMetalRenderFrameRenders a remote video frame with Metal.
ParsecClientD3D9RenderFrameRenders a remote video frame with D3D9.
ParsecClientD3D11RenderFrameRenders a remote video frame with D3D11.
ParsecClientGLDestroyCleanup internal OpenGL/GLES state.
ParsecClientSendMessageSend an input message to the host.
ParsecClientPausePause video and/or audio output from the host.
ParsecClientEnableStreamEnable or disable video streams.
ParsecClientSendUserDataSend a user-defined string to the host.

Host Functions

Host functions deal with accepting guest connections, polling host/guest events, and in HOST_GAME submitting video/audio.

ParsecHostStartStart accepting guests.
ParsecHostStopDisconnect all guests and stop hosting.
ParsecHostGetStatusGet current hosting status.
ParsecHostSetConfigSet host configuration.
ParsecHostGetGuestsGet a list of all connected and/or waiting guests.
ParsecHostKickGuestKick guest.
ParsecHostSendUserDataSend a user-defined message to a guest.
ParsecHostPollEventsPoll host events.
ParsecHostAllowGuestAllow or reject a pending guest. HOST_DESKTOP only.
ParsecHostSetPermissionsChange guest input permissions. HOST_DESKTOP only.
ParsecHostPollInputPoll input messages from connected guests. HOST_GAME only.
ParsecHostSubmitAudioSubmit PCM audio to connected guests. HOST_GAME only.
ParsecHostSubmitCursorSubmit a cursor mode and/or image update to connected guests. HOST_GAME only.
ParsecHostSubmitRumbleSubmit gamepad rumble data to a connected guests. HOST_GAME only.
ParsecHostGLSubmitFrameSubmit rendered OpenGL frame to connected guests. HOST_GAME only.
ParsecHostD3D9SubmitFrameSubmit rendered D3D9 frame to connected guests. HOST_GAME only. Windows only.
ParsecHostD3D11SubmitFrameSubmit rendered D3D11 frame to connected guests. HOST_GAME only. Windows only.


ParsecConfigParsec instance configuration.
ParsecFrameVideo frame properties.
ParsecRectRectangle defined by the coordinates of its upper-left and lower-right corners.
ParsecOutputOutput (monitor) properties.
ParsecCursorCursor properties.
ParsecPermissionsGuest input permissions.
ParsecMetricsLatency performance metrics.
ParsecGuestGuest properties.
ParsecKeyboardMessageKeyboard message.
ParsecMouseButtonMessageMouse button message.
ParsecMouseWheelMessageMouse wheel message.
ParsecMouseMotionMessageMouse motion message.
ParsecGamepadButtonMessageGamepad button message.
ParsecGamepadAxisMessageGamepad axis message.
ParsecGamepadUnplugMessageGamepad unplug message.
ParsecGamepadStateMessageGamepad state message.
ParsecMessageGeneric input message that can represent any message type.
ParsecClientVideoConfigClient video configuration.
ParsecClientConfigClient configuration.
ParsecDecoderDecoder description.
ParsecClientStatusClient connection health and status information.
ParsecClientCursorEventCursor mode/image update event.
ParsecClientRumbleEventGamepad rumble data event.
ParsecClientStreamEventVideo stream status change event.
ParsecClientUserDataEventUser-defined host message event.
ParsecClientEventGeneric client event that can represent any event type.
ParsecHostVideoConfigHost video configuration.
ParsecHostConfigHost configuration.
ParsecHostStatusHost runtime status.
ParsecGuestStateChangeEventGuest connection state change event.
ParsecUserDataEventUser-defined guest message event.
ParsecHostEventGeneric host event that can represent any event type.


ParsecStatusStatus codes indicating success, warning, or error.
ParsecLogLevelLog level.
ParsecKeycodeKeyboard input.
ParsecKeymodModifier keys applied to keyboard input.
ParsecMouseButtonMouse button.
ParsecGamepadButtonGamepad button.
ParsecGamepadStateGamepad state button.
ParsecGamepadAxisGamepad axes related to thumbsticks and triggers.
ParsecMessageTypeInput message type.
ParsecColorFormatColor formats for raw image data.
ParsecRotationDegrees of rotation for raw image data.
ParsecProtocolNetwork protocol used for peer-to-peer connections.
ParsecContainerVideo stream container.
ParsecPCMFormatPCM audio format.
ParsecGuestStateGuest connection lifecycle states.
ParsecHostModeHost mode of operation.
ParsecGamepadTypeVirtual gamepad type.
ParsecHostEventTypeHost event type.
ParsecClientEventTypeClient event type.


TypeName (Params)
ParsecParsec instance.
ParsecGLuintOpenGL/GLES 32-bit unsigned integer.
ParsecMetalCommandQueueMetal id<MTLCommandQueue>.
ParsecMetalTextureMetal id<MTLTexture>.
ParsecD3D9DeviceD3D9 IDirect3DDevice9.
ParsecD3D9SurfaceD3D9 IDirect3DSurface9.
ParsecD3D11DeviceD3D11 ID3D11Device.
ParsecD3D11DeviceContextD3D11 ID3D11DeviceContext.
ParsecD3D11Texture2DD3D11 ID3D11Texture2D.
ParsecLogCallbackFired when a new log message is available from the Parsec SDK.
ParsecFrameCallbackFired synchronously if a new host video frame is available.
ParsecPreRenderCallbackFired synchronously just before a new host video frame is rendered.
ParsecAudioCallbackFired synchronously if new audio is available from the host.


GUEST_NAME_LEN(32) Maximum length of a guest's name. Used in ParsecGuest.
EXTERNAL_ID_LEN(64) Maximum length of a guest's external ID. Used in ParsecGuest.
HOST_NAME_LEN(256) Maximum length of a host's name. Used in ParsecHostConfig.
HOST_DESC_LEN(512) Maximum length of a game's description. Used in ParsecHostConfig.
HOST_SECRET_LEN(32) Maximum length of a host's secret code to grant temporary access. Used in ParsecHostConfig and ParsecClientConfig.
OUTPUT_ID_LEN(64) Maximum length of a host output identifier.
OUTPUT_NAME_LEN(256) Maximum length of an output's name in ParsecOutput.
ADAPTER_NAME_LEN(256) Maximum length of an adapter's name in ParsecOutput.
GAME_ID_LEN(72) Maximum length of a Game ID. Used in ParsecHostConfig.
NUM_VSTREAMS(2) Maximum number of video streams per client connection.
DEFAULT_STREAM(0) The default video stream, enabled automatically on client connection to the host.
DECODER_NAME_LEN(16) Maximum length of a decoder name. Used in ParsecDecoder.
PARSEC_VER_MAJOR(6) Parsec SDK breaking API/ABI change.
PARSEC_VER_MINOR(0) Parsec SDK internal implementation detail or additional functionality.
PARSEC_VER32-bit concatenated major/minor version.
PARSEC_DEFAULTSDefault Parsec instance configuration passed to ParsecInit.
PARSEC_HOST_VIDEO_DEFAULTSDefault host video configuration, one per stream, member of ParsecHostConfig.
PARSEC_HOST_DEFAULTSDefault host configuration passed to ParsecHostStart and ParsecHostSetConfig.
PARSEC_CLIENT_VIDEO_DEFAULTSDefault client video configuration, one per stream, member of ParsecClientConfig.
PARSEC_CLIENT_DEFAULTSDefault client configuration passed to ParsecClientConnect and ParsecClientSetConfig.