Files
video-shader-toys/src/video/core/VideoMode.h
Aiden e006fcc6ee
Some checks failed
CI / React UI Build (push) Successful in 11s
CI / Native Windows Build And Tests (push) Failing after 2m30s
CI / Windows Release Package (push) Has been skipped
config cleanup
2026-05-22 16:05:40 +10:00

49 lines
1.3 KiB
C++

#pragma once
#include <string>
struct FrameSize
{
unsigned width = 0;
unsigned height = 0;
bool IsEmpty() const { return width == 0 || height == 0; }
};
inline bool operator==(const FrameSize& left, const FrameSize& right)
{
return left.width == right.width && left.height == right.height;
}
inline bool operator!=(const FrameSize& left, const FrameSize& right)
{
return !(left == right);
}
struct VideoFormat
{
std::string formatName = "1080p";
std::string frameRate = "59.94";
std::string displayName = "1080p59.94";
FrameSize frameSize = { 1920, 1080 };
double frameDurationMilliseconds = 1000.0 / 59.94;
};
struct VideoFormatSelection
{
VideoFormat input;
VideoFormat output;
};
std::string NormalizeModeToken(const std::string& value);
double FrameDurationMillisecondsFromRateString(const std::string& rateText, double fallbackRate = 59.94);
void VideoFormatDimensions(const std::string& formatName, unsigned& width, unsigned& height);
bool ResolveConfiguredVideoFormat(const std::string& videoFormat, const std::string& frameRate, VideoFormat& videoMode);
bool ResolveConfiguredVideoFormats(
const std::string& inputResolution,
const std::string& inputFrameRate,
const std::string& outputResolution,
const std::string& outputFrameRate,
VideoFormatSelection& videoModes,
std::string& error);