Update for building on iOS

pull/43/head
Nick Porcino 7 years ago
parent ae0f455615
commit 6a88f291ea

@ -5,7 +5,16 @@ set(CMAKE_MODULE_PATH ${LIBNYQUIST_ROOT}/cmake)
include(CXXhelpers)
option(BUILD_EXAMPLE "Build example application" ON)
if (CMAKE_OSX_ARCHITECTURES)
if(CMAKE_OSX_SYSROOT MATCHES ".*iphoneos.*")
# RtAudio is not portable to ios currently
option(BUILD_EXAMPLE "Build example application" OFF)
else()
option(BUILD_EXAMPLE "Build example application" ON)
endif()
else()
option(BUILD_EXAMPLE "Build example application" ON)
endif()
#-------------------------------------------------------------------------------

@ -96,12 +96,6 @@ struct OpusCustomDecoder {
/* opus_val16 backgroundLogE[], Size = 2*mode->nbEBands */
};
int celt_decoder_get_size(int channels)
{
const CELTMode *mode = opus_custom_mode_create(48000, 960, NULL);
return opus_custom_decoder_get_size(mode, channels);
}
OPUS_CUSTOM_NOSTATIC int opus_custom_decoder_get_size(const CELTMode *mode, int channels)
{
int size = sizeof(struct CELTDecoder)
@ -111,6 +105,12 @@ OPUS_CUSTOM_NOSTATIC int opus_custom_decoder_get_size(const CELTMode *mode, int
return size;
}
int celt_decoder_get_size(int channels)
{
const CELTMode *mode = opus_custom_mode_create(48000, 960, NULL);
return opus_custom_decoder_get_size(mode, channels);
}
#ifdef CUSTOM_MODES
CELTDecoder *opus_custom_decoder_create(const CELTMode *mode, int channels, int *error)
{
@ -128,18 +128,6 @@ CELTDecoder *opus_custom_decoder_create(const CELTMode *mode, int channels, int
}
#endif /* CUSTOM_MODES */
int celt_decoder_init(CELTDecoder *st, opus_int32 sampling_rate, int channels)
{
int ret;
ret = opus_custom_decoder_init(st, opus_custom_mode_create(48000, 960, NULL), channels);
if (ret != OPUS_OK)
return ret;
st->downsample = resampling_factor(sampling_rate);
if (st->downsample==0)
return OPUS_BAD_ARG;
else
return OPUS_OK;
}
OPUS_CUSTOM_NOSTATIC int opus_custom_decoder_init(CELTDecoder *st, const CELTMode *mode, int channels)
{
@ -168,6 +156,20 @@ OPUS_CUSTOM_NOSTATIC int opus_custom_decoder_init(CELTDecoder *st, const CELTMod
return OPUS_OK;
}
int celt_decoder_init(CELTDecoder *st, opus_int32 sampling_rate, int channels)
{
int ret;
ret = opus_custom_decoder_init(st, opus_custom_mode_create(48000, 960, NULL), channels);
if (ret != OPUS_OK)
return ret;
st->downsample = resampling_factor(sampling_rate);
if (st->downsample==0)
return OPUS_BAD_ARG;
else
return OPUS_OK;
}
#ifdef CUSTOM_MODES
void opus_custom_decoder_destroy(CELTDecoder *st)
{

@ -126,12 +126,6 @@ struct OpusCustomEncoder {
/* opus_val16 oldLogE2[], Size = channels*mode->nbEBands */
};
int celt_encoder_get_size(int channels)
{
CELTMode *mode = opus_custom_mode_create(48000, 960, NULL);
return opus_custom_encoder_get_size(mode, channels);
}
OPUS_CUSTOM_NOSTATIC int opus_custom_encoder_get_size(const CELTMode *mode, int channels)
{
int size = sizeof(struct CELTEncoder)
@ -143,6 +137,12 @@ OPUS_CUSTOM_NOSTATIC int opus_custom_encoder_get_size(const CELTMode *mode, int
return size;
}
int celt_encoder_get_size(int channels)
{
CELTMode *mode = opus_custom_mode_create(48000, 960, NULL);
return opus_custom_encoder_get_size(mode, channels);
}
#ifdef CUSTOM_MODES
CELTEncoder *opus_custom_encoder_create(const CELTMode *mode, int channels, int *error)
{

Loading…
Cancel
Save