Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
c6e27581
Commit
c6e27581
authored
16 years ago
by
Emmanuel Milou
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
ssh://sflphone@192.168.1.213//home/sflphone/SFLphone/sflphone
parents
95da7a1c
6421269d
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
configure.ac
+5
-2
5 additions, 2 deletions
configure.ac
src/audio/codecs/Makefile.am
+5
-1
5 additions, 1 deletion
src/audio/codecs/Makefile.am
src/audio/codecs/speexcodec.cpp
+104
-106
104 additions, 106 deletions
src/audio/codecs/speexcodec.cpp
with
114 additions
and
109 deletions
configure.ac
+
5
−
2
View file @
c6e27581
...
@@ -233,10 +233,13 @@ AS_IF([test "x$with_speex" != xno],
...
@@ -233,10 +233,13 @@ AS_IF([test "x$with_speex" != xno],
[libspeex link test failed. You may use --without-speex to compile without speex codec support.])]
[libspeex link test failed. You may use --without-speex to compile without speex codec support.])]
)
)
]
]
dnl More advanced check in case the libspeexdsp is not installed
AC_CHECK_LIB(speex, speex_preprocess_run, [AC_DEFINE(HAVE_SPEEX_DSP)])
)
)
AC_DEFINE([HAVE_SPEEX], test "x$with_speex" = "xyes", [Define if you have libspeex])
AC_DEFINE([HAVE_SPEEX], test "x$with_speex" = "xyes", [Define if you have libspeex])
AM_CONDITIONAL(BUILD_SPEEX, test "x$with_speex" = "xyes" )
AM_CONDITIONAL(BUILD_SPEEX, test "x$with_speex" = "xyes" )
AM_CONDITIONAL(HAVE_SPEEX_DSP, $(HAVE_SPEEX_DSP))
dnl Check for ilbc support
dnl Check for ilbc support
AC_ARG_WITH([ilbc],
AC_ARG_WITH([ilbc],
...
...
This diff is collapsed.
Click to expand it.
src/audio/codecs/Makefile.am
+
5
−
1
View file @
c6e27581
...
@@ -11,10 +11,14 @@ endif
...
@@ -11,10 +11,14 @@ endif
if
BUILD_SPEEX
if
BUILD_SPEEX
SPEEX_LIB
=
libcodec_speex.so
SPEEX_LIB
=
libcodec_speex.so
SPEEX_DSP_LIB
=
if
HAVE_SPEEX_DSP
SPEEX_DSP_LIB
=
-lspeexdsp
endif
libcodec_speex_so_SOURCES
=
speexcodec.cpp
libcodec_speex_so_SOURCES
=
speexcodec.cpp
libcodec_speex_so_CFLAGS
=
-fPIC
-g
-Wall
libcodec_speex_so_CFLAGS
=
-fPIC
-g
-Wall
libcodec_speex_so_CXXFLAGS
=
-fPIC
-g
-Wall
libcodec_speex_so_CXXFLAGS
=
-fPIC
-g
-Wall
libcodec_speex_so_LDFLAGS
=
--shared
-lc
-lspeex
-lspeexdsp
-lm
libcodec_speex_so_LDFLAGS
=
--shared
-lc
-lspeex
$(
SPEEX_DSP_LIB
)
-lm
INSTALL_SPEEX_RULE
=
install-libcodec_speex_so
INSTALL_SPEEX_RULE
=
install-libcodec_speex_so
endif
endif
...
...
This diff is collapsed.
Click to expand it.
src/audio/codecs/speexcodec.cpp
+
104
−
106
View file @
c6e27581
/*
/*
* Copyright (C) 200
5
Savoir-Faire Linux inc.
* Copyright (C) 200
7-2009
Savoir-Faire Linux inc.
* Author:
Yan Morin <yan.morin
@savoirfairelinux.com>
* Author:
Alexandre Savard <alexandre.savard
@savoirfairelinux.com>
* Author:
Jerome Oufella <jerome.oufella
@savoirfairelinux.com>
* Author:
Emmanuel Milou <emmanuel.milou
@savoirfairelinux.com>
*
*
* This program is free software; you can redistribute it and/or modify
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* it under the terms of the GNU General Public License as published by
...
@@ -23,8 +23,6 @@
...
@@ -23,8 +23,6 @@
#include
<speex/speex.h>
#include
<speex/speex.h>
#include
<speex/speex_preprocess.h>
#include
<speex/speex_preprocess.h>
class
Speex
:
public
AudioCodec
{
class
Speex
:
public
AudioCodec
{
public:
public:
Speex
(
int
payload
=
0
)
Speex
(
int
payload
=
0
)
...
@@ -48,20 +46,7 @@ public:
...
@@ -48,20 +46,7 @@ public:
Speex
&
operator
=
(
const
Speex
&
);
Speex
&
operator
=
(
const
Speex
&
);
void
initSpeex
()
{
void
initSpeex
()
{
int
enable
=
1
;
int
quality
=
10
;
int
complex
=
10
;
int
attenuation
=
-
10
;
/*
if (_clockRate < 16000 ) {
_speexModePtr = &speex_nb_mode;
} else if (_clockRate < 32000) {
_speexModePtr = &speex_wb_mode;
} else {
_speexModePtr = &speex_uwb_mode;
}
*/
// 8000 HZ --> Narrow-band mode
// 8000 HZ --> Narrow-band mode
// TODO Manage the other modes
// TODO Manage the other modes
_speexModePtr
=
&
speex_nb_mode
;
_speexModePtr
=
&
speex_nb_mode
;
...
@@ -73,6 +58,14 @@ public:
...
@@ -73,6 +58,14 @@ public:
// Init the encoder struct
// Init the encoder struct
speex_bits_init
(
&
_speex_enc_bits
);
speex_bits_init
(
&
_speex_enc_bits
);
_speex_enc_state
=
speex_encoder_init
(
_speexModePtr
);
_speex_enc_state
=
speex_encoder_init
(
_speexModePtr
);
#ifdef HAVE_SPEEX_DSP
int
enable
=
1
;
int
quality
=
10
;
int
complex
=
10
;
int
attenuation
=
-
10
;
speex_encoder_ctl
(
_speex_enc_state
,
SPEEX_SET_VAD
,
&
enable
);
speex_encoder_ctl
(
_speex_enc_state
,
SPEEX_SET_VAD
,
&
enable
);
speex_encoder_ctl
(
_speex_enc_state
,
SPEEX_SET_DTX
,
&
enable
);
speex_encoder_ctl
(
_speex_enc_state
,
SPEEX_SET_DTX
,
&
enable
);
speex_encoder_ctl
(
_speex_enc_state
,
SPEEX_SET_VBR_QUALITY
,
&
quality
);
speex_encoder_ctl
(
_speex_enc_state
,
SPEEX_SET_VBR_QUALITY
,
&
quality
);
...
@@ -87,6 +80,7 @@ public:
...
@@ -87,6 +80,7 @@ public:
speex_preprocess_ctl
(
_preprocess_state
,
SPEEX_PREPROCESS_SET_NOISE_SUPPRESS
,
&
attenuation
);
speex_preprocess_ctl
(
_preprocess_state
,
SPEEX_PREPROCESS_SET_NOISE_SUPPRESS
,
&
attenuation
);
speex_preprocess_ctl
(
_preprocess_state
,
SPEEX_PREPROCESS_SET_VAD
,
&
enable
);
speex_preprocess_ctl
(
_preprocess_state
,
SPEEX_PREPROCESS_SET_VAD
,
&
enable
);
speex_preprocess_ctl
(
_preprocess_state
,
SPEEX_PREPROCESS_SET_AGC
,
&
enable
);
speex_preprocess_ctl
(
_preprocess_state
,
SPEEX_PREPROCESS_SET_AGC
,
&
enable
);
#endif
}
}
...
@@ -119,8 +113,12 @@ public:
...
@@ -119,8 +113,12 @@ public:
virtual
int
codecEncode
(
unsigned
char
*
dst
,
short
*
src
,
unsigned
int
size
)
virtual
int
codecEncode
(
unsigned
char
*
dst
,
short
*
src
,
unsigned
int
size
)
{
{
speex_bits_reset
(
&
_speex_enc_bits
);
speex_bits_reset
(
&
_speex_enc_bits
);
#ifdef HAVE_SPEEX_DSP
speex_encoder_ctl
(
_speex_enc_state
,
SPEEX_SET_SAMPLING_RATE
,
&
_clockRate
);
speex_encoder_ctl
(
_speex_enc_state
,
SPEEX_SET_SAMPLING_RATE
,
&
_clockRate
);
speex_preprocess_run
(
_preprocess_state
,
src
);
speex_preprocess_run
(
_preprocess_state
,
src
);
#endif
speex_encode_int
(
_speex_enc_state
,
src
,
&
_speex_enc_bits
);
speex_encode_int
(
_speex_enc_state
,
src
,
&
_speex_enc_bits
);
int
nbBytes
=
speex_bits_write
(
&
_speex_enc_bits
,
(
char
*
)
dst
,
size
);
int
nbBytes
=
speex_bits_write
(
&
_speex_enc_bits
,
(
char
*
)
dst
,
size
);
return
nbBytes
;
return
nbBytes
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment