Report driver status to WebUI
This commit is contained in:
+1
-1
@@ -547,7 +547,7 @@ namespace confighttp {
|
|||||||
outputTree.put("platform", SUNSHINE_PLATFORM);
|
outputTree.put("platform", SUNSHINE_PLATFORM);
|
||||||
outputTree.put("version", PROJECT_VER);
|
outputTree.put("version", PROJECT_VER);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
outputTree.put("vdisplaySupported", proc::vdisplayDriverInitialized ? "true" : "false");
|
outputTree.put("vdisplayStatus", proc::vdisplayDriverInitialized ? "true" : "false");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
auto vars = config::parse_config(file_handler::read_file(config::sunshine.config_file.c_str()));
|
auto vars = config::parse_config(file_handler::read_file(config::sunshine.config_file.c_str()));
|
||||||
|
|||||||
@@ -84,22 +84,6 @@ bool setPrimaryDisplay(const wchar_t* primaryDeviceName) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool openVDisplayDevice() {
|
|
||||||
SUDOVDA_DRIVER_HANDLE = OpenDevice(&SUVDA_INTERFACE_GUID);
|
|
||||||
if (SUDOVDA_DRIVER_HANDLE == INVALID_HANDLE_VALUE) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!CheckProtocolCompatible(SUDOVDA_DRIVER_HANDLE)) {
|
|
||||||
printf("[SUDOVDA] SUDOVDA protocol not compatible with driver!\n");
|
|
||||||
CloseHandle(SUDOVDA_DRIVER_HANDLE);
|
|
||||||
SUDOVDA_DRIVER_HANDLE = INVALID_HANDLE_VALUE;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool startPingThread() {
|
bool startPingThread() {
|
||||||
if (SUDOVDA_DRIVER_HANDLE == INVALID_HANDLE_VALUE) {
|
if (SUDOVDA_DRIVER_HANDLE == INVALID_HANDLE_VALUE) {
|
||||||
return false;
|
return false;
|
||||||
@@ -129,6 +113,22 @@ bool startPingThread() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool openVDisplayDevice() {
|
||||||
|
SUDOVDA_DRIVER_HANDLE = OpenDevice(&SUVDA_INTERFACE_GUID);
|
||||||
|
if (SUDOVDA_DRIVER_HANDLE == INVALID_HANDLE_VALUE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!CheckProtocolCompatible(SUDOVDA_DRIVER_HANDLE)) {
|
||||||
|
printf("[SUDOVDA] SUDOVDA protocol not compatible with driver!\n");
|
||||||
|
CloseHandle(SUDOVDA_DRIVER_HANDLE);
|
||||||
|
SUDOVDA_DRIVER_HANDLE = INVALID_HANDLE_VALUE;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return startPingThread();
|
||||||
|
}
|
||||||
|
|
||||||
std::wstring createVirtualDisplay(
|
std::wstring createVirtualDisplay(
|
||||||
const char* s_client_uid,
|
const char* s_client_uid,
|
||||||
const char* s_client_name,
|
const char* s_client_name,
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ namespace VDISPLAY {
|
|||||||
LONG changeDisplaySettings(const wchar_t* deviceName, int width, int height, int refresh_rate);
|
LONG changeDisplaySettings(const wchar_t* deviceName, int width, int height, int refresh_rate);
|
||||||
bool setPrimaryDisplay(const wchar_t* primaryDeviceName);
|
bool setPrimaryDisplay(const wchar_t* primaryDeviceName);
|
||||||
|
|
||||||
bool openVDisplayDevice();
|
|
||||||
bool startPingThread();
|
bool startPingThread();
|
||||||
|
bool openVDisplayDevice();
|
||||||
std::wstring createVirtualDisplay(
|
std::wstring createVirtualDisplay(
|
||||||
const char* s_client_uid,
|
const char* s_client_uid,
|
||||||
const char* s_client_name,
|
const char* s_client_name,
|
||||||
|
|||||||
@@ -53,6 +53,7 @@
|
|||||||
v-if="currentTab === 'av'"
|
v-if="currentTab === 'av'"
|
||||||
:config="config"
|
:config="config"
|
||||||
:platform="platform"
|
:platform="platform"
|
||||||
|
:vdisplay="vdisplayStatus"
|
||||||
>
|
>
|
||||||
</audio-video>
|
</audio-video>
|
||||||
|
|
||||||
@@ -131,6 +132,7 @@
|
|||||||
restarted: false,
|
restarted: false,
|
||||||
config: null,
|
config: null,
|
||||||
currentTab: "general",
|
currentTab: "general",
|
||||||
|
vdisplayStatus: false,
|
||||||
global_prep_cmd: [],
|
global_prep_cmd: [],
|
||||||
tabs: [ // TODO: Move the options to each Component instead, encapsulate.
|
tabs: [ // TODO: Move the options to each Component instead, encapsulate.
|
||||||
{
|
{
|
||||||
@@ -309,6 +311,9 @@
|
|||||||
delete this.config.status;
|
delete this.config.status;
|
||||||
delete this.config.version;
|
delete this.config.version;
|
||||||
|
|
||||||
|
this.vdisplayStatus = this.config.vdisplayStatus === 'true';
|
||||||
|
delete this.config.vdisplayStatus;
|
||||||
|
|
||||||
// TODO: let each tab's Component handle it's own data instead of doing it here
|
// TODO: let each tab's Component handle it's own data instead of doing it here
|
||||||
|
|
||||||
// Populate default values from tabs options
|
// Populate default values from tabs options
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import DisplayModesSettings from "./audiovideo/DisplayModesSettings.vue";
|
|||||||
const props = defineProps([
|
const props = defineProps([
|
||||||
'platform',
|
'platform',
|
||||||
'config',
|
'config',
|
||||||
|
'vdisplay',
|
||||||
'min_fps_factor',
|
'min_fps_factor',
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -95,6 +96,7 @@ const config = ref(props.config)
|
|||||||
<DisplayModesSettings
|
<DisplayModesSettings
|
||||||
:platform="platform"
|
:platform="platform"
|
||||||
:config="config"
|
:config="config"
|
||||||
|
:vdisplay="vdisplay"
|
||||||
:min_fps_factor="min_fps_factor"
|
:min_fps_factor="min_fps_factor"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import PlatformLayout from '../../../PlatformLayout.vue'
|
|||||||
const props = defineProps([
|
const props = defineProps([
|
||||||
'platform',
|
'platform',
|
||||||
'config',
|
'config',
|
||||||
|
'vdisplay',
|
||||||
'min_fps_factor',
|
'min_fps_factor',
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -24,6 +25,9 @@ const fpsIn = ref("")
|
|||||||
<div class="form-text">{{ $t('config.min_fps_factor_desc') }}</div>
|
<div class="form-text">{{ $t('config.min_fps_factor_desc') }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="alert" :class="[vdisplay ? 'alert-success' : 'alert-warning']">
|
||||||
|
<label><i class="fa-solid fa-xl fa-circle-info"></i> SudoVDA Driver status: {{vdisplay && "Ready" || "Not Ready"}}</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user