From c60ebdb6ec05efe48961a21723bfa08d5c032517 Mon Sep 17 00:00:00 2001 From: xufuji456 <839789740@qq.com> Date: Wed, 18 Aug 2021 00:20:49 +0800 Subject: [PATCH] update queue --- app/src/main/cpp/visualizer/execute_fft.c | 8 ++++---- app/src/main/cpp/visualizer/execute_fft.h | 7 +++---- app/src/main/cpp/visualizer/queue.c | 1 - app/src/main/cpp/visualizer/vlc_queue.h | 2 -- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/app/src/main/cpp/visualizer/execute_fft.c b/app/src/main/cpp/visualizer/execute_fft.c index ab0fe77..7271b89 100644 --- a/app/src/main/cpp/visualizer/execute_fft.c +++ b/app/src/main/cpp/visualizer/execute_fft.c @@ -38,7 +38,7 @@ static inline block_t *block_Duplicate(const block_t *p_block) return p_dup; } -/*static*/ int Open(filter_sys_t *p_sys) +/*static*/ int open_visualizer(filter_sys_t *p_sys) { if (p_sys == NULL) return VLC_ENOMEM; @@ -67,7 +67,7 @@ static inline block_t *block_Duplicate(const block_t *p_block) // return VLC_ENOMEM; // } - pthread_create (&p_sys->thread, NULL, Thread, p_sys); + pthread_create (&p_sys->thread, NULL, fft_thread, p_sys); return VLC_SUCCESS; } @@ -78,7 +78,7 @@ static inline block_t *block_Duplicate(const block_t *p_block) return p_in_buf; } -/*static*/ void Close(filter_sys_t *p_filter) +/*static*/ void close_visualizer(filter_sys_t *p_filter) { filter_sys_t *p_sys = p_filter; @@ -90,7 +90,7 @@ static inline block_t *block_Duplicate(const block_t *p_block) free(p_sys->p_prev_s16_buff); } -static void *Thread(void *p_data) +static void *fft_thread(void *p_data) { filter_sys_t *p_sys = (filter_sys_t*)p_data; block_t *block; diff --git a/app/src/main/cpp/visualizer/execute_fft.h b/app/src/main/cpp/visualizer/execute_fft.h index bb1aae2..1b13db5 100644 --- a/app/src/main/cpp/visualizer/execute_fft.h +++ b/app/src/main/cpp/visualizer/execute_fft.h @@ -49,7 +49,6 @@ struct block_t typedef struct { -// vlc_thread_t thread; pthread_t thread; /* Audio data */ @@ -66,12 +65,12 @@ typedef struct window_param wind_param; } filter_sys_t; -static void *Thread(void *); +static void *fft_thread(void *); -/*static*/ int Open(filter_sys_t *p_sys); +/*static*/ int open_visualizer(filter_sys_t *p_sys); /*static*/ block_t *filter_audio(filter_sys_t *p_sys, block_t *p_in_buf); -/*static*/ void Close(filter_sys_t *p_filter); +/*static*/ void close_visualizer(filter_sys_t *p_filter); #endif //PLAYER_CORE_RUN_FFT_H diff --git a/app/src/main/cpp/visualizer/queue.c b/app/src/main/cpp/visualizer/queue.c index 1a85935..5b2ef7a 100644 --- a/app/src/main/cpp/visualizer/queue.c +++ b/app/src/main/cpp/visualizer/queue.c @@ -132,7 +132,6 @@ void *vlc_queue_Dequeue(vlc_queue_t *q) void *entry; vlc_queue_Lock(q); -// vlc_testcancel(); while (vlc_queue_IsEmpty(q)) vlc_queue_Wait(q); diff --git a/app/src/main/cpp/visualizer/vlc_queue.h b/app/src/main/cpp/visualizer/vlc_queue.h index 7453ae1..920d942 100644 --- a/app/src/main/cpp/visualizer/vlc_queue.h +++ b/app/src/main/cpp/visualizer/vlc_queue.h @@ -46,9 +46,7 @@ typedef struct vlc_queue struct vlc_queue_entry *first; struct vlc_queue_entry **lastp; ptrdiff_t next_offset; -// vlc_mutex_t lock; pthread_mutex_t lock; -// vlc_cond_t wait; pthread_cond_t wait; } vlc_queue_t;