cast to concrete type

dev
xufulong 3 years ago
parent 2a95b20538
commit 2b6653f3d8
  1. 8
      app/src/main/cpp/visualizer/execute_fft.c
  2. 48
      app/src/main/cpp/visualizer/execute_fft.h

@ -44,7 +44,7 @@ int open_visualizer(filter_sys_t *p_sys)
block_t *filter_audio(filter_sys_t *p_sys, void *p_in_buf)
{
return vlc_queue_push(&p_sys->queue, p_in_buf);
return (block_t *) vlc_queue_push(&p_sys->queue, p_in_buf);
}
void close_visualizer(filter_sys_t *p_filter)
@ -73,7 +73,7 @@ static void *fft_thread(void *p_data)
float height[NB_BANDS] = {0};
LOGE("start FFT thread...");
while ((block = vlc_queue_pop(&p_sys->queue)))
while ((block = (block_t *) vlc_queue_pop(&p_sys->queue)))
{
LOGE("running FFT transform...");
/* Horizontal scale for 20-band equalizer */
@ -102,7 +102,7 @@ static void *fft_thread(void *p_data)
if (block->i_nb_samples != p_sys->i_prev_nb_samples)
{
free(p_sys->p_prev_s16_buff);
p_sys->p_prev_s16_buff = malloc(block->i_nb_samples *
p_sys->p_prev_s16_buff = (short *) malloc(block->i_nb_samples *
p_sys->i_channels *
sizeof(int16_t));
if (!p_sys->p_prev_s16_buff)
@ -268,7 +268,7 @@ void fft_once(filter_sys_t *p_sys)
if (nb_samples != p_sys->i_prev_nb_samples)
{
free(p_sys->p_prev_s16_buff);
p_sys->p_prev_s16_buff = malloc(nb_samples *
p_sys->p_prev_s16_buff = (short *) malloc(nb_samples *
p_sys->i_channels *
sizeof(int16_t));
if (!p_sys->p_prev_s16_buff)

@ -5,33 +5,41 @@
#ifndef EXECUTE_FFT_H
#define EXECUTE_FFT_H
#include <math.h>
#include <unistd.h>
#ifdef __cplusplus
extern "C" {
#endif
#include "block_queue.h"
#include "fft.h"
#include "window.h"
#include <math.h>
#include <unistd.h>
#ifdef __cplusplus
}
#endif
typedef struct
{
pthread_t thread;
vlc_queue_t queue;
bool dead;
int i_channels;
int i_prev_nb_samples;
int16_t *p_prev_s16_buff;
float f_rotationAngle;
float f_rotationIncrement;
/* FFT window parameters */
window_param wind_param;
uint8_t *data;
int data_size;
int nb_samples;
int8_t *output;
int out_samples;
pthread_t thread;
vlc_queue_t queue;
bool dead;
int i_channels;
int i_prev_nb_samples;
int16_t *p_prev_s16_buff;
float f_rotationAngle;
float f_rotationIncrement;
/* FFT window parameters */
window_param wind_param;
uint8_t *data;
int data_size;
int nb_samples;
int8_t *output;
int out_samples;
} filter_sys_t;
static void *fft_thread(void *);

Loading…
Cancel
Save