[asterisk-commits] file: branch group/media_formats r407983 - /team/group/media_formats/bridges/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 12 06:36:30 CST 2014


Author: file
Date: Wed Feb 12 06:36:26 2014
New Revision: 407983

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=407983
Log:
And two bridging modules get moved over...

Modified:
    team/group/media_formats/bridges/bridge_holding.c
    team/group/media_formats/bridges/bridge_simple.c

Modified: team/group/media_formats/bridges/bridge_holding.c
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats/bridges/bridge_holding.c?view=diff&rev=407983&r1=407982&r2=407983
==============================================================================
--- team/group/media_formats/bridges/bridge_holding.c (original)
+++ team/group/media_formats/bridges/bridge_holding.c Wed Feb 12 06:36:26 2014
@@ -48,6 +48,7 @@
 #include "asterisk/bridge_technology.h"
 #include "asterisk/frame.h"
 #include "asterisk/musiconhold.h"
+#include "asterisk/format_cache.h"
 
 enum holding_roles {
 	HOLDING_ROLE_PARTICIPANT,
@@ -180,7 +181,7 @@
 
 	chan = bridge_channel->chan;
 	participant_entertainment_stop(bridge_channel);
-	if (ast_set_write_format_by_id(chan, AST_FORMAT_SLINEAR)) {
+	if (ast_set_write_format(chan, ast_format_slin)) {
 		ast_log(LOG_WARNING, "Could not make participant %s compatible.\n", ast_channel_name(chan));
 	}
 }
@@ -233,7 +234,7 @@
 	}
 
 	/* We need to get compatible with the announcer. */
-	if (ast_set_write_format_by_id(us, AST_FORMAT_SLINEAR)) {
+	if (ast_set_write_format(us, ast_format_slin)) {
 		ast_log(LOG_WARNING, "Could not make participant %s compatible.\n", ast_channel_name(us));
 	}
 }
@@ -270,7 +271,7 @@
 		hc->role = HOLDING_ROLE_ANNOUNCER;
 
 		/* The announcer should always be made compatible with signed linear */
-		if (ast_set_read_format_by_id(us, AST_FORMAT_SLINEAR)) {
+		if (ast_set_read_format(us, ast_format_slin)) {
 			ast_log(LOG_ERROR, "Could not make announcer %s compatible.\n", ast_channel_name(us));
 		}
 
@@ -427,18 +428,19 @@
 
 static int unload_module(void)
 {
-	ast_format_cap_destroy(holding_bridge.format_capabilities);
+	ao2_cleanup(holding_bridge.format_capabilities);
+	holding_bridge.format_capabilities = NULL;
 	return ast_bridge_technology_unregister(&holding_bridge);
 }
 
 static int load_module(void)
 {
-	if (!(holding_bridge.format_capabilities = ast_format_cap_alloc(0))) {
+	if (!(holding_bridge.format_capabilities = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT))) {
 		return AST_MODULE_LOAD_DECLINE;
 	}
-	ast_format_cap_add_all_by_type(holding_bridge.format_capabilities, AST_FORMAT_TYPE_AUDIO);
-	ast_format_cap_add_all_by_type(holding_bridge.format_capabilities, AST_FORMAT_TYPE_VIDEO);
-	ast_format_cap_add_all_by_type(holding_bridge.format_capabilities, AST_FORMAT_TYPE_TEXT);
+	ast_format_cap_add_all_by_type(holding_bridge.format_capabilities, AST_MEDIA_TYPE_AUDIO);
+	ast_format_cap_add_all_by_type(holding_bridge.format_capabilities, AST_MEDIA_TYPE_VIDEO);
+	ast_format_cap_add_all_by_type(holding_bridge.format_capabilities, AST_MEDIA_TYPE_TEXT);
 
 	return ast_bridge_technology_register(&holding_bridge);
 }

Modified: team/group/media_formats/bridges/bridge_simple.c
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats/bridges/bridge_simple.c?view=diff&rev=407983&r1=407982&r2=407983
==============================================================================
--- team/group/media_formats/bridges/bridge_simple.c (original)
+++ team/group/media_formats/bridges/bridge_simple.c Wed Feb 12 06:36:26 2014
@@ -76,18 +76,19 @@
 
 static int unload_module(void)
 {
-	ast_format_cap_destroy(simple_bridge.format_capabilities);
+	ao2_cleanup(simple_bridge.format_capabilities);
+	simple_bridge.format_capabilities = NULL;
 	return ast_bridge_technology_unregister(&simple_bridge);
 }
 
 static int load_module(void)
 {
-	if (!(simple_bridge.format_capabilities = ast_format_cap_alloc(0))) {
+	if (!(simple_bridge.format_capabilities = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT))) {
 		return AST_MODULE_LOAD_DECLINE;
 	}
-	ast_format_cap_add_all_by_type(simple_bridge.format_capabilities, AST_FORMAT_TYPE_AUDIO);
-	ast_format_cap_add_all_by_type(simple_bridge.format_capabilities, AST_FORMAT_TYPE_VIDEO);
-	ast_format_cap_add_all_by_type(simple_bridge.format_capabilities, AST_FORMAT_TYPE_TEXT);
+	ast_format_cap_add_all_by_type(simple_bridge.format_capabilities, AST_MEDIA_TYPE_AUDIO);
+	ast_format_cap_add_all_by_type(simple_bridge.format_capabilities, AST_MEDIA_TYPE_VIDEO);
+	ast_format_cap_add_all_by_type(simple_bridge.format_capabilities, AST_MEDIA_TYPE_TEXT);
 
 	return ast_bridge_technology_register(&simple_bridge);
 }




More information about the asterisk-commits mailing list