Commit 5787ddda authored by François Grisez's avatar François Grisez
Browse files

Reworking of CMakeLists.txt related to the update of WebRTC

parent 200a9744
......@@ -65,13 +65,13 @@ if(ENABLE_ILBC)
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
set(WEBRTC_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/webrtc")
set(WEBRTC_SRC_DIR "${WEBRTC_ROOT_DIR}/webrtc")
include_directories(
${MEDIASTREAMER2_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
webrtc
webrtc/common_audio/signal_processing/include
webrtc/modules/audio_coding/codecs/ilbc/interface
${WEBRTC_ROOT_DIR}
${WEBRTC_SRC_DIR}/common_audio/signal_processing/include
)
add_definitions(-DHAVE_CONFIG_H)
......@@ -85,6 +85,7 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone" AND "${CMAKE_GENERATOR_PLATFOR
)
endif()
if(UNIX)
add_definitions(-DWEBRTC_POSIX)
if(APPLE)
add_definitions(-DWEBRTC_MAC -DWEBRTC_THREAD_RR -DWEBRTC_CLOCK_TYPE_REALTIME)
else()
......@@ -97,65 +98,67 @@ if(FIXED_POINT_PROCESSOR)
add_definitions(-D__ARMEL__)
endif()
set(WEBRTC_COMMON_DIR "${CMAKE_CURRENT_SOURCE_DIR}/webrtc/common_audio/signal_processing")
set(WEBRTC_SIGNAL_PROCESSING_DIR ${WEBRTC_SRC_DIR}/common_audio/signal_processing)
set(WEBRTC_SIGNAL_PROCESSING_SRCS
${WEBRTC_SIGNAL_PROCESSING_DIR}/spl_sqrt.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/real_fft.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/filter_ar_fast_q12.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/complex_bit_reverse.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/spl_init.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/splitting_filter.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/spl_sqrt_floor.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/levinson_durbin.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/filter_ar.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/get_scaling_square.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/resample_fractional.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/resample.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/downsample_fast.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/filter_ma_fast_q12.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/auto_corr_to_refl_coef.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/auto_correlation.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/refl_coef_to_lpc.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/dot_product_with_scale.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/copy_set_operations.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/cross_correlation.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/sqrt_of_one_minus_x_squared.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/ilbc_specific_functions.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/resample_by_2.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/complex_fft.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/resample_48khz.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/energy.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/get_hanning_window.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/randomization_functions.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/vector_scaling_operations.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/resample_by_2_internal.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/lpc_to_refl_coef.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/min_max_operations.c
${WEBRTC_SIGNAL_PROCESSING_DIR}/division_operations.c
)
set(WEBRTC_COMMON_DIR "${WEBRTC_SRC_DIR}/common_audio")
set(WEBRTC_COMMON_SRCS
${WEBRTC_COMMON_DIR}/spl_sqrt.c
${WEBRTC_COMMON_DIR}/real_fft.c
${WEBRTC_COMMON_DIR}/filter_ar_fast_q12.c
${WEBRTC_COMMON_DIR}/webrtc_fft_t_1024_8.c
${WEBRTC_COMMON_DIR}/complex_bit_reverse.c
${WEBRTC_COMMON_DIR}/spl_init.c
${WEBRTC_COMMON_DIR}/splitting_filter.c
${WEBRTC_COMMON_DIR}/spl_sqrt_floor.c
${WEBRTC_COMMON_DIR}/levinson_durbin.c
${WEBRTC_COMMON_DIR}/filter_ar.c
${WEBRTC_COMMON_DIR}/get_scaling_square.c
${WEBRTC_COMMON_DIR}/resample_fractional.c
${WEBRTC_COMMON_DIR}/resample.c
${WEBRTC_COMMON_DIR}/downsample_fast.c
${WEBRTC_COMMON_DIR}/filter_ma_fast_q12.c
${WEBRTC_COMMON_DIR}/auto_corr_to_refl_coef.c
${WEBRTC_COMMON_DIR}/auto_correlation.c
${WEBRTC_COMMON_DIR}/refl_coef_to_lpc.c
${WEBRTC_COMMON_DIR}/dot_product_with_scale.c
${WEBRTC_COMMON_DIR}/copy_set_operations.c
${WEBRTC_COMMON_DIR}/spl_version.c
${WEBRTC_COMMON_DIR}/cross_correlation.c
${WEBRTC_COMMON_DIR}/sqrt_of_one_minus_x_squared.c
${WEBRTC_COMMON_DIR}/ilbc_specific_functions.c
${WEBRTC_COMMON_DIR}/resample_by_2.c
${WEBRTC_COMMON_DIR}/complex_fft.c
${WEBRTC_COMMON_DIR}/resample_48khz.c
${WEBRTC_COMMON_DIR}/energy.c
${WEBRTC_COMMON_DIR}/get_hanning_window.c
${WEBRTC_COMMON_DIR}/randomization_functions.c
${WEBRTC_COMMON_DIR}/vector_scaling_operations.c
${WEBRTC_COMMON_DIR}/webrtc_fft_t_rad.c
${WEBRTC_COMMON_DIR}/resample_by_2_internal.c
${WEBRTC_COMMON_DIR}/lpc_to_refl_coef.c
${WEBRTC_COMMON_DIR}/min_max_operations.c
${WEBRTC_COMMON_DIR}/division_operations.c
${WEBRTC_COMMON_DIR}/fft4g.c
${WEBRTC_COMMON_DIR}/ring_buffer.c
)
include_directories(${WEBRTC_COMMOND_DIR}/include)
if(ENABLE_AECM)
set(AECM_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/webrtc/modules/audio_processing/aecm")
set(AECM_SRC_DIR "${WEBRTC_SRC_DIR}/modules/audio_processing/aecm")
set(AECM_SRCS
aec.c
${AECM_SRC_DIR}/echo_control_mobile.c
${AECM_SRC_DIR}/aecm_core.c
${AECM_SRC_DIR}/../utility/fft4g.c
${AECM_SRC_DIR}/../utility/ring_buffer.c
${AECM_SRC_DIR}/aecm_core_c.c
${AECM_SRC_DIR}/../utility/
${AECM_SRC_DIR}/../utility/delay_estimator.c
${AECM_SRC_DIR}/../utility/delay_estimator_wrapper.c
)
include_directories(
${AECM_SRC_DIR}/include
webrtc/modules/audio_processing/utility
webrtc/system_wrappers/interface
${WEBRTC_SRC_DIR}/modules/audio_processing/utility
${WEBRTC_SRC_DIR}/system_wrappers/interface
)
endif()
if(ENABLE_ISAC)
set(ISAC_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/webrtc/modules/audio_coding/codecs/isac/${ISAC_FLAVOUR}")
set(ISAC_SRC_DIR "${WEBRTC_SRC_DIR}/modules/audio_coding/codecs/isac/${ISAC_FLAVOUR}")
set(ISAC_SRCS
isac_dec.c
isac_enc.c
......@@ -173,11 +176,13 @@ if(ENABLE_ISAC)
${ISAC_SRC_DIR}/source/lattice.c
${ISAC_SRC_DIR}/source/lpc_tables.c
${ISAC_SRC_DIR}/source/pitch_estimator.c
${ISAC_SRC_DIR}/source/pitch_estimator_c.c
${ISAC_SRC_DIR}/source/pitch_filter.c
${ISAC_SRC_DIR}/source/pitch_gain_tables.c
${ISAC_SRC_DIR}/source/pitch_lag_tables.c
${ISAC_SRC_DIR}/source/spectrum_ar_model_tables.c
${ISAC_SRC_DIR}/source/transform.c
${ISAC_SRC_DIR}/source/transform_tables.c
)
if("${ISAC_FLAVOUR}" STREQUAL "fix")
list(APPEND ISAC_SRCS
......@@ -206,11 +211,11 @@ if(ENABLE_ISAC)
include_directories(
${ISAC_SRC_DIR}/source
${ISAC_SRC_DIR}/util
${ISAC_SRC_DIR}/interface
${ISAC_SRC_DIR}/include
)
endif()
if(ENABLE_ILBC)
set(ILBC_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/webrtc/modules/audio_coding/codecs/ilbc)
set(ILBC_SRC_DIR ${WEBRTC_SRC_DIR}/modules/audio_coding/codecs/ilbc)
set(ILBC_SRCS
ilbc.c
${ILBC_SRC_DIR}/abs_quant.c
......@@ -283,11 +288,13 @@ if(ENABLE_ILBC)
${ILBC_SRC_DIR}/window32_w32.c
${ILBC_SRC_DIR}/xcorr_coef.c
)
include_directories(${ILBC_SRC_DIR}/include)
endif()
set(SOURCE_FILES
mswebrtc.c
${WEBRTC_COMMON_SRCS}
${WEBRTC_SIGNAL_PROCESSING_SRCS}
)
if(ENABLE_AECM)
list(APPEND SOURCE_FILES ${AECM_SRCS})
......
......@@ -41,7 +41,7 @@ typedef struct EncState{
int ptime;
uint32_t ts;
MSBufferizer *bufferizer;
iLBC_encinst_t *ilbc_enc;
IlbcEncoderInstance *ilbc_enc;
}EncState;
static void enc_init(MSFilter *f){
......@@ -139,8 +139,8 @@ static void enc_process(MSFilter *f){
EncState *s=(EncState*)f->data;
mblk_t *im,*om;
int size=s->nsamples*2;
WebRtc_Word16 samples[BLOCKL_MAX * 7]; /* BLOCKL_MAX * 7 is the largest size for ptime == 140 */
WebRtc_Word16 *samples_ptr;
int16_t samples[BLOCKL_MAX * 7]; /* BLOCKL_MAX * 7 is the largest size for ptime == 140 */
int16_t *samples_ptr;
int frame_per_packet=1;
int k;
......@@ -161,7 +161,7 @@ static void enc_process(MSFilter *f){
om=allocb(s->nbytes*frame_per_packet,0);
for (k=0;k<frame_per_packet;k++) {
samples_ptr = samples + k * s->nsamples;
WebRtcIlbcfix_Encode(s->ilbc_enc, samples_ptr, s->nsamples, (WebRtc_Word16 *)om->b_wptr);
WebRtcIlbcfix_Encode(s->ilbc_enc, samples_ptr, s->nsamples, om->b_wptr);
om->b_wptr+=s->nbytes;
}
s->ts+=s->nsamples*frame_per_packet;
......@@ -218,7 +218,7 @@ typedef struct DecState{
int nsamples;
int nbytes;
int ms_per_frame;
iLBC_decinst_t *ilbc_dec;
IlbcDecoderInstance *ilbc_dec;
bool_t ready;
MSConcealerContext *plcctx;
}DecState;
......@@ -276,9 +276,9 @@ static void dec_process(MSFilter *f){
int plctime;
for (k=0;k<frame_per_packet;k++) {
WebRtc_Word16 speech_type;
int16_t speech_type;
om=allocb(s->nsamples*2,0);
WebRtcIlbcfix_Decode(s->ilbc_dec, (WebRtc_Word16 *)(im->b_rptr+k*s->nbytes), s->nbytes, (WebRtc_Word16 *)om->b_wptr, &speech_type);
WebRtcIlbcfix_Decode(s->ilbc_dec, im->b_rptr+k*s->nbytes, s->nbytes, (int16_t *)om->b_wptr, &speech_type);
om->b_wptr += s->nsamples * 2;
mblk_meta_copy(im,om);
ms_queue_put(f->outputs[0],om);
......@@ -296,7 +296,7 @@ static void dec_process(MSFilter *f){
}
if (s->plcctx && s->ready && ms_concealer_context_is_concealement_required(s->plcctx,f->ticker->time)){
om=allocb(s->nsamples*2,0);
WebRtcIlbcfix_DecodePlc(s->ilbc_dec, (WebRtc_Word16 *)om->b_wptr, 1);
WebRtcIlbcfix_DecodePlc(s->ilbc_dec, (int16_t *)om->b_wptr, 1);
om->b_wptr += s->nsamples * 2;
mblk_set_plc_flag(om,TRUE);
ms_queue_put(f->outputs[0],om);
......
webrtc @ a7757e88
Subproject commit 3354b1c97cc143a3579f1a9e0b47dd16ab786162
Subproject commit a7757e88b2ac2d1f11ac544c5822659b42db4cf3
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment