Changeset 357:54cd98ca13fd in mediastreamer2
- Timestamp:
- Mar 24, 2009 9:28:34 PM (4 years ago)
- Branch:
- default
- Location:
- linphone
- Files:
-
- 3 edited
-
coreapi/linphonecore.c (modified) (2 diffs)
-
mediastreamer2/include/mediastreamer2/mediastream.h (modified) (3 diffs)
-
mediastreamer2/src/audiostream.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
linphone/coreapi/linphonecore.c
r355 r357 1415 1415 lc->audiostream=audio_stream_new(linphone_core_get_audio_port(lc),linphone_core_ipv6_enabled(lc)); 1416 1416 if (linphone_core_echo_limiter_enabled(lc)){ 1417 audio_stream_enable_echo_limiter(lc->audiostream,TRUE); 1417 const char * type=lp_config_get_string(lc->config,"sound","el_type","mic"); 1418 if (strcasecmp(type,"mic")==0) 1419 audio_stream_enable_echo_limiter(lc->audiostream,ELControlMic); 1420 else if (strcasecmp(type,"speaker")==0) 1421 audio_stream_enable_echo_limiter(lc->audiostream,ELControlSpeaker); 1418 1422 } 1419 1423 #ifdef VIDEO_ENABLED … … 1436 1440 float speed=lp_config_get_float(lc->config,"sound","el_speed",-1); 1437 1441 float thres=lp_config_get_float(lc->config,"sound","el_thres",-1); 1442 MSFilter *f; 1443 if (st->el_type==ELControlMic) 1444 f=st->volrecv; 1445 else f=st->volsend; 1438 1446 if (speed!=-1) 1439 ms_filter_call_method( st->volrecv,MS_VOLUME_SET_EA_SPEED,&speed);1447 ms_filter_call_method(f,MS_VOLUME_SET_EA_SPEED,&speed); 1440 1448 if (thres!=-1) 1441 ms_filter_call_method( st->volrecv,MS_VOLUME_SET_EA_THRESHOLD,&thres);1449 ms_filter_call_method(f,MS_VOLUME_SET_EA_THRESHOLD,&thres); 1442 1450 } 1443 1451 if (lc->vtable.dtmf_received!=NULL){ -
linphone/mediastreamer2/include/mediastreamer2/mediastream.h
r354 r357 30 30 #include "ortp/event.h" 31 31 32 typedef enum EchoLimiterType{ 33 ELInactive, 34 ELControlMic, 35 ELControlSpeaker 36 } EchoLimiterType; 37 32 38 struct _AudioStream 33 39 { … … 45 51 unsigned int last_packet_count; 46 52 time_t last_packet_time; 53 EchoLimiterType el_type; /*use echo limiter: two MSVolume, measured input level controlling local output level*/ 47 54 bool_t play_dtmfs; 48 bool_t use_ea; /*use echo limiter: two MSVolume, measured input level controlling local output level*/49 55 }; 50 56 … … 94 100 95 101 /*enable echo-limiter dispositve: one MSVolume in input branch controls a MSVolume in the output branch*/ 96 void audio_stream_enable_echo_limiter(AudioStream *stream, bool_t enabled);102 void audio_stream_enable_echo_limiter(AudioStream *stream, EchoLimiterType type); 97 103 98 104 /* stop the above process*/ -
linphone/mediastreamer2/src/audiostream.c
r354 r357 248 248 } 249 249 250 if (stream-> use_ea){250 if (stream->el_type!=ELInactive){ 251 251 stream->volsend=ms_filter_new(MS_VOLUME_ID); 252 252 stream->volrecv=ms_filter_new(MS_VOLUME_ID); 253 ms_filter_call_method(stream->volrecv,MS_VOLUME_SET_PEER,stream->volsend); 253 if (stream->el_type==ELControlSpeaker) 254 ms_filter_call_method(stream->volrecv,MS_VOLUME_SET_PEER,stream->volsend); 255 else ms_filter_call_method(stream->volsend,MS_VOLUME_SET_PEER,stream->volrecv); 254 256 } 255 257 … … 394 396 } 395 397 396 void audio_stream_enable_echo_limiter(AudioStream *stream, bool_t enabled){397 stream-> use_ea=enabled;398 void audio_stream_enable_echo_limiter(AudioStream *stream, EchoLimiterType type){ 399 stream->el_type=type; 398 400 } 399 401
Note: See TracChangeset
for help on using the changeset viewer.
