block signals in threads

This commit is contained in:
Maxim Devaev
2024-03-04 03:38:45 +02:00
parent c8dc5119fe
commit 98b5e52a68
8 changed files with 31 additions and 14 deletions

View File

@@ -195,7 +195,7 @@ static _enc_buffer_s *_enc_buffer_init(void) {
}
static void *_pcm_thread(void *v_audio) {
US_THREAD_RENAME("us_a_pcm");
US_THREAD_SETTLE("us_a_pcm");
us_audio_s *const audio = (us_audio_s *)v_audio;
uint8_t in[_MAX_BUF8];
@@ -225,7 +225,7 @@ static void *_pcm_thread(void *v_audio) {
}
static void *_encoder_thread(void *v_audio) {
US_THREAD_RENAME("us_a_enc");
US_THREAD_SETTLE("us_a_enc");
us_audio_s *const audio = (us_audio_s *)v_audio;
int16_t in_res[_MAX_BUF16];

View File

@@ -93,10 +93,12 @@ void us_janus_client_send(us_janus_client_s *client, const us_rtp_s *rtp) {
}
static void *_video_thread(void *v_client) {
US_THREAD_SETTLE("us_c_video");
return _common_thread(v_client, true);
}
static void *_audio_thread(void *v_client) {
US_THREAD_SETTLE("us_c_audio");
return _common_thread(v_client, false);
}

View File

@@ -100,8 +100,7 @@ janus_plugin *create(void);
static void *_video_rtp_thread(void *arg) {
(void)arg;
US_THREAD_RENAME("us_video_rtp");
US_THREAD_SETTLE("us_video_rtp");
atomic_store(&_g_video_rtp_tid_created, true);
while (!_STOP) {
@@ -120,8 +119,7 @@ static void *_video_rtp_thread(void *arg) {
static void *_video_sink_thread(void *arg) {
(void)arg;
US_THREAD_RENAME("us_video_sink");
US_THREAD_SETTLE("us_video_sink");
atomic_store(&_g_video_sink_tid_created, true);
us_frame_s *drop = us_frame_init();
@@ -185,15 +183,16 @@ static void *_video_sink_thread(void *arg) {
US_JLOG_INFO("video", "Memsink closed");
sleep(1); // error_delay
}
us_frame_destroy(drop);
return NULL;
}
static void *_audio_thread(void *arg) {
(void)arg;
US_THREAD_RENAME("us_audio");
US_THREAD_SETTLE("us_audio");
atomic_store(&_g_audio_tid_created, true);
assert(_g_config->audio_dev_name != NULL);
assert(_g_config->tc358743_dev_path != NULL);