Skip to content
Snippets Groups Projects
Commit 382883bb authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Clean up

parent eab073e1
No related branches found
No related tags found
No related merge requests found
...@@ -599,7 +599,9 @@ GtkWidget* codecs_box() ...@@ -599,7 +599,9 @@ GtkWidget* codecs_box()
void void
select_audio_manager( void ) select_audio_manager( void )
{ {
g_print("audio manager selected\n"); g_print("audio manager selected\n");
if( !SHOW_ALSA_CONF && !gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(pulse) ) ) if( !SHOW_ALSA_CONF && !gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(pulse) ) )
{ {
g_print(" display alsa conf panel\n"); g_print(" display alsa conf panel\n");
......
This diff is collapsed.
...@@ -466,11 +466,6 @@ AlsaLayer::read( void* buffer, int toCopy) ...@@ -466,11 +466,6 @@ AlsaLayer::read( void* buffer, int toCopy)
} }
int
AlsaLayer::putMain(void* buffer, int toCopy)
{}
int int
AlsaLayer::putInCache( char code, void *buffer, int toCopy ) AlsaLayer::putInCache( char code, void *buffer, int toCopy )
{} {}
......
...@@ -186,10 +186,6 @@ class AlsaLayer : public AudioLayer { ...@@ -186,10 +186,6 @@ class AlsaLayer : public AudioLayer {
*/ */
int putInCache( char code, void *buffer, int toCopy ); int putInCache( char code, void *buffer, int toCopy );
/**
* UNUSED in ALSA layer
*/
int putMain(void* buffer, int toCopy);
/** /**
* UNUSED in ALSA layer * UNUSED in ALSA layer
......
...@@ -99,12 +99,6 @@ class AudioLayer { ...@@ -99,12 +99,6 @@ class AudioLayer {
*/ */
virtual void stopStream(void) = 0; virtual void stopStream(void) = 0;
/**
* Check if both capture and playback are running
* @return true if capture and playback are running
* false otherwise
*/
virtual bool isStreamActive(void) = 0;
/** /**
* Check if the capture is running * Check if the capture is running
...@@ -131,7 +125,6 @@ class AudioLayer { ...@@ -131,7 +125,6 @@ class AudioLayer {
*/ */
virtual int putUrgent(void* buffer, int toCopy) = 0; virtual int putUrgent(void* buffer, int toCopy) = 0;
virtual int putMain( void* buffer, int toCopy) = 0;
virtual int putInCache(char code, void* buffer, int toCopy) = 0; virtual int putInCache(char code, void* buffer, int toCopy) = 0;
/** /**
......
...@@ -337,12 +337,8 @@ AudioRtpRTX::receiveSessionForSpkr (int& countTime) ...@@ -337,12 +337,8 @@ AudioRtpRTX::receiveSessionForSpkr (int& countTime)
#else #else
#endif #endif
int layer = audiolayer->getLayerType();
//_debug(" interface %i - ALSA = %i\n" , layer, ALSA);
if( CHECK_INTERFACE( layer, ALSA ) )
audiolayer->playSamples( spkrDataConverted, nbSample * sizeof(SFLDataFormat), true); audiolayer->playSamples( spkrDataConverted, nbSample * sizeof(SFLDataFormat), true);
else
audiolayer->putMain( spkrDataConverted, nbSample * sizeof(SFLDataFormat) );
// Notify (with a beep) an incoming call when there is already a call // Notify (with a beep) an incoming call when there is already a call
countTime += time->getSecond(); countTime += time->getSecond();
if (Manager::instance().incomingCallWaiting() > 0) { if (Manager::instance().incomingCallWaiting() > 0) {
......
...@@ -47,6 +47,7 @@ AudioStream::disconnect( void ) ...@@ -47,6 +47,7 @@ AudioStream::disconnect( void )
{ {
_debug("Destroy audio streams\n"); _debug("Destroy audio streams\n");
pa_stream_disconnect( pulseStream() ); pa_stream_disconnect( pulseStream() );
pa_stream_unref( pulseStream() );
} }
void void
...@@ -74,7 +75,6 @@ AudioStream::stream_state_callback( pa_stream* s, void* user_data ) ...@@ -74,7 +75,6 @@ AudioStream::stream_state_callback( pa_stream* s, void* user_data )
pa_stream* pa_stream*
AudioStream::createStream( pa_context* c ) AudioStream::createStream( pa_context* c )
{ {
_debug("Creating %s stream...\n" , _streamDescription.c_str());
pa_stream* s; pa_stream* s;
pa_cvolume cv; pa_cvolume cv;
...@@ -88,14 +88,14 @@ AudioStream::createStream( pa_context* c ) ...@@ -88,14 +88,14 @@ AudioStream::createStream( pa_context* c )
if( _streamType == PLAYBACK_STREAM ){ if( _streamType == PLAYBACK_STREAM ){
pa_buffer_attr* attributes; pa_buffer_attr* attributes;
attributes->maxlength = 66500; //attributes->maxlength = 66500;
attributes->tlength = 44100; //attributes->tlength = 44100;
attributes->prebuf = 10000; //attributes->prebuf = 10000;
attributes->minreq = 882; //attributes->minreq = 882;
pa_stream_connect_playback( s , NULL , attributes , pa_stream_connect_playback( s , NULL , NULL ,
PA_STREAM_INTERPOLATE_TIMING, PA_STREAM_INTERPOLATE_TIMING,
&_volume, NULL); &_volume, NULL);
//pa_cvolume_set(&cv, sample_spec.channels , _volume) , NULL ); //pa_cvolume_set(&cv, sample_spec.channels , PA_VOLUME_NORM) , NULL );
} }
else if( _streamType == CAPTURE_STREAM ){ else if( _streamType == CAPTURE_STREAM ){
pa_stream_connect_record( s , NULL , NULL , PA_STREAM_START_CORKED ); pa_stream_connect_record( s , NULL , NULL , PA_STREAM_START_CORKED );
......
...@@ -37,6 +37,7 @@ PulseLayer::~PulseLayer (void) ...@@ -37,6 +37,7 @@ PulseLayer::~PulseLayer (void)
delete playback; delete playback;
delete record; delete record;
pa_context_disconnect(context); pa_context_disconnect(context);
pa_context_unref( context );
} }
void void
...@@ -45,6 +46,7 @@ PulseLayer::closeLayer( void ) ...@@ -45,6 +46,7 @@ PulseLayer::closeLayer( void )
playback->disconnect(); playback->disconnect();
record->disconnect(); record->disconnect();
pa_context_disconnect( context ); pa_context_disconnect( context );
pa_context_unref( context );
} }
void void
...@@ -160,11 +162,6 @@ PulseLayer::closePlaybackStream( void ) ...@@ -160,11 +162,6 @@ PulseLayer::closePlaybackStream( void )
int int
PulseLayer::playSamples(void* buffer, int toCopy, bool isTalking) PulseLayer::playSamples(void* buffer, int toCopy, bool isTalking)
{
}
int
PulseLayer::putMain(void* buffer, int toCopy)
{ {
int a = _mainSndRingBuffer.AvailForPut(); int a = _mainSndRingBuffer.AvailForPut();
if ( a >= toCopy ) { if ( a >= toCopy ) {
...@@ -238,11 +235,6 @@ PulseLayer::stopStream (void) ...@@ -238,11 +235,6 @@ PulseLayer::stopStream (void)
flushMic(); flushMic();
} }
bool
PulseLayer::isStreamActive (void)
{
}
void void
PulseLayer::audioCallback ( pa_stream* s, size_t bytes, void* userdata ) PulseLayer::audioCallback ( pa_stream* s, size_t bytes, void* userdata )
{ {
......
...@@ -70,8 +70,6 @@ class PulseLayer : public AudioLayer { ...@@ -70,8 +70,6 @@ class PulseLayer : public AudioLayer {
*/ */
void flushMain(); void flushMain();
int putMain(void* buffer, int toCopy);
int putUrgent(void* buffer, int toCopy); int putUrgent(void* buffer, int toCopy);
/** /**
......
...@@ -201,11 +201,9 @@ IAXVoIPLink::getEvent() ...@@ -201,11 +201,9 @@ IAXVoIPLink::getEvent()
} }
_mutexIAX.leaveMutex(); _mutexIAX.leaveMutex();
// Do the doodle-moodle to send audio from the microphone to the IAX channel. // Do the doodle-moodle to send audio from the microphone to the IAX channel.
sendAudioFromMic(); sendAudioFromMic();
// Refresh registration. // Refresh registration.
if (_nextRefreshStamp && _nextRefreshStamp - 2 < time(NULL)) { if (_nextRefreshStamp && _nextRefreshStamp - 2 < time(NULL)) {
sendRegister(); sendRegister();
...@@ -622,7 +620,7 @@ IAXVoIPLink::iaxHandleCallEvent(iax_event* event, IAXCall* call) ...@@ -622,7 +620,7 @@ IAXVoIPLink::iaxHandleCallEvent(iax_event* event, IAXCall* call)
Manager::instance().peerAnsweredCall(id); Manager::instance().peerAnsweredCall(id);
//audiolayer->flushMic(); //audiolayer->flushMic();
audiolayer->startStream(); //audiolayer->startStream();
// start audio here? // start audio here?
} else { } else {
// deja connecté ? // deja connecté ?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment