[asterisk-commits] file: branch group/media_formats r406635 - in /team/group/media_formats: incl...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 27 08:52:58 CST 2014


Author: file
Date: Mon Jan 27 08:52:55 2014
New Revision: 406635

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=406635
Log:
Flush out framing some more.

Modified:
    team/group/media_formats/include/asterisk/format_cap_ng.h
    team/group/media_formats/main/format_cap_ng.c

Modified: team/group/media_formats/include/asterisk/format_cap_ng.h
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats/include/asterisk/format_cap_ng.h?view=diff&rev=406635&r1=406634&r2=406635
==============================================================================
--- team/group/media_formats/include/asterisk/format_cap_ng.h (original)
+++ team/group/media_formats/include/asterisk/format_cap_ng.h Mon Jan 27 08:52:55 2014
@@ -50,10 +50,19 @@
 struct ast_format_cap *ast_format_cap_alloc(enum ast_format_cap_flags flags);
 
 /*!
+ * \brief Set the global framing.
+ *
+ * \param cap The capabilities structure.
+ * \param framing The framing value (in milliseconds).
+ */
+void ast_format_cap_set_framing(struct ast_format_cap *cap, unsigned int framing);
+
+/*!
  * \brief Add format capability to capabilities structure.
  *
  * \param cap The capabilities structure to add to.
  * \param format The format to add.
+ * \param framing The framing for the format (in milliseconds).
  *
  * \retval 0 success
  * \retval -1 failure
@@ -62,7 +71,7 @@
  *
  * \note The order in which add is called determines the format preference order.
  */
-int ast_format_cap_add(struct ast_format_cap *cap, struct ast_format *format);
+int ast_format_cap_add(struct ast_format_cap *cap, struct ast_format *format, unsigned int framing);
 
 /*!
  * \brief Add all codecs Asterisk knows about for a specific type to

Modified: team/group/media_formats/main/format_cap_ng.c
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats/main/format_cap_ng.c?view=diff&rev=406635&r1=406634&r2=406635
==============================================================================
--- team/group/media_formats/main/format_cap_ng.c (original)
+++ team/group/media_formats/main/format_cap_ng.c Mon Jan 27 08:52:55 2014
@@ -108,6 +108,11 @@
 	return cap;
 }
 
+void ast_format_cap_set_framing(struct ast_format_cap *cap, unsigned int framing)
+{
+	cap->framing = framing;
+}
+
 /*! \brief Destructor for format capabilities framed structure */
 static void format_cap_framed_destroy(void *obj)
 {
@@ -116,7 +121,7 @@
 	ao2_cleanup(framed->format);
 }
 
-int ast_format_cap_add(struct ast_format_cap *cap, struct ast_format *format)
+int ast_format_cap_add(struct ast_format_cap *cap, struct ast_format *format, unsigned int framing)
 {
 	struct format_cap_framed *framed;
 	struct format_cap_framed_list *list;
@@ -127,6 +132,7 @@
 	}
 
 	framed->format = ao2_bump(format);
+	framed->framing = framing;
 
 	if (format->codec->id >= cap->formats.current) {
 		if (AST_VECTOR_INSERT(&cap->formats, format->codec->id, format_cap_framed_list_empty)) {
@@ -158,7 +164,7 @@
 	for (idx = 0; (idx < AST_VECTOR_SIZE(&src->preference_order)) && !res; ++idx) {
 		struct format_cap_framed *framed = AST_VECTOR_GET(&src->preference_order, idx);
 
-		res = ast_format_cap_add(dst, framed->format);
+		res = ast_format_cap_add(dst, framed->format, framed->framing);
 	}
 
 	return res;
@@ -377,7 +383,7 @@
 			continue;
 		}
 
-		res = ast_format_cap_add(result, format);
+		res = ast_format_cap_add(result, format, framed->framing);
 		ao2_ref(format, -1);
 
 		if (res) {




More information about the asterisk-commits mailing list