Get device name from local value for vdisplay

This commit is contained in:
Yukino Song
2024-09-15 14:24:55 +08:00
parent 038464ad45
commit 306b252205
4 changed files with 5 additions and 15 deletions

View File

@@ -336,7 +336,7 @@ namespace nvhttp {
}
std::shared_ptr<rtsp_stream::launch_session_t>
make_launch_session(bool host_audio, const args_t &args, const std::string& uuid) {
make_launch_session(bool host_audio, const args_t &args, const std::string& device_name, const std::string& uuid) {
auto launch_session = std::make_shared<rtsp_stream::launch_session_t>();
launch_session->id = ++session_id_counter;
@@ -355,7 +355,8 @@ namespace nvhttp {
if (x == 2) launch_session->fps = atoi(segment.c_str());
x++;
}
launch_session->device_name = (get_arg(args, "devicename", "unknown"));
launch_session->device_name = device_name.empty() ? "ApolloDisplay"s : device_name;
launch_session->unique_id = uuid;
launch_session->appid = util::from_view(get_arg(args, "appid", "unknown"));
launch_session->enable_sops = util::from_view(get_arg(args, "sops", "0"));
@@ -960,7 +961,7 @@ namespace nvhttp {
}
host_audio = util::from_view(get_arg(args, "localAudioPlayMode"));
auto launch_session = make_launch_session(host_audio, args, named_cert_p->uuid);
auto launch_session = make_launch_session(host_audio, args, named_cert_p->name, named_cert_p->uuid);
auto encryption_mode = net::encryption_mode_for_address(request->remote_endpoint().address());
if (!launch_session->rtsp_cipher && encryption_mode == config::ENCRYPTION_MODE_MANDATORY) {
@@ -1079,7 +1080,7 @@ namespace nvhttp {
}
}
auto launch_session = make_launch_session(host_audio, args, named_cert_p->uuid);
auto launch_session = make_launch_session(host_audio, args, named_cert_p->name, named_cert_p->uuid);
auto encryption_mode = net::encryption_mode_for_address(request->remote_endpoint().address());
if (!launch_session->rtsp_cipher && encryption_mode == config::ENCRYPTION_MODE_MANDATORY) {

View File

@@ -290,7 +290,6 @@ bool setRenderAdapterByName(const std::wstring& adapterName) {
std::wstring createVirtualDisplay(
const char* s_client_uid,
const char* s_client_name,
const char* s_app_name,
uint32_t width,
uint32_t height,
uint32_t fps,
@@ -300,14 +299,6 @@ std::wstring createVirtualDisplay(
return std::wstring();
}
if (!s_app_name || !strlen(s_app_name) || !strcmp(s_app_name, "unknown")) {
s_app_name = "ApolloVDisp";
}
if (!s_client_name || !strlen(s_client_name) || !strcmp(s_client_name, "unknown")) {
s_client_name = s_app_name;
}
VIRTUAL_DISPLAY_ADD_OUT output;
if (!AddVirtualDisplay(SUDOVDA_DRIVER_HANDLE, width, height, fps, guid, s_client_name, s_client_uid, output)) {
printf("[SUDOVDA] Failed to add virtual display.\n");

View File

@@ -35,7 +35,6 @@ namespace VDISPLAY {
std::wstring createVirtualDisplay(
const char* s_client_uid,
const char* s_client_name,
const char* s_app_name,
uint32_t width,
uint32_t height,
uint32_t fps,

View File

@@ -213,7 +213,6 @@ namespace proc {
std::wstring vdisplayName = VDISPLAY::createVirtualDisplay(
launch_session->unique_id.c_str(),
launch_session->device_name.c_str(),
_app.name.c_str(),
render_width,
render_height,
launch_session->fps,