Changeset 1332:71e753387e4c in mediastreamer2
- Timestamp:
- Mar 30, 2011 5:42:41 PM (2 years ago)
- Branch:
- default
- Files:
-
- 2 edited
-
include/mediastreamer2/msinterfaces.h (modified) (2 diffs)
-
src/speexec.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
include/mediastreamer2/msinterfaces.h
r1276 r1332 101 101 MS_FILTER_METHOD(MSFilterEchoCancellerInterface,2,int) 102 102 103 104 /** Interface definitions for video decoders */105 #define MS_VIDEO_DECODER_DECODING_ERRORS \106 MS_FILTER_EVENT_NO_ARG(MSFilterVideoDecoderInterface,0)107 108 103 /** put filter in bypass mode */ 109 104 #define MS_ECHO_CANCELLER_SET_BYPASS_MODE \ … … 112 107 #define MS_ECHO_CANCELLER_GET_BYPASS_MODE \ 113 108 MS_FILTER_METHOD(MSFilterEchoCancellerInterface,4,bool_t) 109 110 111 112 /** Interface definitions for video decoders */ 113 #define MS_VIDEO_DECODER_DECODING_ERRORS \ 114 MS_FILTER_EVENT_NO_ARG(MSFilterVideoDecoderInterface,0) 114 115 #endif 115 116 -
src/speexec.c
r1331 r1332 33 33 34 34 //#define EC_DUMP 1 35 35 #ifdef ANDROID 36 36 #define EC_DUMP_PREFIX "/sdcard" 37 #else 38 #define EC_DUMP_PREFIX "/dynamic/tests" 39 #endif 37 40 38 41 static const float smooth_factor=0.05; … … 55 58 FILE *echofile; 56 59 FILE *reffile; 60 FILE *cleanfile; 57 61 #endif 58 62 bool_t echostarted; … … 84 88 s->reffile=fopen(fname,"w"); 85 89 ms_free(fname); 90 fname=ms_strdup_printf("%s/msspeexec-%p-clean.raw", EC_DUMP_PREFIX,f); 91 s->cleanfile=fopen(fname,"w"); 92 ms_free(fname); 86 93 } 87 94 #endif … … 123 130 ms_bufferizer_put (&s->delayed_ref,m); 124 131 s->min_ref_samples=-1; 132 s->nominal_ref_samples=delay_samples; 125 133 } 126 134 … … 194 202 speex_echo_cancellation(s->ecstate,(short*)echo,(short*)ref,(short*)oecho->b_wptr); 195 203 speex_preprocess_run(s->den, (short*)oecho->b_wptr); 204 #ifdef EC_DUMP 205 if (s->cleanfile) 206 fwrite(oecho->b_wptr,nbytes,1,s->cleanfile); 207 #endif 196 208 oecho->b_wptr+=nbytes; 197 209 ms_queue_put(f->outputs[1],oecho); … … 202 214 int diff=s->min_ref_samples-s->nominal_ref_samples; 203 215 if (diff>nbytes){ 204 ms_warning("echo canceller: we are accumulating too much reference signal, purging now %i bytes",nbytes); 205 ms_bufferizer_skip_bytes(&s->delayed_ref,nbytes); 216 int purge=diff-(nbytes/2); 217 ms_warning("echo canceller: we are accumulating too much reference signal, purging now %i bytes",purge); 218 ms_bufferizer_skip_bytes(&s->delayed_ref,purge); 206 219 } 207 220 s->min_ref_samples=-1; … … 262 275 { MS_ECHO_CANCELLER_SET_TAIL_LENGTH , speex_ec_set_tail_length }, 263 276 { MS_ECHO_CANCELLER_SET_DELAY , speex_ec_set_delay }, 264 { MS_ECHO_CANCELLER_SET_FRAMESIZE , speex_ec_set_framesize },277 { MS_ECHO_CANCELLER_SET_FRAMESIZE , speex_ec_set_framesize }, 265 278 { MS_ECHO_CANCELLER_SET_BYPASS_MODE , speex_ec_set_bypass_mode }, 266 279 { MS_ECHO_CANCELLER_GET_BYPASS_MODE , speex_ec_get_bypass_mode },
Note: See TracChangeset
for help on using the changeset viewer.
