mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-02-06 00:39:54 +00:00
Combine the separate HDR and SDR capture formats
Since we support multi-encoding from a single display context, we have to ensure our capture format allows for HDR color even if the initial encoding session is SDR.
This commit is contained in:
parent
290c9b3e20
commit
f04d5e12de
@ -172,9 +172,7 @@ namespace platf::dxgi {
|
||||
virtual int
|
||||
complete_img(img_t *img, bool dummy) = 0;
|
||||
virtual std::vector<DXGI_FORMAT>
|
||||
get_supported_sdr_capture_formats() = 0;
|
||||
virtual std::vector<DXGI_FORMAT>
|
||||
get_supported_hdr_capture_formats() = 0;
|
||||
get_supported_capture_formats() = 0;
|
||||
};
|
||||
|
||||
class display_ram_t: public display_base_t {
|
||||
@ -189,9 +187,7 @@ namespace platf::dxgi {
|
||||
int
|
||||
complete_img(img_t *img, bool dummy) override;
|
||||
std::vector<DXGI_FORMAT>
|
||||
get_supported_sdr_capture_formats() override;
|
||||
std::vector<DXGI_FORMAT>
|
||||
get_supported_hdr_capture_formats() override;
|
||||
get_supported_capture_formats() override;
|
||||
|
||||
int
|
||||
init(const ::video::config_t &config, const std::string &display_name);
|
||||
@ -213,9 +209,7 @@ namespace platf::dxgi {
|
||||
int
|
||||
complete_img(img_t *img_base, bool dummy) override;
|
||||
std::vector<DXGI_FORMAT>
|
||||
get_supported_sdr_capture_formats() override;
|
||||
std::vector<DXGI_FORMAT>
|
||||
get_supported_hdr_capture_formats() override;
|
||||
get_supported_capture_formats() override;
|
||||
|
||||
int
|
||||
init(const ::video::config_t &config, const std::string &display_name);
|
||||
|
@ -517,7 +517,7 @@ namespace platf::dxgi {
|
||||
status = output->QueryInterface(IID_IDXGIOutput5, (void **) &output5);
|
||||
if (SUCCEEDED(status)) {
|
||||
// Ask the display implementation which formats it supports
|
||||
auto supported_formats = config.dynamicRange ? get_supported_hdr_capture_formats() : get_supported_sdr_capture_formats();
|
||||
auto supported_formats = get_supported_capture_formats();
|
||||
if (supported_formats.empty()) {
|
||||
BOOST_LOG(warning) << "No compatible capture formats for this encoder"sv;
|
||||
return -1;
|
||||
|
@ -358,16 +358,10 @@ namespace platf::dxgi {
|
||||
}
|
||||
|
||||
std::vector<DXGI_FORMAT>
|
||||
display_ram_t::get_supported_sdr_capture_formats() {
|
||||
display_ram_t::get_supported_capture_formats() {
|
||||
return { DXGI_FORMAT_B8G8R8A8_UNORM };
|
||||
}
|
||||
|
||||
std::vector<DXGI_FORMAT>
|
||||
display_ram_t::get_supported_hdr_capture_formats() {
|
||||
// HDR is unsupported
|
||||
return {};
|
||||
}
|
||||
|
||||
int
|
||||
display_ram_t::init(const ::video::config_t &config, const std::string &display_name) {
|
||||
if (display_base_t::init(config, display_name)) {
|
||||
|
@ -1159,12 +1159,7 @@ namespace platf::dxgi {
|
||||
}
|
||||
|
||||
std::vector<DXGI_FORMAT>
|
||||
display_vram_t::get_supported_sdr_capture_formats() {
|
||||
return { DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM };
|
||||
}
|
||||
|
||||
std::vector<DXGI_FORMAT>
|
||||
display_vram_t::get_supported_hdr_capture_formats() {
|
||||
display_vram_t::get_supported_capture_formats() {
|
||||
return {
|
||||
// scRGB FP16 is the desired format for HDR content. This will also handle
|
||||
// 10-bit SDR displays with the increased precision of FP16 vs 8-bit UNORMs.
|
||||
|
Loading…
x
Reference in New Issue
Block a user