Commit 6e415c5a authored by Emmanuel Milou's avatar Emmanuel Milou

Shared libraries moved from /usr/lib to /usr/lib/sflphone/codecs.

Codecs dynamic libraries are created at the compilation time if they don't exist and copied in /usr/lib/sflphone/codecs at the installation
parent c9fefe51
bin_PROGRAMS = sflphoned
#bin_SCRIPTS = sflphone
if USE_ZEROCONF
ZEROCONFDIR = zeroconf
......
#SUBDIRS = gsm
sflcodecdir = $(prefix)/lib/sflphone/codecs/
noinst_LTLIBRARIES = libaudio.la
noinst_PROGRAMS = libcodec_ulaw.so libcodec_alaw.so libcodec_gsm.so
libcodec_ulaw_so_SOURCES = ulaw.cpp
libcodec_ulaw_so_CFLAGS = -fPIC -g -Wall
libcodec_ulaw_so_LDFLAGS = -shared
libcodec_alaw_so_SOURCES = alaw.cpp
libcodec_alaw_so_CFLAGS = -fPIC -g -Wall
libcodec_alaw_so_LDFLAGS = -shared
libcodec_gsm_so_SOURCES = gsmcodec.cpp
libcodec_gsm_so_CFLAGS = -fPIC -g -Wall
libcodec_gsm_so_LDFLAGS = -shared -lgsm
if USE_SPEEX
SPEEX_SOURCES_CPP=CodecSpeex.cpp
......@@ -18,7 +31,6 @@ tonegenerator.cpp codecDescriptor.cpp \
audioloop.cpp ringbuffer.cpp $(SPEEX_SOURCES_CPP)
AM_CXXFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/libs $(libccext2_CFLAGS) $(libdbuscpp_CFLAGS) $(libccrtp1_CFLAGS) $(USER_INCLUDES)
#libaudio_la_LIBADD = gsm/libgsm.la $(SPEEX_LIB)
libaudio_la_CPPFLAGS = $(SPEEX_FLAG)
......@@ -27,3 +39,20 @@ noinst_HEADERS = audioloop.h common.h ringbuffer.h audiofile.h
dtmfgenerator.h tonegenerator.h \
codecDescriptor.h dtmf.h tone.h \
CodecSpeex.h
install-exec-local: install-libcodec_ulaw_so install-libcodec_alaw_so install-libcodec_gsm_so
uninstall-local: uninstall-libcodec_ulaw_so uninstall-libcodec_alaw_so uninstall-libcodec_gsm_so
install-libcodec_ulaw_so: libcodec_ulaw.so
$(INSTALL_PROGRAM) libcodec_ulaw.so $(sflcodecdir)
install-libcodec_alaw_so: libcodec_alaw.so
$(INSTALL_PROGRAM) libcodec_alaw.so $(sflcodecdir)
install-libcodec_gsm_so: libcodec_gsm.so
$(INSTALL_PROGRAM) libcodec_gsm.so $(sflcodecdir)
uninstall-libcodec_ulaw_so:
rm -f $(sflcodecdir)/libcodec_ulaw.so
uninstall-libcodec_alaw_so:
rm -f $(sflcodecdir)/libcodec_alaw.so
uninstall-libcodec_gsm_so:
rm -f $(sflcodecdir)/libcodec_gsm.so
......@@ -31,12 +31,11 @@ AudioFile::AudioFile()
: AudioLoop()
{
// could vary later...
//_ulaw = new Ulaw(PAYLOAD_CODEC_ULAW);
_start = false;
using std::cout;
using std::cerr;
void* codec = dlopen("codec_ulaw.so", RTLD_LAZY);
void* codec = dlopen("libcodec_ulaw.so", RTLD_LAZY);
if(!codec){
cerr<<"cannot load library: "<< dlerror() <<'\n';
}
......
......@@ -259,16 +259,16 @@ AudioRtpRTX::loadCodec(int payload)
switch(payload){
case 0:
handle_codec = dlopen("codec_ulaw.so", RTLD_LAZY);
handle_codec = dlopen("libcodec_ulaw.so", RTLD_LAZY);
break;
case 3:
handle_codec = dlopen("codec_gsm.so", RTLD_LAZY);
handle_codec = dlopen("libcodec_gsm.so", RTLD_LAZY);
break;
case 8:
handle_codec = dlopen("codec_alaw.so", RTLD_LAZY);
handle_codec = dlopen("libcodec_alaw.so", RTLD_LAZY);
break;
case 97:
handle_codec = dlopen("codec_ilbc.so", RTLD_LAZY);
handle_codec = dlopen("libcodec_ilbc.so", RTLD_LAZY);
break;
}
......
......@@ -236,16 +236,16 @@ IAXVoIPLink::loadCodec(int payload)
switch(payload)
{
case 0:
handle_codec = dlopen("codec_ulaw.so", RTLD_LAZY);
handle_codec = dlopen("libcodec_ulaw.so", RTLD_LAZY);
break;
case 3:
handle_codec = dlopen("codec_gsm.so", RTLD_LAZY);
handle_codec = dlopen("libcodec_gsm.so", RTLD_LAZY);
break;
case 8:
handle_codec = dlopen("codec_alaw.so", RTLD_LAZY);
handle_codec = dlopen("libcodec_alaw.so", RTLD_LAZY);
break;
case 97:
handle_codec = dlopen("codec_ilbc.so", RTLD_LAZY);
handle_codec = dlopen("libcodec_ilbc.so", RTLD_LAZY);
break;
}
if(!handle_codec){
......
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