> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XGameStreaming

> XGameStreaming

# XGameStreaming

## Initialization

APIs needed to initialize the game streaming capabilities.

| Function                                                                                            | Description                            |
| :-------------------------------------------------------------------------------------------------- | :------------------------------------- |
| [XGameStreamingInitialize](/reference/system/xgamestreaming/functions/xgamestreaminginitialize)     | Initalizes the Game Streaming APIs.    |
| [XGameStreamingUninitialize](/reference/system/xgamestreaming/functions/xgamestreaminguninitialize) | Uninitializes the Game Streaming APIs. |

<a id="ClientProperties" />

## Client Properties

APIs to get properties of the streaming devices or their game stream

### Functions

| Function                                                                                                                                      | Description                                                                                               |
| :-------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------- |
| [XGameStreamingClientPropertiesChangedCallback](/reference/system/xgamestreaming/functions/xgamestreamingclientpropertieschangedcallback)     | Notification when a streaming device's properties have changed.                                           |
| [XGameStreamingGetClientIPAddress](/reference/system/xgamestreaming/functions/xgamestreaminggetclientipaddress)                               | **Deprecated.** Gets the IP address of the streaming client. Use XSTS token claims instead.               |
| [XGameStreamingGetDisplayDetails](/reference/system/xgamestreaming/functions/xgamestreaminggetdisplaydetails)                                 | Gets the display details of the streaming client.                                                         |
| [XGameStreamingGetSessionId](/reference/system/xgamestreaming/functions/xgamestreaminggetsessionid)                                           | Gets the session id of the streaming client.                                                              |
| [XGameStreamingGetStreamPhysicalDimensions](/reference/system/xgamestreaming/functions/xgamestreaminggetstreamphysicaldimensions)             | Gets the physical size of the video stream as it is currently being rendered on the streaming client.     |
| [XGameStreamingGetTouchBundleVersion](/reference/system/xgamestreaming/functions/xgamestreaminggettouchbundleversion)                         | Gets the version of the touch adaptation bundle that is currently being utilized on the specified device. |
| [XGameStreamingGetTouchBundleVersionNameSize](/reference/system/xgamestreaming/functions/xgamestreaminggettouchbundleversionnamesize)         | Gets the size of the version name specified in the touch adaptation bundle on the specified device.       |
| [XGameStreamingIsTouchInputEnabled](/reference/system/xgamestreaming/functions/xgamestreamingistouchinputenabled)                             | Check if a client will send touch inputs to the game.                                                     |
| [XGameStreamingRegisterClientPropertiesChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterclientpropertieschanged)     | Registers a callback to be invoked when any of the streaming client device's properties change.           |
| [XGameStreamingUnregisterClientPropertiesChanged](/reference/system/xgamestreaming/functions/xgamestreamingunregisterclientpropertieschanged) | Unregisters a previously registered XGameStreamingClientPropertiesChangedCallback.                        |

### Enumerations

| Enumeration                                                                                         | Description                                                                    |
| :-------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------- |
| [XGameStreamingClientProperty](/reference/system/xgamestreaming/enums/xgamestreamingclientproperty) | Properties that can be queried for about the client streaming device.          |
| [XGameStreamingVideoFlags](/reference/system/xgamestreaming/enums/xgamestreamingvideoflags)         | Available video features that may be supported by the client streaming device. |

### Structures

| Structures                                                                                            | Description                                               |
| :---------------------------------------------------------------------------------------------------- | :-------------------------------------------------------- |
| [XGameStreamingDisplayDetails](/reference/system/xgamestreaming/structs/xgamestreamingdisplaydetails) | Details about the display of the streaming client device. |

<a id="ConnectionState" />

## Connection State

APIs needed to manage the connection state of streaming client devices.

### Functions

| Function                                                                                                                                    | Description                                                                                   |
| :------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------- |
| [XGameStreamingConnectionStateChangedCallback](/reference/system/xgamestreaming/functions/xgamestreamingconnectionstatechangedcallback)     | A callback function to be invoked whenever the state of a connected streaming client changes. |
| [XGameStreamingGetClientCount](/reference/system/xgamestreaming/functions/xgamestreaminggetclientcount)                                     | Number of streaming devices currently connected.                                              |
| [XGameStreamingGetClients](/reference/system/xgamestreaming/functions/xgamestreaminggetclients)                                             | Gets the identifiers of each currently connected client.                                      |
| [XGameStreamingGetConnectionState](/reference/system/xgamestreaming/functions/xgamestreaminggetconnectionstate)                             | Gets the current connection state for specified device.                                       |
| [XGameStreamingIsStreaming](/reference/system/xgamestreaming/functions/xgamestreamingisstreaming)                                           | Determine if the game is currently being streamed.                                            |
| [XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged)     | Registers a callback to be invoked when a streaming client device's connection state changes. |
| [XGameStreamingUnregisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingunregisterconnectionstatechanged) | Unregisters a previously registered XGameStreamingConnectionStateChangedCallback.             |

### Enumerations

| Enumeration                                                                                           | Description                                      |
| :---------------------------------------------------------------------------------------------------- | :----------------------------------------------- |
| [XGameStreamingConnectionState](/reference/system/xgamestreaming/enums/xgamestreamingconnectionstate) | Connection states for a streaming client device. |

<a id="Latency" />

## Latency

APIs for adapting gameplay for streaming latency.

### Functions

| Function                                                                                                              | Description                                                                                                                    |
| :-------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------- |
| [XGameStreamingGetStreamAddedLatency](/reference/system/xgamestreaming/functions/xgamestreaminggetstreamaddedlatency) | Gets the recent average of the streaming related latency.                                                                      |
| [XGameStreamingGetLastFrameDisplayed](/reference/system/xgamestreaming/functions/xgamestreaminggetlastframedisplayed) | **Deprecated.** Gets the frame pipeline token for the frame that was most recently displayed on the streaming client's screen. |
| [XGameStreamingGetAssociatedFrame](/reference/system/xgamestreaming/functions/xgamestreaminggetassociatedframe)       | **Deprecated.** Gets the frame pipeline token from a specific input reading.                                                   |

## Server Location

APIs to access the location that the game is being streamed from.

### Functions

| Function                                                                                                                      | Description                                                                     |
| :---------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------ |
| [XGameStreamingGetServerLocationName](/reference/system/xgamestreaming/functions/xgamestreaminggetserverlocationname)         | Gets the streaming server's data center location.                               |
| [XGameStreamingGetServerLocationNameSize](/reference/system/xgamestreaming/functions/xgamestreaminggetserverlocationnamesize) | Gets the size of the name of the location of the streaming server's data center |

<a id="TouchAdaptation" />

## Touch Adaptation

APIs to manage the touch controller layouts that will be exposed to appropriate streaming clients.

### Functions

| Function                                                                                                                                                    | Description                                                                                                                  |
| :---------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------- |
| [XGameStreamingGetGamepadPhysicality](/reference/system/xgamestreaming/functions/xgamestreaminggetgamepadphysicality)                                       | Gets the input physicality mapping from a specific gamepad reading.                                                          |
| [XGameStreamingHideTouchControls](/reference/system/xgamestreaming/functions/xgamestreaminghidetouchcontrols)                                               | Request that all connected streaming client devices hide the touch layout if they are visible.                               |
| [XGameStreamingHideTouchControlsOnClient](/reference/system/xgamestreaming/functions/xgamestreaminghidetouchcontrolsonclient)                               | Request that a specified streaming client device hide the touch layout if it is visible.                                     |
| [XGameStreamingShowTouchControlLayout](/reference/system/xgamestreaming/functions/xgamestreamingshowtouchcontrollayout)                                     | Request that all connected streaming client devices show a specified touch layout.                                           |
| [XGameStreamingShowTouchControlLayoutOnClient](/reference/system/xgamestreaming/functions/xgamestreamingshowtouchcontrollayoutonclient)                     | Request a specified connected streaming client device to show a specified touch layout.                                      |
| [XGameStreamingShowTouchControlsWithStateUpdate](/reference/system/xgamestreaming/functions/xgamestreamingshowtouchcontrolswithstateupdate)                 | Request that all connected streaming client devices update their touch control state and then show a specified touch layout. |
| [XGameStreamingShowTouchControlsWithStateUpdateOnClient](/reference/system/xgamestreaming/functions/xgamestreamingshowtouchcontrolswithstateupdateonclient) | Request that a specified streaming client devices update their touch control state and then show a specified touch layout.   |
| [XGameStreamingUpdateTouchControlsState](/reference/system/xgamestreaming/functions/xgamestreamingupdatetouchcontrolsstate)                                 | Update touch controls state on all connected streaming client devices.                                                       |
| [XGameStreamingUpdateTouchControlsStateOnClient](/reference/system/xgamestreaming/functions/xgamestreamingupdatetouchcontrolsstateonclient)                 | Update touch controls state on a specified streaming client device.                                                          |

### Enumerations

| Enumeration                                                                                                                           | Description                                                                                                                                                                                        |
| :------------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [XGameStreamingGamepadPhysicality](/reference/system/xgamestreaming/enums/xgamestreaminggamepadphysicality)                           | Physicality mapping for all the buttons, sticks, and triggers on a standard XBOX Wireless Controller.  For any given button/stick/trigger, physicality can be unknown, physical, virtual, or both. |
| [XGameStreamingTouchControlsStateOperationKind](/reference/system/xgamestreaming/enums/xgamestreamingtouchcontrolsstateoperationkind) | Operations that can be taken when updating touch control layout state.                                                                                                                             |
| [XGameStreamingTouchControlsStateValueKind](/reference/system/xgamestreaming/enums/xgamestreamingtouchcontrolsstatevaluekind)         | Specifies the type of the state that is associated with the touch layouts.                                                                                                                         |

### Structures

| Structures                                                                                                                      | Description                                                                     |
| :------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------ |
| [XGameStreamingTouchControlsStateOperation](/reference/system/xgamestreaming/structs/xgamestreamingtouchcontrolsstateoperation) | Specifies the operation, path to the specific variable and value to be applied. |
| [XGameStreamingTouchControlsStateValue](/reference/system/xgamestreaming/structs/xgamestreamingtouchcontrolsstatevalue)         | Provides the type and value of a specific element of touch control state.       |

## Resolution

APIs to manage the stream's resolution.

### Functions

| Function                                                                                              | Description                              |
| :---------------------------------------------------------------------------------------------------- | :--------------------------------------- |
| [XGameStreamingSetResolution](/reference/system/xgamestreaming/functions/xgamestreamingsetresolution) | Sets the resolution of the video stream. |

## Error Codes

The following error codes may be returned by XGameStreaming APIs. For a complete list, see [Error codes](/reference/errorcodes).

| Code                                         | Value      | Description                                                                                                                                                                    |
| -------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| E\_GAMESTREAMING\_NOT\_INITIALIZED           | 0x89245400 | The XGameStreaming runtime is not initialized. Call [XGameStreamingInitialize](/reference/system/xgamestreaming/functions/xgamestreaminginitialize) before calling other APIs. |
| E\_GAMESTREAMING\_CLIENT\_NOT\_CONNECTED     | 0x89245401 | The specified client is not connected.                                                                                                                                         |
| E\_GAMESTREAMING\_NO\_DATA                   | 0x89245402 | The requested data is not available. The data might be available later.                                                                                                        |
| E\_GAMESTREAMING\_NO\_DATACENTER             | 0x89245403 | The current machine is not running in a datacenter.                                                                                                                            |
| E\_GAMESTREAMING\_NOT\_STREAMING\_CONTROLLER | 0x89245404 | The current reading did not come from a streaming controller.                                                                                                                  |

## Conceptual documentation

* [Cloud Aware API calls](/build/core-features/common/game-streaming/game-streaming-am-i-streaming)
* [Getting started with touch](/build/core-features/common/game-streaming/game-streaming-getting-started-with-touch)
* [Game streaming latency compensation deep dive](/build/core-features/common/game-streaming/game-streaming-latency-compensation-deep-dive)
* [Game streaming latency compensation overview](/build/core-features/common/game-streaming/game-streaming-latency-compensation-overview)
* [Game streaming latency measurement](/build/core-features/common/game-streaming/game-streaming-latency-measurement)

## See also

[System API reference](/reference/system/gc-reference-system-toc)


## Related topics

- [XGameStreamingIsStreaming](/reference/system/xgamestreaming/functions/xgamestreamingisstreaming.md)
- [XGameStreamingUninitialize](/reference/system/xgamestreaming/functions/xgamestreaminguninitialize.md)
- [XGameStreamingInitialize](/reference/system/xgamestreaming/functions/xgamestreaminginitialize.md)
- [XGameStreamingGetClients](/reference/system/xgamestreaming/functions/xgamestreaminggetclients.md)
- [XGameStreamingClientProperty](/reference/system/xgamestreaming/enums/xgamestreamingclientproperty.md)
