XGameStreamingSetResolution
Sets the resolution of the stream.Syntax
Parameters
width _In_Type: uint32_t The width to set the stream resolution to. height _In_
Type: uint32_t The height to set the stream resolution to.
Return value
Type: HRESULT Returns S_OK if successful; otherwise, returns an error code.Potential Errors
For a list of error codes, see Error Codes.
Remarks
This API with non-standard resolutions will only succeed on XBOX Game Streaming servers, XBOX Series X Dev Kit, and XBOX Series S Test Kit. Standard resolutions like 720p and 1080p will succeed regardless of the hardware. The reason is because a retail XBOX can only stream via Remote Play and may still be outputting video to the TV so using a non-standard resolution would produce a distorted image. The width and height must be a minimum of 640x360 and the maximum can be found in themaxWidth and maxHeight fields of the XGameStreamingDisplayDetails which can be retrieved from XGameStreamingGetDisplayDetails.
The maximum pixels, calculated from width * height, must be equal to or less than the encoder’s maximum. The maximum can be found by using the XGameStreamingGetDisplayDetails API. This value may be increased in the future.
The width and height must be divisible by 8.
The API can be called as frequently as desired however the stream resolution can only change once every 200ms. The last resolution from any calls that occur within that 200ms window will be applied after that window has elapsed.
Be aware that this API will set the resolution on the stream for all connected clients. This means that special consideration must be taken to determine what is the best option for the game when multiple clients are connected. It may mean using a standard 16:9 resolution or it may mean trying to find the resolution that best fits all clients.
Changing the stream resolution modifies view rectangle scaling in ID3D12CommandQueue::PresentX. D3D12XBOX_PRESENT_PLANE_PARAMETERS.pDestPlacementBase scale factors of 0.0-1.0 refer to the height and width passed to XGameStreamingSetResolution, rather than the standard 1920x1080 or 3840x2160 resolution they would otherwise refer to.
Example
Requirements
Header: xgamestreaming.hLibrary: xgameruntime.lib
Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles
See also
XGameStreamingXGameStreamingDisplayDetails
XGameStreamingGetDisplayDetails
Custom Resolution Overview
