Finalize scale factor implementation
This commit is contained in:
+1
-1
@@ -341,7 +341,7 @@ namespace nvhttp {
|
|||||||
launch_session->gcmap = util::from_view(get_arg(args, "gcmap", "0"));
|
launch_session->gcmap = util::from_view(get_arg(args, "gcmap", "0"));
|
||||||
launch_session->enable_hdr = util::from_view(get_arg(args, "hdrMode", "0"));
|
launch_session->enable_hdr = util::from_view(get_arg(args, "hdrMode", "0"));
|
||||||
launch_session->virtual_display = util::from_view(get_arg(args, "virtualDisplay", "0"));
|
launch_session->virtual_display = util::from_view(get_arg(args, "virtualDisplay", "0"));
|
||||||
launch_session->scale_factor = util::from_view(get_arg(args, "scale_factor", "100"));
|
launch_session->scale_factor = util::from_view(get_arg(args, "scaleFactor", "100"));
|
||||||
|
|
||||||
// Encrypted RTSP is enabled with client reported corever >= 1
|
// Encrypted RTSP is enabled with client reported corever >= 1
|
||||||
auto corever = util::from_view(get_arg(args, "corever", "0"));
|
auto corever = util::from_view(get_arg(args, "corever", "0"));
|
||||||
|
|||||||
+6
-3
@@ -178,10 +178,13 @@ namespace proc {
|
|||||||
uint32_t render_height = client_height;
|
uint32_t render_height = client_height;
|
||||||
|
|
||||||
if (launch_session->scale_factor != 100) {
|
if (launch_session->scale_factor != 100) {
|
||||||
|
render_width *= ((float)launch_session->scale_factor / 100);
|
||||||
|
render_height *= ((float)launch_session->scale_factor / 100);
|
||||||
|
|
||||||
// Chop the last bit to ensure the scaled resolution is even numbered
|
// Chop the last bit to ensure the scaled resolution is even numbered
|
||||||
// Most odd resolution won't work well
|
// Most odd resolution won't work well
|
||||||
render_width *= 100 / launch_session->scale_factor & ~1;
|
render_width &= ~1;
|
||||||
render_height *= 100 / launch_session->scale_factor & ~1;
|
render_height &= ~1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add Stream-specific environment variables
|
// Add Stream-specific environment variables
|
||||||
@@ -261,7 +264,7 @@ namespace proc {
|
|||||||
std::wstring currentPrimaryDisplayName = VDISPLAY::getPrimaryDisplay();
|
std::wstring currentPrimaryDisplayName = VDISPLAY::getPrimaryDisplay();
|
||||||
|
|
||||||
// Apply display settings
|
// Apply display settings
|
||||||
VDISPLAY::changeDisplaySettings(vdisplayName.c_str(), launch_session->width, launch_session->height, launch_session->fps);
|
VDISPLAY::changeDisplaySettings(vdisplayName.c_str(), render_width, render_height, launch_session->fps);
|
||||||
|
|
||||||
// Determine if we need to set the virtual display as primary
|
// Determine if we need to set the virtual display as primary
|
||||||
bool shouldSetPrimary = false;
|
bool shouldSetPrimary = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user