Commit b021cff0 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#2165] Remove old call recording implementation

parent b702dea2
...@@ -29,13 +29,15 @@ ...@@ -29,13 +29,15 @@
*/ */
#include "audiorecorder.h" #include "audiorecorder.h"
#include "mainbuffer.h"
AudioRecorder::AudioRecorder (AudioRecord *arec) AudioRecorder::AudioRecorder (AudioRecord *arec, MainBuffer *mb)
: Thread(), recorderId("recorder_id") : Thread(), recorderId("recorder_id")
{ {
setCancel (cancelDeferred); setCancel (cancelDeferred);
arecord = arec; arecord = arec;
mbuffer = mb;
} }
...@@ -44,21 +46,27 @@ AudioRecorder::AudioRecorder (AudioRecord *arec) ...@@ -44,21 +46,27 @@ AudioRecorder::AudioRecorder (AudioRecord *arec)
*/ */
void AudioRecorder::run (void) void AudioRecorder::run (void)
{ {
/* SFLDataFormat buffer[10000];
while(true) { while(true) {
_debug("Audiorecord"); if(!mbuffer)
sleep(1); _warn("AudioRecorder: Error: No instance of ringbuffer");
} int availBytes = mbuffer->availForGet(recorderId);
*/
_debug("Audiorecord: avail for get (before) %d", availBytes);
// SFLDataFormat buffer[10000]; mbuffer->getData(buffer, availBytes, 100, recorderId);
// int availBytes = mbuffer->availForGet(recorderId); availBytes = mbuffer->availForGet(recorderId);
// mbuffer->getData(buffer, availBytes, 100, recorderId); _debug("Audiorecord: avail for get (after) %d", availBytes);
// arecord->recData(buffer, availBytes/sizeof(SFLDataFormat)); // arecord->recData(buffer, availBytes/sizeof(SFLDataFormat));
sleep(20);
}
} }
...@@ -40,7 +40,7 @@ class MainBuffer; ...@@ -40,7 +40,7 @@ class MainBuffer;
class AudioRecorder : public ost::Thread { class AudioRecorder : public ost::Thread {
public: public:
AudioRecorder(AudioRecord *arec); AudioRecorder(AudioRecord *arec, MainBuffer *mb);
~AudioRecorder(void){ terminate(); } ~AudioRecorder(void){ terminate(); }
......
...@@ -815,6 +815,8 @@ namespace sfl { ...@@ -815,6 +815,8 @@ namespace sfl {
// Recv session // Recv session
receiveSpeakerData (); receiveSpeakerData ();
/*
// Let's wait for the next transmit cycle // Let's wait for the next transmit cycle
if (sessionWaiting == 1) { if (sessionWaiting == 1) {
// Record mic and speaker during conversation // Record mic and speaker during conversation
...@@ -823,6 +825,7 @@ namespace sfl { ...@@ -823,6 +825,7 @@ namespace sfl {
// Record mic only while leaving a message // Record mic only while leaving a message
_ca->recAudio.recData (_micData,_nSamplesMic); _ca->recAudio.recData (_micData,_nSamplesMic);
} }
*/
_manager->getAudioLayerMutex()->leave(); _manager->getAudioLayerMutex()->leave();
......
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