This commit is contained in:
Siyuan Miao 2025-09-25 15:21:08 +00:00
parent 70db172287
commit 358512fa83
5 changed files with 5 additions and 51 deletions

View File

@ -23,7 +23,6 @@ var (
) )
const ( const (
touchscreenDevice string = "/dev/input/event1"
backlightControlClass string = "/sys/class/backlight/backlight/brightness" backlightControlClass string = "/sys/class/backlight/backlight/brightness"
) )

View File

@ -282,8 +282,6 @@ void jetkvm_ui_add_state(const char *obj_name, const char *state_name) {
} }
lv_state_t state_val = str_to_lv_state(state_name); lv_state_t state_val = str_to_lv_state(state_name);
lv_obj_add_state(obj, state_val); lv_obj_add_state(obj, state_val);
lv_obj_refresh_style(obj, LV_PART_ANY, LV_STYLE_PROP_ANY);
} }
void jetkvm_ui_clear_state(const char *obj_name, const char *state_name) { void jetkvm_ui_clear_state(const char *obj_name, const char *state_name) {
@ -293,9 +291,6 @@ void jetkvm_ui_clear_state(const char *obj_name, const char *state_name) {
} }
lv_state_t state_val = str_to_lv_state(state_name); lv_state_t state_val = str_to_lv_state(state_name);
lv_obj_clear_state(obj, state_val); lv_obj_clear_state(obj, state_val);
log_info("cleared state %s from object %s: %d", state_name, obj_name, state_val);
lv_obj_refresh_style(obj, LV_PART_ANY, LV_STYLE_PROP_ANY);
} }
int jetkvm_ui_add_flag(const char *obj_name, const char *flag_name) { int jetkvm_ui_add_flag(const char *obj_name, const char *flag_name) {

View File

@ -33,8 +33,6 @@ void lvgl_init(u_int16_t rotation) {
/*LittlevGL init*/ /*LittlevGL init*/
lv_init(); lv_init();
/*Linux frame buffer device init*/
/*Linux frame buffer device init*/ /*Linux frame buffer device init*/
lv_display_t *disp = lv_linux_fbdev_create(); lv_display_t *disp = lv_linux_fbdev_create();
// lv_display_set_physical_resolution(disp, 240, 300); // lv_display_set_physical_resolution(disp, 240, 300);
@ -43,29 +41,6 @@ void lvgl_init(u_int16_t rotation) {
lvgl_set_rotation(disp, rotation); lvgl_set_rotation(disp, rotation);
// lv_display_t *disp = lv_st7789_create(LCD_H_RES, LCD_V_RES, LV_LCD_FLAG_NONE, lcd_send_cmd, lcd_send_color);
// lv_display_set_resolution(disp, 240, 300);
// lv_display_set_rotation(disp, LV_DISP_ROTATION_270);
// lv_color_t * buf1 = NULL;
// lv_color_t * buf2 = NULL;
// uint32_t buf_size = LCD_H_RES * LCD_V_RES / 10 * lv_color_format_get_size(lv_display_get_color_format(disp));
// buf1 = lv_malloc(buf_size);
// if(buf1 == NULL) {
// log_error("display draw buffer malloc failed");
// return;
// }
// buf2 = lv_malloc(buf_size);
// if(buf2 == NULL) {
// log_error("display buffer malloc failed");
// lv_free(buf1);
// return;
// }
// lv_display_set_buffers(disp, buf1, buf2, buf_size, LV_DISPLAY_RENDER_MODE_PARTIAL);
/* Linux input device init */ /* Linux input device init */
lv_indev_t *mouse = lv_evdev_create(LV_INDEV_TYPE_POINTER, "/dev/input/event1"); lv_indev_t *mouse = lv_evdev_create(LV_INDEV_TYPE_POINTER, "/dev/input/event1");
lv_indev_set_group(mouse, lv_group_get_default()); lv_indev_set_group(mouse, lv_group_get_default());

Binary file not shown.

View File

@ -1,13 +1,8 @@
package kvm package kvm
import "github.com/jetkvm/kvm/internal/native" import (
"github.com/jetkvm/kvm/internal/native"
// max frame size for 1080p video, specified in mpp venc setting )
const maxFrameSize = 1920 * 1080 / 2
func writeCtrlAction(action string) error {
return nil
}
var lastVideoState native.VideoState var lastVideoState native.VideoState
@ -15,19 +10,9 @@ func triggerVideoStateUpdate() {
go func() { go func() {
writeJSONRPCEvent("videoInputState", lastVideoState, currentSession) writeJSONRPCEvent("videoInputState", lastVideoState, currentSession)
}() }()
}
// func HandleVideoStateMessage(event CtrlResponse) { nativeLogger.Info().Interface("state", lastVideoState).Msg("video state updated")
// videoState := VideoInputState{} }
// err := json.Unmarshal(event.Data, &videoState)
// if err != nil {
// logger.Warn().Err(err).Msg("Error parsing video state json")
// return
// }
// lastVideoState = videoState
// triggerVideoStateUpdate()
// requestDisplayUpdate(true)
// }
func rpcGetVideoState() (native.VideoState, error) { func rpcGetVideoState() (native.VideoState, error) {
return lastVideoState, nil return lastVideoState, nil