mirror of https://github.com/jetkvm/kvm.git
feat: update github actions
This commit is contained in:
parent
8c225ce18f
commit
5051829c50
|
@ -16,6 +16,13 @@ jobs:
|
|||
steps:
|
||||
- name: Checkout
|
||||
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
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
|
|
|
@ -32,7 +32,10 @@ FetchContent_Declare(
|
|||
GIT_REPOSITORY https://github.com/lvgl/lvgl.git
|
||||
GIT_TAG v8.3.11
|
||||
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)
|
||||
|
||||
|
@ -41,6 +44,7 @@ FetchContent_Declare(
|
|||
lv_drivers
|
||||
GIT_REPOSITORY https://github.com/lvgl/lv_drivers.git
|
||||
GIT_TAG v8.3.0
|
||||
UPDATE_DISCONNECTED 1
|
||||
)
|
||||
FetchContent_MakeAvailable(lv_drivers)
|
||||
|
||||
|
|
|
@ -14,6 +14,6 @@ VERBOSE=1 cmake -B build \
|
|||
-DCMAKE_CROSSCOMPILING=1 \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE \
|
||||
-DSKIP_GLIBC_NAMES=ON \
|
||||
-DMAKE_BUILD_TYPE=Release
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
|
||||
cmake --build build
|
|
@ -30,7 +30,7 @@ void jetkvm_set_video_handler(jetkvm_video_handler_t *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.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) {
|
||||
(*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");
|
||||
}
|
||||
return 0;
|
||||
// if (video_client_fd <= 0)
|
||||
// {
|
||||
// return -1;
|
||||
// }
|
||||
// return send(video_client_fd, frame, len, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -51,4 +51,7 @@ int jetkvm_video_set_edid(const char *edid_hex);
|
|||
char *jetkvm_video_get_edid_hex();
|
||||
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
|
||||
|
|
|
@ -16,44 +16,12 @@
|
|||
void jetkvm_log(const char *message);
|
||||
|
||||
/* Log to screen */
|
||||
#define emit_log(level, file, func, line, ...) do { \
|
||||
/* call the log handler */ \
|
||||
char msg_buffer[1024]; \
|
||||
sprintf(msg_buffer, __VA_ARGS__); \
|
||||
log_message(level, file, func, line, msg_buffer); \
|
||||
#define emit_log(level, file, func, line, ...) do { \
|
||||
/* call the log handler */ \
|
||||
char msg_buffer[1024]; \
|
||||
sprintf(msg_buffer, __VA_ARGS__); \
|
||||
log_message(level, file, func, line, msg_buffer); \
|
||||
} 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 */
|
||||
#define LEVEL_PANIC 5
|
||||
|
@ -65,66 +33,66 @@ void jetkvm_log(const char *message);
|
|||
#define LEVEL_TRACE -1
|
||||
|
||||
/* TRACE LOG */
|
||||
#define log_trace(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_TRACE) { \
|
||||
emit_log( \
|
||||
LEVEL_TRACE, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
#define log_trace(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_TRACE) { \
|
||||
emit_log( \
|
||||
LEVEL_TRACE, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* DEBUG LOG */
|
||||
#define log_debug(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_DEBUG) { \
|
||||
emit_log( \
|
||||
LEVEL_DEBUG, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
#define log_debug(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_DEBUG) { \
|
||||
emit_log( \
|
||||
LEVEL_DEBUG, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* INFO LOG */
|
||||
#define log_info(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_INFO) { \
|
||||
emit_log( \
|
||||
LEVEL_INFO, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
#define log_info(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_INFO) { \
|
||||
emit_log( \
|
||||
LEVEL_INFO, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* NOTICE LOG */
|
||||
#define log_notice(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_NOTICE) { \
|
||||
emit_log( \
|
||||
LEVEL_NOTICE, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
#define log_notice(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_INFO) { \
|
||||
emit_log( \
|
||||
LEVEL_INFO, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* WARN LOG */
|
||||
#define log_warn(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_WARN) { \
|
||||
emit_log( \
|
||||
LEVEL_WARN, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
#define log_warn(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_WARN) { \
|
||||
emit_log( \
|
||||
LEVEL_WARN, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* ERROR LOG */
|
||||
#define log_error(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_ERROR) { \
|
||||
emit_log( \
|
||||
LEVEL_ERROR, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
#define log_error(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_ERROR) { \
|
||||
emit_log( \
|
||||
LEVEL_ERROR, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* PANIC LOG */
|
||||
#define log_panic(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_PANIC) { \
|
||||
emit_log( \
|
||||
LEVEL_PANIC, __FILENAME__, __func__, __LINE__, __VA_ARGS__\
|
||||
); \
|
||||
} \
|
||||
#define log_panic(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_PANIC) { \
|
||||
emit_log( \
|
||||
LEVEL_PANIC, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif //VIDEO_DAEMON_LOG_H
|
||||
|
|
|
@ -477,31 +477,31 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/
|
|||
# define LV_USE_CALENDAR_HEADER_DROPDOWN 1
|
||||
#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_KEYBOARD 1
|
||||
|
||||
#define LV_USE_LED 1
|
||||
#define LV_USE_LED 0
|
||||
|
||||
#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
|
||||
#if LV_USE_SPAN
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <time.h>
|
||||
#include <rk_type.h>
|
||||
#include <rk_mpi_venc.h>
|
||||
#include <rk_mpi_sys.h>
|
||||
#include <string.h>
|
||||
#include <rk_debug.h>
|
||||
#include <malloc.h>
|
||||
|
@ -276,7 +277,7 @@ static void *venc_read_stream(void *arg)
|
|||
// loopCount, stFrame.u32Seq, stFrame.pstPack->u32Len,
|
||||
// stFrame.pstPack->u64PTS, nowUs - stFrame.pstPack->u64PTS);
|
||||
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);
|
||||
if (s32Ret != RK_SUCCESS)
|
||||
{
|
||||
|
@ -645,19 +646,19 @@ void *run_detect_format(void *arg)
|
|||
{
|
||||
// No timings could be detected because no signal was found.
|
||||
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)
|
||||
{
|
||||
// The signal was unstable and the hardware could not lock on to it.
|
||||
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)
|
||||
{
|
||||
// Timings were found, but they are out of range of the hardware capabilities.
|
||||
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
|
||||
{
|
||||
|
@ -679,7 +680,7 @@ void *run_detect_format(void *arg)
|
|||
detected_width = dv_timings.bt.width;
|
||||
detected_height = dv_timings.bt.height;
|
||||
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)
|
||||
{
|
||||
log_info("restarting on going video streaming");
|
||||
|
|
Loading…
Reference in New Issue