Commit 180c0cf9 authored by Alexandre Savard's avatar Alexandre Savard

[#1966] Moved audioProcessing from mainbuffer to audiolayer

parent e7dd0a3c
......@@ -29,6 +29,10 @@
#include <cc++/thread.h> // for ost::Mutex
#include "echocancel.h"
#include "algorithm.h"
#define FRAME_PER_BUFFER 160
/**
......@@ -295,6 +299,10 @@ class AudioLayer {
*/
ost::Mutex _mutex;
EchoCancel *_echoCancel;
AudioProcessing *_audioProcessing;
};
#endif // _AUDIO_LAYER_H_
......@@ -26,9 +26,6 @@
MainBuffer::MainBuffer() : _internalSamplingRate (0)
{
mixBuffer = new SFLDataFormat[STATIC_BUFSIZE];
_echoCancel = new EchoCancel();
_audioProcessing = new AudioProcessing(static_cast<Algorithm *>(_echoCancel));
}
......@@ -36,9 +33,6 @@ MainBuffer::~MainBuffer()
{
delete [] mixBuffer; mixBuffer = NULL;
delete _echoCancel; _echoCancel = NULL;
delete _audioProcessing; _audioProcessing = NULL;
}
......@@ -360,15 +354,11 @@ int MainBuffer::getDataByID (void *buffer, int toCopy, unsigned short volume, Ca
RingBuffer* ring_buffer = getRingBuffer (call_id);
if (ring_buffer == NULL) {
if (!ring_buffer) {
return 0;
}
return ring_buffer->Get (buffer, toCopy, volume, reader_id);
return 0;
}
......@@ -383,7 +373,7 @@ int MainBuffer::availForGet (CallID call_id)
return 0;
if (callid_set->empty()) {
_debug ("CallIDSet with ID: \"%s\" is empty!", call_id.c_str());
_debug ("MainBuffer: CallIDSet with ID: \"%s\" is empty!", call_id.c_str());
return 0;
}
......@@ -419,15 +409,13 @@ int MainBuffer::availForGetByID (CallID call_id, CallID reader_id)
{
if ( (call_id != default_id) && (reader_id == call_id)) {
_debug ("**********************************************************************");
_debug ("Error an RTP session ring buffer is not supposed to have a readpointer on tiself");
_error("MainBuffer: Error: RingBuffer has a readpointer on tiself");
}
RingBuffer* ringbuffer = getRingBuffer (call_id);
if (ringbuffer == NULL) {
_debug ("Error: ring buffer does not exist");
_error("MainBuffer: Error: RingBuffer does not exist");
return 0;
} else
return ringbuffer->AvailForGet (reader_id);
......@@ -548,7 +536,7 @@ void MainBuffer::flushAllBuffers()
void MainBuffer::stateInfo()
{
_debug ("MainBuffer state info");
_debug ("MainBuffer: State info");
CallIDMap::iterator iter_call = _callIDMap.begin();
......
......@@ -29,8 +29,6 @@
#include "../global.h"
#include "../call.h"
#include "ringbuffer.h"
#include "echocancel.h"
#include "algorithm.h"
......@@ -112,10 +110,6 @@ public:
int _internalSamplingRate;
EchoCancel *_echoCancel;
AudioProcessing *_audioProcessing;
public:
friend class MainBufferTest;
......
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