Declares video mode selection helpers.
More...
#include <string>
#include <vector>
#include <hal/video.h>
Go to the source code of this file.
Declares video mode selection helpers.
◆ choose_best_video_mode()
| VIDEO_MODE startup::choose_best_video_mode |
( |
const std::vector< VIDEO_MODE > & | availableVideoModes | ) |
|
Choose the best video mode from an already collected list.
- Parameters
-
| availableVideoModes | The list of candidate modes to evaluate. |
- Returns
- The preferred mode, or a default-initialized VIDEO_MODE when the input list is empty.
◆ choose_default_stream_video_mode() [1/2]
| VIDEO_MODE startup::choose_default_stream_video_mode |
( |
const std::vector< VIDEO_MODE > & | availableVideoModes, |
|
|
const VIDEO_MODE & | outputVideoMode ) |
Choose the default stream-resolution mode from detected Xbox modes.
- Parameters
-
| availableVideoModes | Detected Xbox video modes exposed in settings. |
| outputVideoMode | Active Xbox output mode selected at startup. |
- Returns
- A detected default mode when possible, otherwise a canonical fallback.
◆ choose_default_stream_video_mode() [2/2]
| VIDEO_MODE startup::choose_default_stream_video_mode |
( |
const VIDEO_MODE & | outputVideoMode | ) |
|
Choose the default stream-resolution mode for the current output mode.
The default favors an SD Xbox mode to keep software decoding practical.
- Parameters
-
| outputVideoMode | Active Xbox output mode selected at startup. |
- Returns
- Default stream-resolution mode for new or missing settings.
◆ filter_stream_video_modes_for_encoder_settings()
| std::vector< VIDEO_MODE > startup::filter_stream_video_modes_for_encoder_settings |
( |
const std::vector< VIDEO_MODE > & | availableVideoModes, |
|
|
unsigned long | encoderSettings ) |
Filter detected stream-resolution modes through display-aspect encoder settings.
XVideoListModes() already filters progressive and HD modes through the encoder settings. This helper applies the widescreen flag so SD wide-width modes are only exposed when the console is configured for widescreen.
- Parameters
-
| availableVideoModes | Detected Xbox video modes from XVideoListModes(). |
| encoderSettings | The value returned by XVideoGetEncoderSettings(). |
- Returns
- Modes suitable for the stream-resolution settings list.
◆ format_video_mode_lines()
| std::vector< std::string > startup::format_video_mode_lines |
( |
const VideoModeSelection & | selection | ) |
|
Return human-readable lines describing the detected and selected video modes.
- Parameters
-
| selection | Video-mode selection to describe. |
- Returns
- Formatted diagnostic lines for startup logging or UI display.
◆ is_preferred_video_mode()
| bool startup::is_preferred_video_mode |
( |
const VIDEO_MODE & | candidateVideoMode, |
|
|
const VIDEO_MODE & | currentBestVideoMode ) |
Return whether a candidate mode should replace the current best mode.
A candidate must be at least as good as the current best mode in width, height, color depth, and refresh rate, while preferring 720p over 1080i.
- Parameters
-
| candidateVideoMode | The mode being evaluated. |
| currentBestVideoMode | The currently selected best mode. |
- Returns
- true if the candidate should replace the current best mode.
◆ log_video_modes()
Log information about available and selected video modes.
- Parameters
-
| selection | The selection object to log. |
◆ select_best_video_mode()
| VideoModeSelection startup::select_best_video_mode |
( |
int | bpp = 32, |
|
|
int | refresh = REFRESH_DEFAULT ) |
Detect and choose the best available video mode.
- Parameters
-
| bpp | Desired bits-per-pixel color depth. Default is 32. |
| refresh | Desired refresh rate or REFRESH_DEFAULT to accept the default. |
- Returns
- A VideoModeSelection containing the detected modes and the selected best mode.
◆ stream_resolution_presets()
| std::vector< VIDEO_MODE > startup::stream_resolution_presets |
( |
int | bpp = 32, |
|
|
int | refresh = 60 ) |
Return canonical Xbox video modes usable as stream-resolution choices.
Runtime code should prefer modes detected by XVideoListModes(). These values are a fallback for code paths without live video-mode detection.
- Parameters
-
| bpp | Bits-per-pixel metadata to attach to each mode. |
| refresh | Refresh-rate metadata to attach to each mode. |
- Returns
- Ordered list of canonical stream-resolution modes.