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

# XGameStreamingGetStreamPhysicalDimensions

> XGameStreamingGetStreamPhysicalDimensions

Get the physical dimensions of the video stream as it renders on the streaming client.

## Syntax

```cpp theme={null}
HRESULT XGameStreamingGetStreamPhysicalDimensions(
         XGameStreamingClientId client,
         uint32_t* horizontalMm,
         uint32_t* verticalMm
)
```

### Parameters

*client*   \_In\_\
Type: XGameStreamingClientId

The client to query the physical size of.

*horizontalMm*   \_Out\_\
Type: uint32\_t\*

The size in millimeters of the horizontal axis of the video stream.

*verticalMm*   \_Out\_\
Type: uint32\_t\*

The size in millimeters of the vertical axis of the video stream.

### Return value

Type: HRESULT

Returns **S\_OK** if successful; otherwise, returns an error code.

**Potential Errors**

| Error Code | Error Value | Reason for Error |
| - | - | - |
| E\_GAMESTREAMING\_NOT\_INITIALIZED | 0x89245400 | The XGameStreaming runtime has not been 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 may be available later. |

For a list of error codes, see [Error Codes](https://docs.xbox.com/reference/errorcodes.md).

## Remarks

You can use this method to determine whether the stream will be sent to a smaller device (for example, a smartphone).

This allows you to present a more player friendly, device–appropriate experience (for example, by using a larger font size) based on the device size.

If you want the game to respond to changes in the physical dimensions of the stream, then you should register a callback via [XGameStreamingRegisterClientPropertiesChanged](https://docs.xbox.com/reference/system/xgamestreaming/functions/xgamestreamingregisterclientpropertieschanged.md).

## Example

The following code example demonstrates how to use the `XGameStreamingGetStreamPhysicalDimensions` function to find the smallest dimensions for a streaming client.

```cpp theme={null}
void GetSmallestStreamingClient(uint32_t& widthMm, uint32_t& heightMm)
    {
        // If we don't know what the smallest client is, then search through them to find it
        if (m_smallestClient == XGameStreamingNullClientId)
        {
            for (const auto client : m_streamingClients)
            {
                if (client.clientId != XGameStreamingNullClientId)
                {
                    uint32_t clientWidthMm = 0;
                    uint32_t clientHeightMm = 0;
                    if (SUCCEEDED(XGameStreamingGetStreamPhysicalDimensions(client.clientId, &clientWidthMm, &clientHeightMm)))
                    {
                        if (clientWidthMm < m_smallestClientWidthMm)
                        {
                            m_smallestClientWidthMm = clientWidthMm;
                            m_smallestClientHeightMm = clientHeightMm;
                        }
                    }
                }
            }
        }

        widthMm = m_smallestClientWidthMm;
        heightMm = m_smallestClientHeightMm;
    }
```

## Requirements

**Header:** xgamestreaming.h

**Library:** xgameruntimelib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

[XGameStreaming](https://docs.xbox.com/reference/system/xgamestreaming/xgamestreaming_members.md)\
[XGameStreamingRegisterClientPropertiesChanged](https://docs.xbox.com/reference/system/xgamestreaming/functions/xgamestreamingregisterclientpropertieschanged.md)\
[XGameStreaming](https://docs.xbox.com/reference/system/xgamestreaming/xgamestreaming_members.md#ClientProperties)


## Related topics

- [XGameStreamingClientProperty](https://docs.xbox.com/reference/system/xgamestreaming/enums/xgamestreamingclientproperty.md)
- [Development Best Practices for Xbox Game Streaming](https://docs.xbox.com/build/core-features/common/game-streaming/game-streaming-optimizing-your-game.md)
- [XGameStreaming (API contents)](https://docs.xbox.com/reference/system/xgamestreaming/xgamestreaming_members.md)
- [Xbox Accessibility Guideline 101](https://docs.xbox.com/build/game-principles/accessibility/xag-deep-dives/xag-101-text-display.md)
- [XGameStreamingGetStreamAddedLatency](https://docs.xbox.com/reference/system/xgamestreaming/functions/xgamestreaminggetstreamaddedlatency.md)
