Skip to content
Snippets Groups Projects
Commit ac78a213 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#1933] Get rid of getMicAvail and getMicData in audiolayer (not used anymore)

parent 7d4a0beb
Branches
Tags
No related merge requests found
......@@ -199,56 +199,9 @@ AlsaLayer::stopStream (void)
/* Flush the ring buffers */
flushUrgent ();
flushMain ();
flushMic ();
}
int
AlsaLayer::canGetMic()
{
/*
int avail;
if (!_CaptureHandle)
return 0;
avail = snd_pcm_avail_update (_CaptureHandle);
if (avail == -EPIPE) {
stop_capture ();
return 0;
} else
return ( (avail<0) ?0:avail);
if(_CaptureHandle)
return _micRingBuffer.AvailForGet();
else
return 0;*/
return 0;
}
int
AlsaLayer::getMic (void *buffer, int toCopy)
{
/*
if( _CaptureHandle ){
return _micRingBuffer.Get(buffer, toCopy,100);
}
else
return 0;
int res = 0;
if (_CaptureHandle) {
res = read (buffer, toCopy);
adjustVolume (buffer, toCopy, SFL_PCM_CAPTURE);
}
return res;*/
return 0;
}
bool AlsaLayer::isCaptureActive (void)
{
......
......@@ -27,17 +27,13 @@ void AudioLayer::flushMain (void)
getMainBuffer()->flushAllBuffers();
}
void AudioLayer::flushUrgent (void)
{
ost::MutexLock guard (_mutex);
_urgentRingBuffer.flushAll();
}
void AudioLayer::flushMic (void)
{
ost::MutexLock guard (_mutex);
getMainBuffer()->flushDefault();
}
int AudioLayer::putUrgent (void* buffer, int toCopy)
{
......
......@@ -109,20 +109,6 @@ class AudioLayer {
*/
virtual void stopStream(void) = 0;
/**
* Query the capture device for number of bytes available in the hardware ring buffer
* @return int The number of bytes available
*/
virtual int canGetMic() = 0;
/**
* Get data from the capture device
* @param buffer The buffer for data
* @param toCopy The number of bytes to get
* @return int The number of bytes acquired ( 0 if an error occured)
*/
virtual int getMic(void * buffer, int toCopy) = 0;
/**
* Send a chunk of data to the hardware buffer to start the playback
* Copy data in the urgent buffer.
......@@ -144,10 +130,6 @@ class AudioLayer {
void flushUrgent (void);
/**
* Flush the mic ringbuffer
*/
void flushMic();
virtual bool isCaptureActive (void) = 0;
......
......@@ -54,7 +54,7 @@ RingBuffer::~RingBuffer()
void
RingBuffer::flush (CallID call_id)
{
_debug("flush: call_id on iax\n");
_debug("flush: reinit \"%s\" readpointer in \"%s\" ringbuffer\n", call_id.c_str(), buffer_id.c_str());
storeReadPointer(mEnd, call_id);
}
......@@ -62,6 +62,7 @@ RingBuffer::flush (CallID call_id)
void
RingBuffer::flushAll ()
{
// _debug("flushall: reinit all readpointer in \"%s\" ringbuffer\n", buffer_id.c_str());
ReadPointer::iterator iter_pointer = _readpointer.begin();
while(iter_pointer != _readpointer.end())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment