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
7b80704d
Commit
7b80704d
authored
14 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#4068] Remove remaining echo canceller class
parent
bcfa783a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
sflphone-common/src/audio/alsa/alsalayer.cpp
+0
-30
0 additions, 30 deletions
sflphone-common/src/audio/alsa/alsalayer.cpp
sflphone-common/src/audio/pulseaudio/pulselayer.cpp
+0
-40
0 additions, 40 deletions
sflphone-common/src/audio/pulseaudio/pulselayer.cpp
with
0 additions
and
70 deletions
sflphone-common/src/audio/alsa/alsalayer.cpp
+
0
−
30
View file @
7b80704d
...
...
@@ -144,12 +144,6 @@ AlsaLayer::openDevice (int indexIn, int indexOut, int indexRing, int sampleRate,
// use 1 sec buffer for resampling
_converter
=
new
SamplerateConverter
(
_audioSampleRate
,
1000
);
AudioLayer
::
_echoCancel
=
new
EchoCancel
();
AudioLayer
::
_echoCanceller
=
new
AudioProcessing
(
static_cast
<
Algorithm
*>
(
_echoCancel
));
AudioLayer
::
_echoCancel
->
setEchoCancelState
(
AudioLayer
::
_echocancelstate
);
AudioLayer
::
_echoCancel
->
setNoiseSuppressState
(
AudioLayer
::
_noisesuppressstate
);
AudioLayer
::
_dcblocker
=
new
DcBlocker
();
AudioLayer
::
_audiofilter
=
new
AudioProcessing
(
static_cast
<
Algorithm
*>
(
_dcblocker
));
...
...
@@ -165,9 +159,6 @@ AlsaLayer::startStream (void)
if
(
_audiofilter
)
_audiofilter
->
resetAlgorithm
();
if
(
_echoCanceller
)
_echoCanceller
->
resetAlgorithm
();
if
(
is_playback_running
()
&&
is_capture_running
())
return
;
...
...
@@ -266,18 +257,12 @@ bool AlsaLayer::isCaptureActive (void)
void
AlsaLayer
::
setEchoCancelState
(
bool
state
)
{
// if a stream already running
if
(
AudioLayer
::
_echoCancel
)
_echoCancel
->
setEchoCancelState
(
state
);
AudioLayer
::
_echocancelstate
=
state
;
}
void
AlsaLayer
::
setNoiseSuppressState
(
bool
state
)
{
// if a stream already opened
if
(
AudioLayer
::
_echoCancel
)
_echoCancel
->
setNoiseSuppressState
(
state
);
AudioLayer
::
_noisesuppressstate
=
state
;
}
...
...
@@ -1012,10 +997,6 @@ void AlsaLayer::audioCallback (void)
getMainBuffer
()
->
getData
(
out
,
toGet
,
spkrVolume
);
// TODO: Audio processing should be performed inside mainbuffer
// to avoid such problem
AudioLayer
::
_echoCancel
->
setSamplingRate
(
_mainBufferSampleRate
);
if
(
_mainBufferSampleRate
&&
(
(
int
)
_audioSampleRate
!=
_mainBufferSampleRate
))
{
// Do sample rate conversion
...
...
@@ -1038,9 +1019,6 @@ void AlsaLayer::audioCallback (void)
}
// Copy far-end signal in echo canceller to adapt filter coefficient
// AudioLayer::_echoCanceller->putData (out, toGet);
}
else
{
if
(
!
tone
&&
!
file_tone
)
{
...
...
@@ -1105,8 +1083,6 @@ void AlsaLayer::audioCallback (void)
int
toPut
;
SFLDataFormat
*
in
=
NULL
;
SFLDataFormat
echoCancelledMic
[
5000
];
memset
(
echoCancelledMic
,
0
,
5000
);
if
(
is_capture_running
())
{
...
...
@@ -1136,11 +1112,7 @@ void AlsaLayer::audioCallback (void)
_audiofilter
->
processAudio
(
rsmpl_out
,
nbSample
*
sizeof
(
SFLDataFormat
));
// echo cancellation processing
// int sampleready = AudioLayer::_echoCanceller->processAudio (rsmpl_out, echoCancelledMic, nbSample*sizeof (SFLDataFormat));
getMainBuffer
()
->
putData
(
rsmpl_out
,
nbSample
*
sizeof
(
SFLDataFormat
),
100
);
// getMainBuffer()->putData (echoCancelledMic, sampleready*sizeof (SFLDataFormat), 100);
free
(
rsmpl_out
);
rsmpl_out
=
0
;
...
...
@@ -1153,8 +1125,6 @@ void AlsaLayer::audioCallback (void)
if
(
filter_out
)
{
_audiofilter
->
processAudio
(
in
,
filter_out
,
toPut
);
// captureFile->write ( (const char *) filter_out, toPut);
// int sampleready = AudioLayer::_echoCanceller->processAudio (filter_out, echoCancelledMic, toPut);
// getMainBuffer()->putData (echoCancelledMic, sampleready*sizeof (SFLDataFormat), 100);
getMainBuffer
()
->
putData
(
filter_out
,
toPut
,
100
);
free
(
filter_out
);
}
...
...
This diff is collapsed.
Click to expand it.
sflphone-common/src/audio/pulseaudio/pulselayer.cpp
+
0
−
40
View file @
7b80704d
...
...
@@ -267,12 +267,6 @@ PulseLayer::~PulseLayer (void)
_converter
=
NULL
;
}
delete
AudioLayer
::
_echoCancel
;
AudioLayer
::
_echoCancel
=
NULL
;
delete
AudioLayer
::
_echoCanceller
;
AudioLayer
::
_echoCanceller
=
NULL
;
delete
AudioLayer
::
_dcblocker
;
AudioLayer
::
_dcblocker
=
NULL
;
...
...
@@ -436,9 +430,6 @@ bool PulseLayer::openDevice (int indexIn UNUSED, int indexOut UNUSED, int indexR
_converter
=
new
SamplerateConverter
(
_audioSampleRate
,
1000
);
// Instantiate the algorithm
AudioLayer
::
_echoCancel
=
new
EchoCancel
(
_audioSampleRate
,
_frameSize
);
AudioLayer
::
_echoCanceller
=
new
AudioProcessing
(
static_cast
<
Algorithm
*>
(
_echoCancel
));
AudioLayer
::
_dcblocker
=
new
DcBlocker
();
AudioLayer
::
_audiofilter
=
new
AudioProcessing
(
static_cast
<
Algorithm
*>
(
_dcblocker
));
...
...
@@ -650,9 +641,6 @@ int PulseLayer::canGetMic()
void
PulseLayer
::
startStream
(
void
)
{
if
(
_echoCanceller
)
_echoCanceller
->
resetAlgorithm
();
// Create Streams
if
(
!
playback
||
!
record
)
createStreams
(
context
);
...
...
@@ -750,18 +738,12 @@ void PulseLayer::processData (void)
void
PulseLayer
::
setEchoCancelState
(
bool
state
)
{
// if a stream already running
if
(
AudioLayer
::
_echoCancel
)
_echoCancel
->
setEchoCancelState
(
state
);
AudioLayer
::
_echocancelstate
=
state
;
}
void
PulseLayer
::
setNoiseSuppressState
(
bool
state
)
{
// if a stream already opened
if
(
AudioLayer
::
_echoCancel
)
_echoCancel
->
setNoiseSuppressState
(
state
);
AudioLayer
::
_noisesuppressstate
=
state
;
}
...
...
@@ -865,10 +847,6 @@ void PulseLayer::writeToSpeaker (void)
getMainBuffer
()
->
getData
(
out
,
byteToGet
,
100
);
// TODO: Audio processing should be performed inside mainbuffer
// to avoid such problem
AudioLayer
::
_echoCancel
->
setSamplingRate
(
_mainBufferSampleRate
);
// test if resampling is required
if
(
_mainBufferSampleRate
&&
(
(
int
)
_audioSampleRate
!=
_mainBufferSampleRate
))
{
...
...
@@ -895,10 +873,6 @@ void PulseLayer::writeToSpeaker (void)
}
// Copy far-end signal in echo canceller to adapt filter coefficient
// AudioLayer::_echoCanceller->putData(out, byteToGet);
pa_xfree
(
out
);
}
else
{
...
...
@@ -930,9 +904,6 @@ void PulseLayer::readFromMic (void)
const
char
*
data
=
NULL
;
size_t
r
;
SFLDataFormat
echoCancelledMic
[
10000
];
memset
(
echoCancelledMic
,
0
,
10000
*
sizeof
(
SFLDataFormat
));
int
readableSize
=
pa_stream_readable_size
(
record
->
pulseStream
());
...
...
@@ -963,12 +934,6 @@ void PulseLayer::readFromMic (void)
// captureFilterFile->write ((const char *)rsmpl_out, nbSample*sizeof(SFLDataFormat));
// echo cancellation processing
// int sampleready = _echoCanceller->processAudio(rsmpl_out, echoCancelledMic, nbSample*sizeof(SFLDataFormat));
// getMainBuffer()->putData ( (void*) rsmpl_out, nbSample*sizeof (SFLDataFormat), 100);
// if(sampleready)
// getMainBuffer()->putData ( echoCancelledMic, sampleready*sizeof (SFLDataFormat), 100);
getMainBuffer
()
->
putData
(
rsmpl_out
,
nbSample
*
sizeof
(
SFLDataFormat
),
100
);
pa_xfree
(
rsmpl_out
);
...
...
@@ -984,11 +949,6 @@ void PulseLayer::readFromMic (void)
// captureFile->write ( (const char *) filter_out, r);
// echo cancellation processing
// int sampleready = _echoCanceller->processAudio((SFLDataFormat *)filter_out, echoCancelledMic, r);
// no resampling required
// getMainBuffer()->putData (echoCancelledMic, sampleready*sizeof (SFLDataFormat), 100);
getMainBuffer
()
->
putData
(
filter_out
,
r
,
100
);
pa_xfree
(
filter_out
);
...
...
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