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.

Visit our GitHub repo for binaries and examples. Visit our Discord server for discussion and support.

Instance Functions

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

NameDescription
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.

Client Functions

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

NameDescription
ParsecClientConnectConnect to a remote Parsec host.
ParsecClientDisconnectDisconnect client.
ParsecClientGetStatusGet client connection health and status information.
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.
ParsecClientGLRenderFrameWaits for and efficiently renders a remote video frame with OpenGL/GLES.
ParsecClientGLDestroyCleanup internal OpenGL/GLES state.
ParsecClientSendMessageSend an input message to the remote host.
ParsecClientSendUserDataSend a user-defined string to the remote host.

Host Functions

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

NameDescription
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.
ParsecHostD3D11SubmitFrameSubmit rendered D3D11 frame to connected guests. HOST_GAME only. Windows only.

Structures

NameDescription
ParsecConfigParsec instance configuration.
ParsecFrameVideo frame 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.
ParsecMessageGeneric input message that can represent any message type.
ParsecClientConfigClient configuration.
ParsecClientStatusClient connection health and status information.
ParsecClientCursorEventCursor mode/image update event.
ParsecClientRumbleEventGamepad rumble data event.
ParsecClientUserDataEventUser-defined host message event.
ParsecClientEventGeneric client event that can represent any event type.
ParsecHostConfigHost configuration.
ParsecHostStatusHost runtime status.
ParsecGuestStateChangeEventGuest connection state change event.
ParsecUserDataEventUser-defined guest message event.
ParsecHostEventGeneric host event that can represent any event type.

Enumerations

NameDescription
ParsecStatusStatus codes indicating success, warning, or error.
ParsecLogLevelLog level.
ParsecKeycodeKeyboard input.
ParsecKeymodStateful modifier keys applied to keyboard input.
ParsecMouseButtonMouse button.
ParsecGamepadButtonGamepad button.
ParsecGamepadAxisGamepad axes related to thumbsticks and triggers.
ParsecMessageTypeInput message type.
ParsecColorFormatColor formats 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.
ParsecHostEventTypeHost event type.
ParsecClientEventTypeClient event type.

Typedefs

TypeName (Params)
ParsecParsec instance.
ParsecGLuintOpenGL/GLES 32-bit unsigned integer.
ParsecD3D11DeviceD3D11 ID3D11Device.
ParsecD3D11DeviceContextD3D11 ID3D11DeviceContext.
ParsecD3D11Texture2DD3D11 ID3D11Texture2D.
ParsecLogCallbackFired when a new log message is available from the Parsec SDK.
ParsecFrameCallbackFired synchronously if a new frame is available from the host.
ParsecAudioCallbackFired synchronously if new audio is available from the host.

Defines

NameDescription
GUEST_NAME_LEN(320) Maximum length of a guest's name. Used in ParsecGuest.
ATTEMPT_ID_LEN(56) Length in bytes of an Attempt ID. Used in ParsecGuest and ParsecClientStatus.
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.
GAME_ID_LEN(72) Maximum length of a Game ID. Used in ParsecHostConfig.
PARSEC_VER_MAJOR(1) Parsec SDK breaking API/ABI change.
PARSEC_VER_MINOR(0) Parsec SDK internal implementation detail.
PARSEC_VER32-bit concatenated major/minor version.
PARSEC_DEFAULTSDefault Parsec instance configuration passed to ParsecInit.
PARSEC_HOST_DEFAULTSDefault host configuration passed to ParsecHostStart and ParsecHostSetConfig.
PARSEC_CLIENT_DEFAULTSDefault client configuration passed to ParsecClientConnect.