XGameStreamingGetStreamPhysicalDimensions
스트리밍 클라이언트에서 현재 렌더링 중인 비디오 스트림의 물리적 크기를 가져옵니다.
구문
HRESULT XGameStreamingGetStreamPhysicalDimensions(
XGameStreamingClientId client,
uint32_t* horizontalMm,
uint32_t* verticalMm
)
매개 변수
client _In_
형식: XGameStreamingClientId
실제 크기를 쿼리할 클라이언트
horizontalMm _Out_
형식: uint32_t*
비디오 스트림의 가로 축 크기(밀리미터)
verticalMm _Out_
형식: uint32_t*
비디오 스트림의 세로 축 크기(밀리미터)
반환 값
형식: HRESULT
성공한 경우 S_OK를 반환하고, 그렇지 않으면 오류 코드를 반환합니다.
잠재적인 오류
오류 코드 | 오류 값 | 오류 발생 원인 |
---|---|---|
E_GAMESTREAMING_NOT_INITIALIZED | 0x89245400 | XGameStreaming 런타임이 아직 초기화되지 않았습니다. 다른 API를 호출하기 전에 XGameStreamingInitialize를 호출합니다. |
E_GAMESTREAMING_CLIENT_NOT_CONNECTED | 0x89245401 | 지정된 클라이언트가 연결되어 있지 않습니다. |
E_GAMESTREAMING_NO_DATA | 0x89245402 | 요청한 데이터를 사용할 수 없습니다. 나중에 데이터를 사용할 수 있습니다. |
오류 코드 목록은 오류 코드를 참조하세요.
설명
이 방법을 사용하여 스트림이 더 작은 장치(예: 스마트폰)로 전송될지 여부를 결정할 수 있습니다.
이를 통해 장치 크기에 따라 더 플레이어 친화적이고 장치에 적합한 경험(예: 더 큰 글꼴 크기 사용)을 제공할 수 있습니다.
게임에서 스트림의 물리적 크기 변경에 대응하려는 경우 XGameStreamingRegisterClientPropertiesChanged를 통해 콜백을 등록해야 합니다.
예제
다음 코드 예제에서는 XGameStreamingGetStreamPhysicalDimensions
함수를 사용하여 스트리밍 클라이언트의 가장 작은 크기를 찾는 방법을 보여 줍니다.
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;
}
요구 사항
헤더: xgamestreaming.h
라이브러리: xgameruntimelib
지원되는 플랫폼: Windows, Xbox One 패밀리 콘솔 및 Xbox Series 콘솔
참고 항목
XGameStreaming
XGameStreamingRegisterClientPropertiesChanged
XGameStreaming