| 139 | } |
| 140 | |
| 141 | void CVideoProcessor::SetDisplayInfo(const DisplayConfig_t& dc, const bool primary, const bool exclusiveScreen) |
| 142 | { |
| 143 | if (dc.refreshRate.Numerator) { |
| 144 | m_uHalfRefreshPeriodMs = (UINT32)(500ull * dc.refreshRate.Denominator / dc.refreshRate.Numerator); |
| 145 | } else { |
| 146 | m_uHalfRefreshPeriodMs = 0; |
| 147 | } |
| 148 | |
| 149 | m_strStatsDispInfo.assign(L"\nDisplay: "); |
| 150 | |
| 151 | std::wstring str = DisplayConfigToString(dc); |
| 152 | if (str.size()) { |
| 153 | m_strStatsDispInfo.append(str); |
| 154 | str.clear(); |
| 155 | |
| 156 | if (dc.bitsPerChannel) { // if bitsPerChannel is not set then colorEncoding and other values are invalid |
| 157 | const wchar_t* colenc = ColorEncodingToString(dc.colorEncoding); |
| 158 | if (colenc) { |
| 159 | str = std::format(L"\n Color: {} {}-bit", colenc, dc.bitsPerChannel); |
| 160 | if (dc.HDRSupported()) { |
| 161 | str.append(std::format(L" HDR10: {}", dc.HDREnabled() ? L"On" : L"Off")); |
| 162 | if (!dc.HDREnabled() && dc.ACMEnabled()) { |
| 163 | str.append(L" ACM: On"); |
| 164 | } |
| 165 | |
| 166 | if (dc.HDREnabled() && m_MaxDisplayLuminance >= 100) { |
| 167 | str.append(std::format(L", Max Luminance: {} nits", m_MaxDisplayLuminance)); |
| 168 | } |
| 169 | } |
| 170 | } |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | if (primary) { |
| 175 | m_strStatsDispInfo.append(L" Primary"); |
| 176 | } |
| 177 | m_strStatsDispInfo.append(exclusiveScreen ? L" exclusive" : L" windowed"); |
| 178 | |
| 179 | if (str.size()) { |
| 180 | m_strStatsDispInfo.append(str); |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | void CVideoProcessor::UpdateStatsInputFmt() |
| 185 | { |
no test coverage detected