mirror of https://github.com/jetkvm/kvm.git
show video debugging info
This commit is contained in:
parent
462613e129
commit
2a22f234f8
|
|
@ -393,6 +393,10 @@ jetkvm_video_state_t *jetkvm_video_get_status() {
|
||||||
return &state;
|
return &state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *jetkvm_video_log_status() {
|
||||||
|
return videoc_log_status();
|
||||||
|
}
|
||||||
|
|
||||||
int jetkvm_video_init() {
|
int jetkvm_video_init() {
|
||||||
return video_init();
|
return video_init();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ int jetkvm_video_set_quality_factor(float quality_factor);
|
||||||
float jetkvm_video_get_quality_factor();
|
float jetkvm_video_get_quality_factor();
|
||||||
int jetkvm_video_set_edid(const char *edid_hex);
|
int jetkvm_video_set_edid(const char *edid_hex);
|
||||||
char *jetkvm_video_get_edid_hex();
|
char *jetkvm_video_get_edid_hex();
|
||||||
|
char *jetkvm_video_log_status();
|
||||||
jetkvm_video_state_t *jetkvm_video_get_status();
|
jetkvm_video_state_t *jetkvm_video_get_status();
|
||||||
|
|
||||||
void video_report_format(bool ready, const char *error, u_int16_t width, u_int16_t height, double frame_per_second);
|
void video_report_format(bool ready, const char *error, u_int16_t width, u_int16_t height, double frame_per_second);
|
||||||
|
|
|
||||||
|
|
@ -162,6 +162,16 @@ func videoStop() {
|
||||||
C.jetkvm_video_stop()
|
C.jetkvm_video_stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func videoLogStatus() string {
|
||||||
|
cgoLock.Lock()
|
||||||
|
defer cgoLock.Unlock()
|
||||||
|
|
||||||
|
logStatus := C.jetkvm_video_log_status()
|
||||||
|
defer C.free(unsafe.Pointer(logStatus))
|
||||||
|
|
||||||
|
return C.GoString(logStatus)
|
||||||
|
}
|
||||||
|
|
||||||
func uiSetVar(name string, value string) {
|
func uiSetVar(name string, value string) {
|
||||||
cgoLock.Lock()
|
cgoLock.Lock()
|
||||||
defer cgoLock.Unlock()
|
defer cgoLock.Unlock()
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,11 @@ func videoSetStreamQualityFactor(factor float64) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func videoLogStatus() string {
|
||||||
|
panicPlatformNotSupported()
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
func videoGetEDID() (string, error) {
|
func videoGetEDID() (string, error) {
|
||||||
panicPlatformNotSupported()
|
panicPlatformNotSupported()
|
||||||
return "", nil
|
return "", nil
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -36,6 +36,13 @@ func (n *Native) VideoGetEDID() (string, error) {
|
||||||
return videoGetEDID()
|
return videoGetEDID()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (n *Native) VideoLogStatus() (string, error) {
|
||||||
|
n.videoLock.Lock()
|
||||||
|
defer n.videoLock.Unlock()
|
||||||
|
|
||||||
|
return videoLogStatus(), nil
|
||||||
|
}
|
||||||
|
|
||||||
func (n *Native) VideoStop() error {
|
func (n *Native) VideoStop() error {
|
||||||
n.videoLock.Lock()
|
n.videoLock.Lock()
|
||||||
defer n.videoLock.Unlock()
|
defer n.videoLock.Unlock()
|
||||||
|
|
|
||||||
|
|
@ -251,6 +251,10 @@ func rpcSetEDID(edid string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func rpcGetVideoLogStatus() (string, error) {
|
||||||
|
return nativeInstance.VideoLogStatus()
|
||||||
|
}
|
||||||
|
|
||||||
func rpcGetDevChannelState() (bool, error) {
|
func rpcGetDevChannelState() (bool, error) {
|
||||||
return config.IncludePreRelease, nil
|
return config.IncludePreRelease, nil
|
||||||
}
|
}
|
||||||
|
|
@ -1207,6 +1211,7 @@ var rpcHandlers = map[string]RPCHandler{
|
||||||
"setAutoUpdateState": {Func: rpcSetAutoUpdateState, Params: []string{"enabled"}},
|
"setAutoUpdateState": {Func: rpcSetAutoUpdateState, Params: []string{"enabled"}},
|
||||||
"getEDID": {Func: rpcGetEDID},
|
"getEDID": {Func: rpcGetEDID},
|
||||||
"setEDID": {Func: rpcSetEDID, Params: []string{"edid"}},
|
"setEDID": {Func: rpcSetEDID, Params: []string{"edid"}},
|
||||||
|
"getVideoLogStatus": {Func: rpcGetVideoLogStatus},
|
||||||
"getDevChannelState": {Func: rpcGetDevChannelState},
|
"getDevChannelState": {Func: rpcGetDevChannelState},
|
||||||
"setDevChannelState": {Func: rpcSetDevChannelState, Params: []string{"enabled"}},
|
"setDevChannelState": {Func: rpcSetDevChannelState, Params: []string{"enabled"}},
|
||||||
"getLocalVersion": {Func: rpcGetLocalVersion},
|
"getLocalVersion": {Func: rpcGetLocalVersion},
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { useEffect, useState } from "react";
|
import { useCallback, useEffect, useState } from "react";
|
||||||
|
|
||||||
import { Button } from "@/components/Button";
|
import { Button } from "@/components/Button";
|
||||||
import { TextAreaWithLabel } from "@/components/TextArea";
|
import { TextAreaWithLabel } from "@/components/TextArea";
|
||||||
|
|
@ -52,7 +52,7 @@ export default function SettingsVideoRoute() {
|
||||||
const [customEdidValue, setCustomEdidValue] = useState<string | null>(null);
|
const [customEdidValue, setCustomEdidValue] = useState<string | null>(null);
|
||||||
const [edid, setEdid] = useState<string | null>(null);
|
const [edid, setEdid] = useState<string | null>(null);
|
||||||
const [edidLoading, setEdidLoading] = useState(false);
|
const [edidLoading, setEdidLoading] = useState(false);
|
||||||
|
const { debugMode } = useSettingsStore();
|
||||||
// Video enhancement settings from store
|
// Video enhancement settings from store
|
||||||
const {
|
const {
|
||||||
videoSaturation,
|
videoSaturation,
|
||||||
|
|
@ -132,6 +132,26 @@ export default function SettingsVideoRoute() {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const [debugInfo, setDebugInfo] = useState<string | null>(null);
|
||||||
|
const [debugInfoLoading, setDebugInfoLoading] = useState(false);
|
||||||
|
const getDebugInfo = useCallback(() => {
|
||||||
|
setDebugInfoLoading(true);
|
||||||
|
send("getVideoLogStatus", {}, (resp: JsonRpcResponse) => {
|
||||||
|
if ("error" in resp) {
|
||||||
|
notifications.error(`Failed to get debug info: ${resp.error.data || "Unknown error"}`);
|
||||||
|
setDebugInfoLoading(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const data = resp.result as string;
|
||||||
|
setDebugInfo(data
|
||||||
|
.split("\n")
|
||||||
|
.map(line => line.trim().replace(/^\[\s*\d+\.\d+\]\s*/, ""))
|
||||||
|
.join("\n")
|
||||||
|
);
|
||||||
|
setDebugInfoLoading(false);
|
||||||
|
});
|
||||||
|
}, [send]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
|
|
@ -279,6 +299,30 @@ export default function SettingsVideoRoute() {
|
||||||
)}
|
)}
|
||||||
</Fieldset>
|
</Fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{debugMode && (
|
||||||
|
<div className="space-y-4">
|
||||||
|
<SettingsItem
|
||||||
|
title="Debugging Info"
|
||||||
|
description="Debugging information for video"
|
||||||
|
>
|
||||||
|
<Button size="SM" theme="primary" text="Get Debugging Info"
|
||||||
|
loading={debugInfoLoading}
|
||||||
|
disabled={debugInfoLoading}
|
||||||
|
onClick={() => {
|
||||||
|
getDebugInfo();
|
||||||
|
}} />
|
||||||
|
</SettingsItem>
|
||||||
|
{debugInfo && (
|
||||||
|
<div className="font-mono bg-gray-100 dark:bg-gray-800 p-2 rounded-md text-xs max-h-64 overflow-y-auto">
|
||||||
|
<pre className="whitespace-pre-wrap">
|
||||||
|
{debugInfo}
|
||||||
|
</pre>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue