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

# XGameStreamingGetStreamPhysicalDimensions

> XGameStreamingGetStreamPhysicalDimensions

# XGameStreamingGetStreamPhysicalDimensions

Obtém as dimensões físicas do fluxo de vídeo conforme ele é renderizado no cliente de streaming.

<a id="syntaxSection" />

## Sintaxe

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

<a id="parametersSection" />

### Parâmetros

*client*   \_In\_\
Tipo: XGameStreamingClientId

O cliente cujo tamanho físico será consultado.

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

O tamanho, em milímetros, do eixo horizontal do fluxo de vídeo.

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

O tamanho, em milímetros, do eixo vertical do fluxo de vídeo.

<a id="retvalSection" />

### Valor retornado

Tipo: HRESULT

Retornará **S\_OK** se for bem-sucedido; caso contrário, retornará um código de erro.

**Erros potenciais**

| Código de erro | Valor do erro | Motivo do erro |
| - | - | - |
| E\_GAMESTREAMING\_NOT\_INITIALIZED | 0x89245400 | O runtime do XGameStreaming não foi inicializado. Chame [XGameStreamingInitialize](/pt-BR/reference/system/xgamestreaming/functions/xgamestreaminginitialize) antes de chamar outras APIs. |
| E\_GAMESTREAMING\_CLIENT\_NOT\_CONNECTED | 0x89245401 | O cliente especificado não está conectado. |
| E\_GAMESTREAMING\_NO\_DATA | 0x89245402 | Os dados solicitados não estão disponíveis. Os dados podem ficar disponíveis mais tarde. |

Para obter uma lista de códigos de erro, consulte [Códigos de erro](/pt-BR/reference/errorcodes).

<a id="remarksSection" />

## Comentários

Você pode usar este método para determinar se o fluxo será enviado para um dispositivo menor (por exemplo, um smartphone).

Isso permite apresentar uma experiência mais amigável ao jogador e adequada ao dispositivo (por exemplo, usando um tamanho de fonte maior) com base no tamanho do dispositivo.

Se quiser que o jogo responda a alterações nas dimensões físicas do fluxo, você deverá registrar um retorno de chamada por meio de [XGameStreamingRegisterClientPropertiesChanged](/pt-BR/reference/system/xgamestreaming/functions/xgamestreamingregisterclientpropertieschanged).

<a id="exampleSection" />

## Exemplo

O exemplo de código a seguir demonstra como usar a função `XGameStreamingGetStreamPhysicalDimensions` para encontrar as menores dimensões de um cliente de streaming.

```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;
    }
```

<a id="requirementsSection" />

## Requisitos

**Cabeçalho:** xgamestreaming.h

**Biblioteca:** xgameruntimelib

**Plataformas com suporte:** Windows, consoles da família XBOX One e consoles XBOX Series

<a id="seealsoSection" />

## Confira também

[XGameStreaming](/pt-BR/reference/system/xgamestreaming/xgamestreaming_members)\
[XGameStreamingRegisterClientPropertiesChanged](/pt-BR/reference/system/xgamestreaming/functions/xgamestreamingregisterclientpropertieschanged)\
[XGameStreaming](/pt-BR/reference/system/xgamestreaming/xgamestreaming_members#ClientProperties)


## Related topics

- [XGameStreamingGetStreamPhysicalDimensions](/reference/system/xgamestreaming/functions/xgamestreaminggetstreamphysicaldimensions.md)
- [XGameStreamingClientProperty](/reference/system/xgamestreaming/enums/xgamestreamingclientproperty.md)
- [Optimizing your game for XBOX Game Streaming](/build/core-features/common/game-streaming/game-streaming-optimizing-your-game.md)
- [XBOX Game Streaming을 위한 게임 최적화](/ko/build/core-features/common/game-streaming/game-streaming-optimizing-your-game.md)
