feat: update github actions

This commit is contained in:
Siyuan Miao 2025-06-22 15:39:48 +00:00
parent 8c225ce18f
commit 5051829c50
8 changed files with 81 additions and 103 deletions

View File

@ -16,6 +16,13 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Cmake cache
uses: buildjet/cache@v4
with:
path: internal/native/cgo/build
key: jetkvm-cgo-${{ hashFiles('internal/native/cgo/**/*.c', 'internal/native/cgo/**/*.h', 'internal/native/cgo/**/*.patch', 'internal/native/cgo/**/*.txt', 'internal/native/cgo/**/*.sh', '!internal/native/cgo/build/**') }}
restore-keys: |
jetkvm-cgo-${{ hashFiles('internal/native/cgo/**/*.c', 'internal/native/cgo/**/*.h', 'internal/native/cgo/**/*.patch', 'internal/native/cgo/**/*.txt', 'internal/native/cgo/**/*.sh', '!internal/native/cgo/build/**') }}
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:

View File

@ -32,7 +32,10 @@ FetchContent_Declare(
GIT_REPOSITORY https://github.com/lvgl/lvgl.git GIT_REPOSITORY https://github.com/lvgl/lvgl.git
GIT_TAG v8.3.11 GIT_TAG v8.3.11
GIT_SHALLOW 1 GIT_SHALLOW 1
PATCH_COMMAND git apply ${CMAKE_CURRENT_SOURCE_DIR}/lvgl-no-examples.patch UPDATE_DISCONNECTED 1
PATCH_COMMAND
git apply ${CMAKE_CURRENT_SOURCE_DIR}/lvgl-no-examples.patch
COMMAND rm -rf demos examples
) )
FetchContent_MakeAvailable(lvgl) FetchContent_MakeAvailable(lvgl)
@ -41,6 +44,7 @@ FetchContent_Declare(
lv_drivers lv_drivers
GIT_REPOSITORY https://github.com/lvgl/lv_drivers.git GIT_REPOSITORY https://github.com/lvgl/lv_drivers.git
GIT_TAG v8.3.0 GIT_TAG v8.3.0
UPDATE_DISCONNECTED 1
) )
FetchContent_MakeAvailable(lv_drivers) FetchContent_MakeAvailable(lv_drivers)

View File

@ -14,6 +14,6 @@ VERBOSE=1 cmake -B build \
-DCMAKE_CROSSCOMPILING=1 \ -DCMAKE_CROSSCOMPILING=1 \
-DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE \ -DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE \
-DSKIP_GLIBC_NAMES=ON \ -DSKIP_GLIBC_NAMES=ON \
-DMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_TYPE=Release
cmake --build build cmake --build build

View File

@ -30,7 +30,7 @@ void jetkvm_set_video_handler(jetkvm_video_handler_t *handler) {
video_handler = handler; video_handler = handler;
} }
void report_video_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)
{ {
state.ready = ready; state.ready = ready;
state.error = error; state.error = error;
@ -42,7 +42,7 @@ void report_video_format(bool ready, const char *error, u_int16_t width, u_int16
} }
} }
int socket_send_frame(const uint8_t *frame, ssize_t len) int video_send_frame(const uint8_t *frame, ssize_t len)
{ {
if (video_handler != NULL) { if (video_handler != NULL) {
(*video_handler)(frame, len); (*video_handler)(frame, len);
@ -50,11 +50,6 @@ int socket_send_frame(const uint8_t *frame, ssize_t len)
log_error("video handler is not set"); log_error("video handler is not set");
} }
return 0; return 0;
// if (video_client_fd <= 0)
// {
// return -1;
// }
// return send(video_client_fd, frame, len, 0);
} }
/** /**

View File

@ -51,4 +51,7 @@ int jetkvm_video_set_edid(const char *edid_hex);
char *jetkvm_video_get_edid_hex(); char *jetkvm_video_get_edid_hex();
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);
int video_send_frame(const uint8_t *frame, ssize_t len);
#endif //VIDEO_DAEMON_CTRL_H #endif //VIDEO_DAEMON_CTRL_H

View File

@ -22,38 +22,6 @@ void jetkvm_log(const char *message);
sprintf(msg_buffer, __VA_ARGS__); \ sprintf(msg_buffer, __VA_ARGS__); \
log_message(level, file, func, line, msg_buffer); \ log_message(level, file, func, line, msg_buffer); \
} while (0) } while (0)
// /* display the level */ \
// printf("%10s%s", level, " "); \
// \
// /* display the function doing the logging */ \
// printf("%s%s", func, " " : ""); \
// \
// /* display the file and/or the line number */ \
// printf( \
// "%s%s%s%.d%s%s", \
// DISPLAY_FUNC && (DISPLAY_FILE || DISPLAY_LINE) ? "(" : "", \
// DISPLAY_FILE ? file : "", \
// DISPLAY_FILE && DISPLAY_LINE ? ":" : "", \
// DISPLAY_LINE ? line : 0, \
// DISPLAY_FUNC && (DISPLAY_FILE || DISPLAY_LINE) ? ") " : "", \
// !DISPLAY_FUNC && (DISPLAY_FILE || DISPLAY_LINE) ? " " : "" \
// ); \
// \
// /* display message border */ \
// printf("%s%s", DISPLAY_BORDER ? BORDER : "", DISPLAY_BORDER ? " " : ""); \
// \
// /* display the callee's message */ \
// if (DISPLAY_MESSAGE) printf(__VA_ARGS__); \
// \
// /* add the message ending (usually '\n') */ \
// printf("%s", DISPLAY_ENDING ? MSG_ENDING : ""); \
// \
// /* reset the colour */ \
// printf("%s", DISPLAY_RESET ? RESET_COLOUR : ""); \
// \
// /* add a newline */ \
// printf("\n"); \
// fflush(stdout); \
/* Level enum */ /* Level enum */
#define LEVEL_PANIC 5 #define LEVEL_PANIC 5
@ -93,9 +61,9 @@ void jetkvm_log(const char *message);
/* NOTICE LOG */ /* NOTICE LOG */
#define log_notice(...) do { \ #define log_notice(...) do { \
if (LOG_LEVEL <= LEVEL_NOTICE) { \ if (LOG_LEVEL <= LEVEL_INFO) { \
emit_log( \ emit_log( \
LEVEL_NOTICE, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \ LEVEL_INFO, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
); \ ); \
} \ } \
} while (0) } while (0)

View File

@ -477,31 +477,31 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/
# define LV_USE_CALENDAR_HEADER_DROPDOWN 1 # define LV_USE_CALENDAR_HEADER_DROPDOWN 1
#endif /*LV_USE_CALENDAR*/ #endif /*LV_USE_CALENDAR*/
#define LV_USE_CHART 1 #define LV_USE_CHART 0
#define LV_USE_COLORWHEEL 1 #define LV_USE_COLORWHEEL 0
#define LV_USE_IMGBTN 1 #define LV_USE_IMGBTN 1
#define LV_USE_KEYBOARD 1 #define LV_USE_KEYBOARD 1
#define LV_USE_LED 1 #define LV_USE_LED 0
#define LV_USE_LIST 1 #define LV_USE_LIST 1
#define LV_USE_METER 1 #define LV_USE_METER 0
#define LV_USE_MSGBOX 1 #define LV_USE_MSGBOX 0
#define LV_USE_SPINBOX 1 #define LV_USE_SPINBOX 0
#define LV_USE_SPINNER 1 #define LV_USE_SPINNER 0
#define LV_USE_TABVIEW 1 #define LV_USE_TABVIEW 0
#define LV_USE_TILEVIEW 1 #define LV_USE_TILEVIEW 0
#define LV_USE_WIN 1 #define LV_USE_WIN 0
#define LV_USE_SPAN 1 #define LV_USE_SPAN 1
#if LV_USE_SPAN #if LV_USE_SPAN

View File

@ -3,6 +3,7 @@
#include <time.h> #include <time.h>
#include <rk_type.h> #include <rk_type.h>
#include <rk_mpi_venc.h> #include <rk_mpi_venc.h>
#include <rk_mpi_sys.h>
#include <string.h> #include <string.h>
#include <rk_debug.h> #include <rk_debug.h>
#include <malloc.h> #include <malloc.h>
@ -276,7 +277,7 @@ static void *venc_read_stream(void *arg)
// loopCount, stFrame.u32Seq, stFrame.pstPack->u32Len, // loopCount, stFrame.u32Seq, stFrame.pstPack->u32Len,
// stFrame.pstPack->u64PTS, nowUs - stFrame.pstPack->u64PTS); // stFrame.pstPack->u64PTS, nowUs - stFrame.pstPack->u64PTS);
pData = RK_MPI_MB_Handle2VirAddr(stFrame.pstPack->pMbBlk); pData = RK_MPI_MB_Handle2VirAddr(stFrame.pstPack->pMbBlk);
socket_send_frame(pData, (ssize_t)stFrame.pstPack->u32Len); video_send_frame(pData, (ssize_t)stFrame.pstPack->u32Len);
s32Ret = RK_MPI_VENC_ReleaseStream(VENC_CHANNEL, &stFrame); s32Ret = RK_MPI_VENC_ReleaseStream(VENC_CHANNEL, &stFrame);
if (s32Ret != RK_SUCCESS) if (s32Ret != RK_SUCCESS)
{ {
@ -645,19 +646,19 @@ void *run_detect_format(void *arg)
{ {
// No timings could be detected because no signal was found. // No timings could be detected because no signal was found.
log_info("HDMI status: no signal"); log_info("HDMI status: no signal");
report_video_format(false, "no_signal", 0, 0, 0); video_report_format(false, "no_signal", 0, 0, 0);
} }
else if (errno == ENOLCK) else if (errno == ENOLCK)
{ {
// The signal was unstable and the hardware could not lock on to it. // The signal was unstable and the hardware could not lock on to it.
log_info("HDMI status: no lock"); log_info("HDMI status: no lock");
report_video_format(false, "no_lock", 0, 0, 0); video_report_format(false, "no_lock", 0, 0, 0);
} }
else if (errno == ERANGE) else if (errno == ERANGE)
{ {
// Timings were found, but they are out of range of the hardware capabilities. // Timings were found, but they are out of range of the hardware capabilities.
printf("HDMI status: out of range\n"); printf("HDMI status: out of range\n");
report_video_format(false, "out_of_range", 0, 0, 0); video_report_format(false, "out_of_range", 0, 0, 0);
} }
else else
{ {
@ -679,7 +680,7 @@ void *run_detect_format(void *arg)
detected_width = dv_timings.bt.width; detected_width = dv_timings.bt.width;
detected_height = dv_timings.bt.height; detected_height = dv_timings.bt.height;
detected_signal = true; detected_signal = true;
report_video_format(true, NULL, detected_width, detected_height, frames_per_second); video_report_format(true, NULL, detected_width, detected_height, frames_per_second);
if (streaming_flag == true) if (streaming_flag == true)
{ {
log_info("restarting on going video streaming"); log_info("restarting on going video streaming");