Skip to content

Commit

Permalink
(Continued)
Browse files Browse the repository at this point in the history
  • Loading branch information
wberube committed May 21, 2024
1 parent 336707d commit c2ed845
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 25 deletions.
4 changes: 0 additions & 4 deletions src/hal/sstar/i6_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ int i6_audio_init(void);

int i6_channel_bind(char index, char framerate, char jpeg);
int i6_channel_create(char index, short width, short height, char mirror, char flip, char jpeg);
void i6_channel_disable(char index);
int i6_channel_enabled(char index);
int i6_channel_grayscale(char enable);
int i6_channel_in_mainloop(char index);
int i6_channel_next(char mainLoop);
int i6_channel_unbind(char index);

int i6_config_load(char *path);
Expand Down
4 changes: 0 additions & 4 deletions src/hal/sstar/i6c_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ int i6c_audio_init(void);

int i6c_channel_bind(char index, char framerate, char jpeg);
int i6c_channel_create(char index, short width, short height, char mirror, char flip, char jpeg);
void i6c_channel_disable(char index);
int i6c_channel_enabled(char index);
int i6c_channel_grayscale(char enable);
int i6c_channel_in_mainloop(char index);
int i6c_channel_next(char mainLoop);
int i6c_channel_unbind(char index, char jpeg);

int i6c_config_load(char *path);
Expand Down
4 changes: 0 additions & 4 deletions src/hal/sstar/i6f_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ int i6f_audio_init(void);

int i6f_channel_bind(char index, char framerate, char jpeg);
int i6f_channel_create(char index, short width, short height, char mirror, char flip, char jpeg);
void i6f_channel_disable(char index);
int i6f_channel_enabled(char index);
int i6f_channel_grayscale(char enable);
int i6f_channel_in_mainloop(char index);
int i6f_channel_next(char mainLoop);
int i6f_channel_unbind(char index, char jpeg);

int i6f_config_load(char *path);
Expand Down
18 changes: 7 additions & 11 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,7 @@ void *server_thread(void *vargp) {
void sig_handler(int signo) {
printf("Graceful shutdown...\n");
keepRunning = 0;
stop_schedule = 1;
}
void epipe_handler(int signo) { printf("EPIPE\n"); }
void spipe_handler(int signo) { printf("SIGPIPE\n"); }
Expand All @@ -742,17 +743,12 @@ int server_fd = -1;
pthread_t server_thread_id;

int start_server() {
if (signal(SIGINT, sig_handler) == SIG_ERR)
printf("Error: can't catch SIGINT\n");
if (signal(SIGQUIT, sig_handler) == SIG_ERR)
printf("Error: can't catch SIGQUIT\n");
if (signal(SIGTERM, sig_handler) == SIG_ERR)
printf("Error: can't catch SIGTERM\n");

if (signal(SIGPIPE, spipe_handler) == SIG_ERR)
printf("Error: can't catch SIGPIPE\n");
if (signal(EPIPE, epipe_handler) == SIG_ERR)
printf("Error: can't catch EPIPE\n");
signal(SIGINT, sig_handler);
signal(SIGQUIT, sig_handler);
signal(SIGTERM, sig_handler);

signal(SIGPIPE, spipe_handler);
signal(EPIPE, epipe_handler);

for (uint32_t i = 0; i < MAX_CLIENTS; ++i) {
client_fds[i].socket_fd = -1;
Expand Down
4 changes: 2 additions & 2 deletions src/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ int start_sdk() {
hal_vidconfig config;
config.width = app_config.mp4_width;
config.height = app_config.mp4_height;
config.codec = app_config.mp4_codecH265;
config.codec = app_config.mp4_codecH265 ?
HAL_VIDCODEC_H265 : HAL_VIDCODEC_H264;
config.mode = HAL_VIDMODE_CBR;
config.profile = HAL_VIDPROFILE_BASELINE;
config.gop = app_config.mp4_fps * 2;
Expand Down Expand Up @@ -408,7 +409,6 @@ int stop_sdk() {
case HAL_PLATFORM_I6C: i6c_system_deinit(); break;
case HAL_PLATFORM_I6F: i6f_system_deinit(); break;
case HAL_PLATFORM_V3: v3_system_deinit(); break;

}

switch (plat) {
Expand Down

0 comments on commit c2ed845

Please sign in to comment.