[asterisk-commits] dvossel: branch dvossel/hd_confbridge r310285 - in /team/dvossel/hd_confbridg...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Mar 10 15:10:36 CST 2011


Author: dvossel
Date: Thu Mar 10 15:10:32 2011
New Revision: 310285

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=310285
Log:
Killing the drop_silence option

Better ways of optimizing are being used now

Modified:
    team/dvossel/hd_confbridge/apps/app_confbridge.c
    team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c
    team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h
    team/dvossel/hd_confbridge/configs/confbridge.conf.sample
    team/dvossel/hd_confbridge/main/bridging.c

Modified: team/dvossel/hd_confbridge/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/apps/app_confbridge.c?view=diff&rev=310285&r1=310284&r2=310285
==============================================================================
--- team/dvossel/hd_confbridge/apps/app_confbridge.c (original)
+++ team/dvossel/hd_confbridge/apps/app_confbridge.c Thu Mar 10 15:10:32 2011
@@ -623,10 +623,6 @@
 			ast_free(mod_speex);
 			ast_func_write(chan, "DENOISE(rx)", "on");
 		}
-	}
-
-	if (conference_bridge_user.u_profile.drop_silence) {
-		conference_bridge_user.features.detect_silence = conference_bridge_user.u_profile.drop_silence;
 	}
 
 	/* Grab join/leave sounds from the channel */

Modified: team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c?view=diff&rev=310285&r1=310284&r2=310285
==============================================================================
--- team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c (original)
+++ team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c Thu Mar 10 15:10:32 2011
@@ -35,8 +35,6 @@
 
 #define CONF_CONFIG "confbridge.conf"
 
-#define DEFAULT_SILENCE_THRESHOLD 3000  /* ms of silence before audio is dropped from mixing */
-
 static struct ao2_container *user_profiles;
 static struct ao2_container *bridge_profiles;
 static struct ao2_container *menus;
@@ -186,7 +184,6 @@
 	ao2_lock(u_profile);
 	/* set defaults */
 	u_profile->flags = 0;
-	u_profile->drop_silence = 0;
 	for (var = ast_variable_browse(cfg, cat); var; var = var->next) {
 		if (!strcasecmp(var->name, "type")) {
 			continue;
@@ -222,15 +219,6 @@
 			u_profile->flags = ast_true(var->value) ?
 				u_profile->flags | USER_OPT_WAITMARKED :
 				u_profile->flags & ~USER_OPT_WAITMARKED;
-		} else if (!strcasecmp(var->name, "drop_silence")) {
-			if (ast_true(var->value)) {
-				u_profile->drop_silence = DEFAULT_SILENCE_THRESHOLD;
-			} else if (ast_false(var->value)) {
-				u_profile->drop_silence = 0;
-			} else if (sscanf(var->value, "%30u", &u_profile->drop_silence) != 1) {
-				ast_log(LOG_WARNING, "drop_silence '%s' at line %d of %s is not supported.\n",
-						var->value, var->lineno, CONF_CONFIG);
-			}
 		} else if (!strcasecmp(var->name, "denoise")) {
 			u_profile->flags = ast_true(var->value) ?
 				u_profile->flags | USER_OPT_DENOISE :
@@ -437,12 +425,6 @@
 	ast_cli(a->fd,"Denoise:             %s\n",
 		u_profile.flags & USER_OPT_DENOISE ?
 		"enabled" : "disabled");
-	if (u_profile.drop_silence) {
-		ast_cli(a->fd,"Drop Silence:        %dms\n",
-			u_profile.drop_silence);
-	} else {
-		ast_cli(a->fd,"Drop Silence:        disabled\n");
-	}
 	ast_cli(a->fd,"\n");
 
 	return CLI_SUCCESS;

Modified: team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h?view=diff&rev=310285&r1=310284&r2=310285
==============================================================================
--- team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h (original)
+++ team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h Thu Mar 10 15:10:32 2011
@@ -86,7 +86,6 @@
 struct user_profile {
 	char name[64];
 	unsigned int flags;
-	unsigned int drop_silence; /*!< Number of ms of silence before dropping audio. If 0, never drop silence. */
 	int delme;
 };
 

Modified: team/dvossel/hd_confbridge/configs/confbridge.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/configs/confbridge.conf.sample?view=diff&rev=310285&r1=310284&r2=310285
==============================================================================
--- team/dvossel/hd_confbridge/configs/confbridge.conf.sample (original)
+++ team/dvossel/hd_confbridge/configs/confbridge.conf.sample Thu Mar 10 15:10:32 2011
@@ -22,17 +22,6 @@
                           ; when a channel enters a empty conference.  On by default.
 ;wait_marked=yes   ; Sets if the user must wait for a marked user to enter before
                    ; joining the conference. Off by default
-drop_silence=yes       ; Sets if a channel's audio should be dropped from mixing
-                       ; after a certain number of milliseconds of silence is detected.
-                       ; Once the user begins talking audio will enter back into
-                       ; the bridge.  This option will improve the performance
-                       ; of the conference bridge when large numbers of people are present.
-                       ; By default this option is off.  When set to yes, audio will
-                       ; be dropped from conference bridge mixing after 3000 milliseconds
-                       ; (3 seconds) of silence is detected.  The number of 
-                       ; milliseconds can be configured as well by assigning
-                       ; this option the number of milliseconds to wait before detecting 
-                       ; silence instead of yes/no.
 ;denoise=yes ; Sets whether or not a denoise filter should be applied
              ; to the audio before mixing or not.  Off by default. Requires
              ; codec_speex to be built and installed.

Modified: team/dvossel/hd_confbridge/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/main/bridging.c?view=diff&rev=310285&r1=310284&r2=310285
==============================================================================
--- team/dvossel/hd_confbridge/main/bridging.c (original)
+++ team/dvossel/hd_confbridge/main/bridging.c Thu Mar 10 15:10:32 2011
@@ -273,48 +273,6 @@
 	}
 }
 
-/*!
- * \internal
- *
- * \brief This function places itself in the middle of the channel's read audio
- * path to allow the bridge to perform preprocessing audio features before
- * the bridging technology see's the frame.
- *
- * \note This function expects the frame to be in slinear format.
- * \note 
- *
- * \retval frame after preprocessing is complete.
- */
-static struct ast_frame *bridge_channel_preprocess_read_audio(struct ast_bridge_channel *bridge_channel, struct ast_frame *frame)
-{
-	int detect_silence = MAX(bridge_channel->bridge->features.detect_silence, (bridge_channel->features ? bridge_channel->features->detect_silence : 0));
-
-	if (detect_silence) {
-		int totalsilence = 0;
-		/* make sure we have a dsp for the correct sample rate. A change in sample rate in a
-		 * single direction does not happen often, but our DSP needs to be made aware of such a change. */
-		if (bridge_channel->dsp &&
-			(ast_dsp_get_sample_rate(bridge_channel->dsp) != ast_format_rate(&frame->subclass.format))) {
-
-			ast_dsp_free(bridge_channel->dsp);
-			bridge_channel->dsp = NULL;
-		}
-		if (!bridge_channel->dsp && !(bridge_channel->dsp = ast_dsp_new_with_rate(ast_format_rate(&frame->subclass.format)))) {
-			return frame;
-		}
-
-		/* if silence is detected and the total is above the threshold, drop the audio */
-		if (ast_dsp_silence(bridge_channel->dsp, frame, &totalsilence) &&
-			(totalsilence > detect_silence)) {
-
-			ast_frfree(frame);
-			return &ast_null_frame;
-		}
-	}
-
-	return frame;
-}
-
 void ast_bridge_handle_trip(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, struct ast_channel *chan, int outfd)
 {
 	/* If no bridge channel has been provided and the actual channel has been provided find it */
@@ -335,8 +293,6 @@
 		} else {
 			if (frame->frametype == AST_FRAME_DTMF_BEGIN) {
 				frame = bridge_handle_dtmf(bridge, bridge_channel, frame);
-			} else if (frame->frametype == AST_FRAME_VOICE && ast_format_is_slinear(&frame->subclass.format)) {
-				frame = bridge_channel_preprocess_read_audio(bridge_channel, frame);
 			}
 			/* Simply write the frame out to the bridge technology if it still exists */
 			if (frame) {




More information about the asterisk-commits mailing list