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

# XGameStreaming (API contents)

> XGameStreaming

## Initialization

APIs needed to initialize the game streaming capabilities.

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

## Client properties

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

### Functions

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

### Enumerations

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

### Structures

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

## Connection state

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

### Functions

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

### Enumerations

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

## Latency

APIs for adapting gameplay for streaming latency.

### Functions

| Function | Description |
| :- | :- |
| [XGameStreamingGetStreamAddedLatency](https://docs.xbox.com/reference/system/xgamestreaming/functions/xgamestreaminggetstreamaddedlatency.md) | Gets the recent average of the streaming related latency. |
| [XGameStreamingGetLastFrameDisplayed](https://docs.xbox.com/reference/system/xgamestreaming/functions/xgamestreaminggetlastframedisplayed.md) | **Deprecated.** Gets the frame pipeline token for the frame that was most recently displayed on the streaming client's screen. |
| [XGameStreamingGetAssociatedFrame](https://docs.xbox.com/reference/system/xgamestreaming/functions/xgamestreaminggetassociatedframe.md) | **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](https://docs.xbox.com/reference/system/xgamestreaming/functions/xgamestreaminggetserverlocationname.md) | Gets the streaming server's data center location. |
| [XGameStreamingGetServerLocationNameSize](https://docs.xbox.com/reference/system/xgamestreaming/functions/xgamestreaminggetserverlocationnamesize.md) | Gets the size of the name of the location of the streaming server's data center |

## Touch adaptation

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

### Functions

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

### Enumerations

| Enumeration | Description |
| :- | :- |
| [XGameStreamingGamepadPhysicality](https://docs.xbox.com/reference/system/xgamestreaming/enums/xgamestreaminggamepadphysicality.md) | 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](https://docs.xbox.com/reference/system/xgamestreaming/enums/xgamestreamingtouchcontrolsstateoperationkind.md) | Operations that can be taken when updating touch control layout state. |
| [XGameStreamingTouchControlsStateValueKind](https://docs.xbox.com/reference/system/xgamestreaming/enums/xgamestreamingtouchcontrolsstatevaluekind.md) | Specifies the type of the state that is associated with the touch layouts. |

### Structures

| Structures | Description |
| :- | :- |
| [XGameStreamingTouchControlsStateOperation](https://docs.xbox.com/reference/system/xgamestreaming/structs/xgamestreamingtouchcontrolsstateoperation.md) | Specifies the operation, path to the specific variable and value to be applied. |
| [XGameStreamingTouchControlsStateValue](https://docs.xbox.com/reference/system/xgamestreaming/structs/xgamestreamingtouchcontrolsstatevalue.md) | 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](https://docs.xbox.com/reference/system/xgamestreaming/functions/xgamestreamingsetresolution.md) | 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](https://docs.xbox.com/reference/errorcodes.md).

| Code | Value | Description |
| - | - | - |
| E\_GAMESTREAMING\_NOT\_INITIALIZED | 0x89245400 | The XGameStreaming runtime is not initialized. Call [XGameStreamingInitialize](https://docs.xbox.com/reference/system/xgamestreaming/functions/xgamestreaminginitialize.md) 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](https://docs.xbox.com/build/core-features/common/game-streaming/game-streaming-am-i-streaming.md)
* [Getting started with touch](https://docs.xbox.com/build/core-features/common/game-streaming/game-streaming-getting-started-with-touch.md)
* [Game streaming latency compensation deep dive](https://docs.xbox.com/build/core-features/common/game-streaming/game-streaming-latency-compensation-deep-dive.md)
* [Game streaming latency compensation overview](https://docs.xbox.com/build/core-features/common/game-streaming/game-streaming-latency-compensation-overview.md)
* [Game streaming latency measurement](https://docs.xbox.com/build/core-features/common/game-streaming/game-streaming-latency-measurement.md)

## See also

[System API reference](https://docs.xbox.com/reference/system/gc-reference-system-toc.md)


## Related topics

- [Game streaming latency measurement](https://docs.xbox.com/build/core-features/common/game-streaming/game-streaming-latency-measurement.md)
- [Game streaming latency compensation overview](https://docs.xbox.com/build/core-features/common/game-streaming/game-streaming-latency-compensation-overview.md)
- [Game streaming latency compensation deep dive](https://docs.xbox.com/build/core-features/common/game-streaming/game-streaming-latency-compensation-deep-dive.md)
- [Cloud Aware API calls](https://docs.xbox.com/build/core-features/common/game-streaming/game-streaming-am-i-streaming.md)
- [Getting started with touch](https://docs.xbox.com/build/core-features/common/game-streaming/game-streaming-getting-started-with-touch.md)
