[asterisk-commits] file: branch file/media_formats-impl r410156 - in /team/file/media_formats-im...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Mar 7 09:06:02 CST 2014
Author: file
Date: Fri Mar 7 09:05:49 2014
New Revision: 410156
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=410156
Log:
Move stuff into place and remove _ng from new API.
Added:
team/file/media_formats-impl/include/asterisk/format.h
- copied, changed from r409286, team/file/media_formats-impl/include/asterisk/format_ng.h
team/file/media_formats-impl/include/asterisk/format_cap.h
- copied, changed from r409286, team/file/media_formats-impl/include/asterisk/format_cap_ng.h
team/file/media_formats-impl/main/format.c
- copied, changed from r409286, team/file/media_formats-impl/main/format_ng.c
team/file/media_formats-impl/main/format_cap.c
- copied, changed from r409286, team/file/media_formats-impl/main/format_cap_ng.c
Removed:
team/file/media_formats-impl/include/asterisk/format_cap_ng.h
team/file/media_formats-impl/include/asterisk/format_ng.h
team/file/media_formats-impl/main/format_cap_ng.c
team/file/media_formats-impl/main/format_ng.c
Modified:
team/file/media_formats-impl/tests/test_core_format.c
team/file/media_formats-impl/tests/test_format_cache.c
team/file/media_formats-impl/tests/test_format_cap.c
Copied: team/file/media_formats-impl/include/asterisk/format.h (from r409286, team/file/media_formats-impl/include/asterisk/format_ng.h)
URL: http://svnview.digium.com/svn/asterisk/team/file/media_formats-impl/include/asterisk/format.h?view=diff&rev=410156&p1=team/file/media_formats-impl/include/asterisk/format_ng.h&r1=409286&p2=team/file/media_formats-impl/include/asterisk/format.h&r2=410156
==============================================================================
--- team/file/media_formats-impl/include/asterisk/format_ng.h (original)
+++ team/file/media_formats-impl/include/asterisk/format.h Fri Mar 7 09:05:49 2014
@@ -128,14 +128,14 @@
* \note The format is returned with reference count incremented. It must be released using
* ao2_ref or ao2_cleanup.
*/
-struct ast_format *ast_format_ng_create(struct ast_codec *codec);
+struct ast_format *ast_format_create(struct ast_codec *codec);
/*!
* \brief Compare two formats
*
* \retval ast_format_cmp_res representing the result of comparing format1 and format2.
*/
-enum ast_format_cmp_res ast_format_ng_cmp(const struct ast_format *format1, const struct ast_format *format2);
+enum ast_format_cmp_res ast_format_cmp(const struct ast_format *format1, const struct ast_format *format2);
/*1
* \brief Get a common joint capability between two formats
@@ -145,14 +145,14 @@
*
* \note The returned format must be treated as immutable.
*/
-struct ast_format *ast_format_ng_joint(const struct ast_format *format1, const struct ast_format *format2);
+struct ast_format *ast_format_joint(const struct ast_format *format1, const struct ast_format *format2);
/*!
* \brief Copy a media format
*
* \note The returned format must be treated as immutable.
*/
-struct ast_format *ast_format_ng_copy(struct ast_format *format);
+struct ast_format *ast_format_copy(struct ast_format *format);
/*!
* \brief Set an attribute on a format to a specific value
@@ -164,7 +164,7 @@
* \retval 0 success
* \retval -1 failure
*/
-int ast_format_ng_attribute_set(struct ast_format *format, const char *name, const char *value);
+int ast_format_attribute_set(struct ast_format *format, const char *name, const char *value);
/*!
* \brief This function is used to have a media format aware module parse and interpret
@@ -177,7 +177,7 @@
* \retval 0 success, attribute values were valid
* \retval -1 failure, values were not acceptable
*/
-int ast_format_ng_sdp_parse(struct ast_format *format, const char *attributes);
+int ast_format_sdp_parse(struct ast_format *format, const char *attributes);
/*!
* \brief This function is used to produce an fmtp SDP line for an Asterisk format. The
@@ -187,7 +187,7 @@
* \param payload numerical payload for the fmtp line
* \param str structure that the fmtp line will be appended to
*/
-void ast_format_ng_sdp_generate(const struct ast_format *format, unsigned int payload, struct ast_str **str);
+void ast_format_sdp_generate(const struct ast_format *format, unsigned int payload, struct ast_str **str);
/*!
* \brief Register a format interface for use with the provided codec
@@ -210,7 +210,7 @@
* \retval 0 success
* \retval -1 failure
*/
-#define ast_format_ng_interface_register(codec, interface) __ast_format_interface_register(codec, interface, ast_module_info->self)
+#define ast_format_interface_register(codec, interface) __ast_format_interface_register(codec, interface, ast_module_info->self)
/*!
* \brief Get the codec identifier associated with a format
Copied: team/file/media_formats-impl/include/asterisk/format_cap.h (from r409286, team/file/media_formats-impl/include/asterisk/format_cap_ng.h)
URL: http://svnview.digium.com/svn/asterisk/team/file/media_formats-impl/include/asterisk/format_cap.h?view=diff&rev=410156&p1=team/file/media_formats-impl/include/asterisk/format_cap_ng.h&r1=409286&p2=team/file/media_formats-impl/include/asterisk/format_cap.h&r2=410156
==============================================================================
--- team/file/media_formats-impl/include/asterisk/format_cap_ng.h (original)
+++ team/file/media_formats-impl/include/asterisk/format_cap.h Fri Mar 7 09:05:49 2014
@@ -46,7 +46,7 @@
* \retval ast_format_cap object on success.
* \retval NULL on failure.
*/
-struct ast_format_cap *ast_format_cap_ng_alloc(enum ast_format_cap_flags flags);
+struct ast_format_cap *ast_format_cap_alloc(enum ast_format_cap_flags flags);
/*!
* \brief Set the global framing.
@@ -56,7 +56,7 @@
*
* \note This is used if a format does not provide a framing itself.
*/
-void ast_format_cap_ng_set_framing(struct ast_format_cap *cap, unsigned int framing);
+void ast_format_cap_set_framing(struct ast_format_cap *cap, unsigned int framing);
/*!
* \brief Add format capability to capabilities structure.
@@ -74,7 +74,7 @@
*
* \note If framing is specified here it overrides any global framing that has been set.
*/
-int ast_format_cap_ng_add(struct ast_format_cap *cap, struct ast_format *format, unsigned int framing);
+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
@@ -90,7 +90,7 @@
*
* \note If AST_MEDIA_TYPE_UNKNOWN is passed as the type all known codecs will be added.
*/
-int ast_format_cap_ng_add_all_by_type(struct ast_format_cap *cap, enum ast_media_type type);
+int ast_format_cap_add_all_by_type(struct ast_format_cap *cap, enum ast_media_type type);
/*!
* \brief Copy all formats in src to dst
@@ -103,7 +103,7 @@
*
* \note The source capabilities structure is left alone and remains valid afterwards.
*/
-int ast_format_cap_ng_append(struct ast_format_cap *dst, const struct ast_format_cap *src);
+int ast_format_cap_append(struct ast_format_cap *dst, const struct ast_format_cap *src);
/*!
* \brief Get the number of formats present within the capabilities structure
@@ -112,7 +112,7 @@
*
* \return the number of formats
*/
-size_t ast_format_cap_ng_count(const struct ast_format_cap *cap);
+size_t ast_format_cap_count(const struct ast_format_cap *cap);
/*!
* \brief Get the format at a specific index
@@ -130,7 +130,7 @@
* \note The reference count of the returned format is increased. It must be released using ao2_ref
* or ao2_cleanup.
*/
-struct ast_format *ast_format_cap_ng_get_format(const struct ast_format_cap *cap, int position);
+struct ast_format *ast_format_cap_get_format(const struct ast_format_cap *cap, int position);
/*!
* \brief Get the framing for a format
@@ -140,7 +140,7 @@
*
* \return the framing (in milliseconds)
*/
-unsigned int ast_format_cap_ng_get_framing(const struct ast_format_cap *cap, const struct ast_format *format);
+unsigned int ast_format_cap_get_framing(const struct ast_format_cap *cap, const struct ast_format *format);
/*!
* \brief Remove format capability from capability structure.
@@ -150,7 +150,7 @@
* \retval 0, remove was successful
* \retval -1, remove failed. Could not find format to remove
*/
-int ast_format_cap_ng_remove(struct ast_format_cap *cap, struct ast_format *format);
+int ast_format_cap_remove(struct ast_format_cap *cap, struct ast_format *format);
/*!
* \brief Remove all formats matching a specific format type.
@@ -160,7 +160,7 @@
*
* \note All formats can be removed by using the AST_MEDIA_TYPE_UNKNOWN type.
*/
-void ast_format_cap_ng_remove_bytype(struct ast_format_cap *cap, enum ast_media_type type);
+void ast_format_cap_remove_bytype(struct ast_format_cap *cap, enum ast_media_type type);
/*!
* \brief Find if input ast_format is within the capabilities of the ast_format_cap object
@@ -172,14 +172,14 @@
* \note The reference count of the returned format is increased. It must be released using ao2_ref
* or ao2_cleanup.
*/
-struct ast_format *ast_format_cap_ng_get_compatible_format(const struct ast_format_cap *cap, const struct ast_format *format);
+struct ast_format *ast_format_cap_get_compatible_format(const struct ast_format_cap *cap, const struct ast_format *format);
/*!
* \brief Find if ast_format is within the capabilities of the ast_format_cap object.
*
* \retval ast_format_cmp_res representing the result of the compatibility check between cap and format.
*/
-enum ast_format_cmp_res ast_format_cap_ng_iscompatible_format(const struct ast_format_cap *cap, const struct ast_format *format);
+enum ast_format_cmp_res ast_format_cap_iscompatible_format(const struct ast_format_cap *cap, const struct ast_format *format);
/*!
* \brief Find the compatible formats between two capabilities structures
@@ -195,7 +195,7 @@
*
* \note If failure occurs the result format capabilities structure may contain a partial result.
*/
-int ast_format_cap_ng_get_compatible(const struct ast_format_cap *cap1, const struct ast_format_cap *cap2,
+int ast_format_cap_get_compatible(const struct ast_format_cap *cap1, const struct ast_format_cap *cap2,
struct ast_format_cap *result);
/*!
@@ -207,7 +207,7 @@
* \retval 0 no joint capabilities exist
* \retval 1 joint capabilities exist
*/
-int ast_format_cap_ng_iscompatible(const struct ast_format_cap *cap1, const struct ast_format_cap *cap2);
+int ast_format_cap_iscompatible(const struct ast_format_cap *cap1, const struct ast_format_cap *cap2);
/*!
* \brief Find out if the capabilities structure has any formats
@@ -216,7 +216,7 @@
* \retval 1 true
* \retval 0 false, no formats of specific type.
*/
-int ast_format_cap_ng_has_type(const struct ast_format_cap *cap, enum ast_media_type type);
+int ast_format_cap_has_type(const struct ast_format_cap *cap, enum ast_media_type type);
/*! \brief Get the names of codecs of a set of formats
* \param buf a buffer for the output string
@@ -224,6 +224,6 @@
* \param cap capabilities structure containing formats
* \return The return value is buf.
*/
-char *ast_getformatname_ng_multiple(char *buf, size_t size, struct ast_format_cap *cap);
+char *ast_getformatname_multiple(char *buf, size_t size, struct ast_format_cap *cap);
#endif /* _AST_FORMAT_CAP_H */
Copied: team/file/media_formats-impl/main/format.c (from r409286, team/file/media_formats-impl/main/format_ng.c)
URL: http://svnview.digium.com/svn/asterisk/team/file/media_formats-impl/main/format.c?view=diff&rev=410156&p1=team/file/media_formats-impl/main/format_ng.c&r1=409286&p2=team/file/media_formats-impl/main/format.c&r2=410156
==============================================================================
--- team/file/media_formats-impl/main/format_ng.c (original)
+++ team/file/media_formats-impl/main/format.c Fri Mar 7 09:05:49 2014
@@ -33,7 +33,7 @@
#include "asterisk/logger.h"
#include "asterisk/codec.h"
-#include "asterisk/format_ng.h"
+#include "asterisk/format.h"
#include "asterisk/astobj2.h"
#include "asterisk/strings.h"
@@ -167,7 +167,7 @@
ao2_cleanup(format->codec);
}
-struct ast_format *ast_format_ng_create(struct ast_codec *codec)
+struct ast_format *ast_format_create(struct ast_codec *codec)
{
struct ast_format *format;
struct format_interface *format_interface;
@@ -188,7 +188,7 @@
return format;
}
-enum ast_format_cmp_res ast_format_ng_cmp(const struct ast_format *format1, const struct ast_format *format2)
+enum ast_format_cmp_res ast_format_cmp(const struct ast_format *format1, const struct ast_format *format2)
{
if (format1 == format2) {
return AST_FORMAT_CMP_EQUAL;
@@ -205,7 +205,7 @@
return AST_FORMAT_CMP_EQUAL;
}
-struct ast_format *ast_format_ng_joint(const struct ast_format *format1, const struct ast_format *format2)
+struct ast_format *ast_format_joint(const struct ast_format *format1, const struct ast_format *format2)
{
if (format1->codec != format2->codec) {
return NULL;
@@ -223,12 +223,12 @@
return format1->interface->format_get_joint(format1, format2);
}
-struct ast_format *ast_format_ng_copy(struct ast_format *format)
+struct ast_format *ast_format_copy(struct ast_format *format)
{
return ao2_bump(format);
}
-int ast_format_ng_attribute_set(struct ast_format *format, const char *name, const char *value)
+int ast_format_attribute_set(struct ast_format *format, const char *name, const char *value)
{
if (!format->interface || !format->interface->format_attribute_set) {
return -1;
@@ -237,7 +237,7 @@
return format->interface->format_attribute_set(format, name, value);
}
-int ast_format_ng_sdp_parse(struct ast_format *format, const char *attributes)
+int ast_format_sdp_parse(struct ast_format *format, const char *attributes)
{
if (!format->interface || !format->interface->format_sdp_parse) {
return -1;
@@ -246,7 +246,7 @@
return format->interface->format_sdp_parse(format, attributes);
}
-void ast_format_ng_sdp_generate(const struct ast_format *format, unsigned int payload, struct ast_str **str)
+void ast_format_sdp_generate(const struct ast_format *format, unsigned int payload, struct ast_str **str)
{
if (!format->interface || !format->interface->format_sdp_generate) {
return;
Copied: team/file/media_formats-impl/main/format_cap.c (from r409286, team/file/media_formats-impl/main/format_cap_ng.c)
URL: http://svnview.digium.com/svn/asterisk/team/file/media_formats-impl/main/format_cap.c?view=diff&rev=410156&p1=team/file/media_formats-impl/main/format_cap_ng.c&r1=409286&p2=team/file/media_formats-impl/main/format_cap.c&r2=410156
==============================================================================
--- team/file/media_formats-impl/main/format_cap_ng.c (original)
+++ team/file/media_formats-impl/main/format_cap.c Fri Mar 7 09:05:49 2014
@@ -32,8 +32,8 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/logger.h"
-#include "asterisk/format_ng.h"
-#include "asterisk/format_cap_ng.h"
+#include "asterisk/format.h"
+#include "asterisk/format_cap.h"
#include "asterisk/codec.h"
#include "asterisk/astobj2.h"
#include "asterisk/strings.h"
@@ -91,7 +91,7 @@
AST_VECTOR_FREE(&cap->preference_order);
}
-struct ast_format_cap *ast_format_cap_ng_alloc(enum ast_format_cap_flags flags)
+struct ast_format_cap *ast_format_cap_alloc(enum ast_format_cap_flags flags)
{
struct ast_format_cap *cap;
@@ -108,7 +108,7 @@
return cap;
}
-void ast_format_cap_ng_set_framing(struct ast_format_cap *cap, unsigned int framing)
+void ast_format_cap_set_framing(struct ast_format_cap *cap, unsigned int framing)
{
cap->framing = framing;
}
@@ -121,7 +121,7 @@
ao2_cleanup(framed->format);
}
-int ast_format_cap_ng_add(struct ast_format_cap *cap, struct ast_format *format, unsigned int framing)
+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;
@@ -152,7 +152,7 @@
return 0;
}
-int ast_format_cap_ng_add_all_by_type(struct ast_format_cap *cap, enum ast_media_type type)
+int ast_format_cap_add_all_by_type(struct ast_format_cap *cap, enum ast_media_type type)
{
int id;
@@ -170,7 +170,7 @@
continue;
}
- format = ast_format_ng_create(codec);
+ format = ast_format_create(codec);
ao2_ref(codec, -1);
if (!format) {
@@ -178,7 +178,7 @@
}
/* Use the global framing or default framing of the codec */
- res = ast_format_cap_ng_add(cap, format, 0);
+ res = ast_format_cap_add(cap, format, 0);
ao2_ref(format, -1);
if (res) {
@@ -189,25 +189,25 @@
return 0;
}
-int ast_format_cap_ng_append(struct ast_format_cap *dst, const struct ast_format_cap *src)
+int ast_format_cap_append(struct ast_format_cap *dst, const struct ast_format_cap *src)
{
int idx, res = 0;
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_ng_add(dst, framed->format, framed->framing);
+ res = ast_format_cap_add(dst, framed->format, framed->framing);
}
return res;
}
-size_t ast_format_cap_ng_count(const struct ast_format_cap *cap)
+size_t ast_format_cap_count(const struct ast_format_cap *cap)
{
return AST_VECTOR_SIZE(&cap->preference_order);
}
-struct ast_format *ast_format_cap_ng_get_format(const struct ast_format_cap *cap, int position)
+struct ast_format *ast_format_cap_get_format(const struct ast_format_cap *cap, int position)
{
struct format_cap_framed *framed;
@@ -221,7 +221,7 @@
return framed->format;
}
-unsigned int ast_format_cap_ng_get_framing(const struct ast_format_cap *cap, const struct ast_format *format)
+unsigned int ast_format_cap_get_framing(const struct ast_format_cap *cap, const struct ast_format *format)
{
unsigned int framing;
struct format_cap_framed_list *list;
@@ -235,7 +235,7 @@
list = AST_VECTOR_GET_ADDR(&cap->formats, ast_format_get_codec_id(format));
AST_LIST_TRAVERSE(list, framed, entry) {
- enum ast_format_cmp_res res = ast_format_ng_cmp(format, framed->format);
+ enum ast_format_cmp_res res = ast_format_cmp(format, framed->format);
if (res == AST_FORMAT_CMP_NOT_EQUAL) {
continue;
@@ -275,7 +275,7 @@
*/
#define FORMAT_CAP_FRAMED_ELEM_CLEANUP(elem) ao2_cleanup((elem))
-int ast_format_cap_ng_remove(struct ast_format_cap *cap, struct ast_format *format)
+int ast_format_cap_remove(struct ast_format_cap *cap, struct ast_format *format)
{
struct format_cap_framed_list *list;
struct format_cap_framed *framed;
@@ -301,7 +301,7 @@
FORMAT_CAP_FRAMED_ELEM_CMP, FORMAT_CAP_FRAMED_ELEM_CLEANUP);
}
-void ast_format_cap_ng_remove_bytype(struct ast_format_cap *cap, enum ast_media_type type)
+void ast_format_cap_remove_bytype(struct ast_format_cap *cap, enum ast_media_type type)
{
int idx;
@@ -324,7 +324,7 @@
}
}
-struct ast_format *ast_format_cap_ng_get_compatible_format(const struct ast_format_cap *cap, const struct ast_format *format)
+struct ast_format *ast_format_cap_get_compatible_format(const struct ast_format_cap *cap, const struct ast_format *format)
{
struct format_cap_framed_list *list;
struct format_cap_framed *framed;
@@ -337,7 +337,7 @@
list = AST_VECTOR_GET_ADDR(&cap->formats, ast_format_get_codec_id(format));
AST_LIST_TRAVERSE(list, framed, entry) {
- enum ast_format_cmp_res res = ast_format_ng_cmp(format, framed->format);
+ enum ast_format_cmp_res res = ast_format_cmp(format, framed->format);
if (res == AST_FORMAT_CMP_NOT_EQUAL) {
continue;
@@ -346,7 +346,7 @@
/* Replace any current result, this one will also be a subset OR an exact match */
ao2_cleanup(result);
- result = ast_format_ng_joint(format, framed->format);
+ result = ast_format_joint(format, framed->format);
/* If it's a match we can do no better so return asap */
if (res == AST_FORMAT_CMP_EQUAL) {
@@ -357,7 +357,7 @@
return result;
}
-enum ast_format_cmp_res ast_format_cap_ng_iscompatible_format(const struct ast_format_cap *cap,
+enum ast_format_cmp_res ast_format_cap_iscompatible_format(const struct ast_format_cap *cap,
const struct ast_format *format)
{
enum ast_format_cmp_res res = AST_FORMAT_CMP_NOT_EQUAL;
@@ -371,7 +371,7 @@
list = AST_VECTOR_GET_ADDR(&cap->formats, ast_format_get_codec_id(format));
AST_LIST_TRAVERSE(list, framed, entry) {
- enum ast_format_cmp_res cmp = ast_format_ng_cmp(format, framed->format);
+ enum ast_format_cmp_res cmp = ast_format_cmp(format, framed->format);
if (cmp == AST_FORMAT_CMP_NOT_EQUAL) {
continue;
@@ -387,7 +387,7 @@
return res;
}
-int ast_format_cap_ng_has_type(const struct ast_format_cap *cap, enum ast_media_type type)
+int ast_format_cap_has_type(const struct ast_format_cap *cap, enum ast_media_type type)
{
int idx;
@@ -402,7 +402,7 @@
return 0;
}
-int ast_format_cap_ng_get_compatible(const struct ast_format_cap *cap1, const struct ast_format_cap *cap2,
+int ast_format_cap_get_compatible(const struct ast_format_cap *cap1, const struct ast_format_cap *cap2,
struct ast_format_cap *result)
{
int idx, res = 0;
@@ -411,12 +411,12 @@
struct format_cap_framed *framed = AST_VECTOR_GET(&cap1->preference_order, idx);
struct ast_format *format;
- format = ast_format_cap_ng_get_compatible_format(cap2, framed->format);
+ format = ast_format_cap_get_compatible_format(cap2, framed->format);
if (!format) {
continue;
}
- res = ast_format_cap_ng_add(result, format, framed->framing);
+ res = ast_format_cap_add(result, format, framed->framing);
ao2_ref(format, -1);
if (res) {
@@ -427,14 +427,14 @@
return res;
}
-int ast_format_cap_ng_iscompatible(const struct ast_format_cap *cap1, const struct ast_format_cap *cap2)
+int ast_format_cap_iscompatible(const struct ast_format_cap *cap1, const struct ast_format_cap *cap2)
{
int idx;
for (idx = 0; idx < AST_VECTOR_SIZE(&cap1->preference_order); ++idx) {
struct format_cap_framed *framed = AST_VECTOR_GET(&cap1->preference_order, idx);
- if (ast_format_cap_ng_iscompatible_format(cap2, framed->format) != AST_FORMAT_CMP_NOT_EQUAL) {
+ if (ast_format_cap_iscompatible_format(cap2, framed->format) != AST_FORMAT_CMP_NOT_EQUAL) {
return 1;
}
}
@@ -442,7 +442,7 @@
return 0;
}
-char *ast_getformatname_ng_multiple(char *buf, size_t size, struct ast_format_cap *cap)
+char *ast_getformatname_multiple(char *buf, size_t size, struct ast_format_cap *cap)
{
int idx;
unsigned len;
Modified: team/file/media_formats-impl/tests/test_core_format.c
URL: http://svnview.digium.com/svn/asterisk/team/file/media_formats-impl/tests/test_core_format.c?view=diff&rev=410156&r1=410155&r2=410156
==============================================================================
--- team/file/media_formats-impl/tests/test_core_format.c (original)
+++ team/file/media_formats-impl/tests/test_core_format.c Fri Mar 7 09:05:49 2014
@@ -36,7 +36,7 @@
#include "asterisk/test.h"
#include "asterisk/module.h"
#include "asterisk/codec.h"
-#include "asterisk/format_ng.h"
+#include "asterisk/format.h"
AST_TEST_DEFINE(format_create)
{
@@ -61,7 +61,7 @@
return AST_TEST_FAIL;
}
- format = ast_format_ng_create(codec);
+ format = ast_format_create(codec);
if (!format) {
ast_test_status_update(test, "Could not create format using built-in codec\n");
return AST_TEST_FAIL;
@@ -97,19 +97,19 @@
return AST_TEST_FAIL;
}
- first = ast_format_ng_create(codec);
+ first = ast_format_create(codec);
if (!first) {
ast_test_status_update(test, "Could not create first format using built-in codec\n");
return AST_TEST_FAIL;
}
- second = ast_format_ng_create(codec);
+ second = ast_format_create(codec);
if (!second) {
ast_test_status_update(test, "Could not create second format using built-in codec\n");
return AST_TEST_FAIL;
}
- if (ast_format_ng_cmp(first, second) != AST_FORMAT_CMP_EQUAL) {
+ if (ast_format_cmp(first, second) != AST_FORMAT_CMP_EQUAL) {
ast_test_status_update(test, "Two formats that are the same compared as not being equal\n");
return AST_TEST_FAIL;
}
@@ -142,7 +142,7 @@
return AST_TEST_FAIL;
}
- first = ast_format_ng_create(first_codec);
+ first = ast_format_create(first_codec);
if (!first) {
ast_test_status_update(test, "Could not create first format using built-in codec\n");
return AST_TEST_FAIL;
@@ -154,13 +154,13 @@
return AST_TEST_FAIL;
}
- second = ast_format_ng_create(second_codec);
+ second = ast_format_create(second_codec);
if (!second) {
ast_test_status_update(test, "Could not create second format using built-in codec\n");
return AST_TEST_FAIL;
}
- if (ast_format_ng_cmp(first, second) != AST_FORMAT_CMP_NOT_EQUAL) {
+ if (ast_format_cmp(first, second) != AST_FORMAT_CMP_NOT_EQUAL) {
ast_test_status_update(test, "Two formats that have different codecs did not compare as being not equal\n");
return AST_TEST_FAIL;
}
@@ -193,19 +193,19 @@
return AST_TEST_FAIL;
}
- first = ast_format_ng_create(codec);
+ first = ast_format_create(codec);
if (!first) {
ast_test_status_update(test, "Could not create first format using built-in codec\n");
return AST_TEST_FAIL;
}
- second = ast_format_ng_create(codec);
+ second = ast_format_create(codec);
if (!second) {
ast_test_status_update(test, "Could not create second format using built-in codec\n");
return AST_TEST_FAIL;
}
- joint = ast_format_ng_joint(first, second);
+ joint = ast_format_joint(first, second);
if (!joint) {
ast_test_status_update(test, "Failed to create a joint format using two formats of same codec\n");
return AST_TEST_FAIL;
@@ -243,7 +243,7 @@
return AST_TEST_FAIL;
}
- first = ast_format_ng_create(first_codec);
+ first = ast_format_create(first_codec);
if (!first) {
ast_test_status_update(test, "Could not create first format using built-in codec\n");
return AST_TEST_FAIL;
@@ -255,13 +255,13 @@
return AST_TEST_FAIL;
}
- second = ast_format_ng_create(second_codec);
+ second = ast_format_create(second_codec);
if (!second) {
ast_test_status_update(test, "Could not create second format using built-in codec\n");
return AST_TEST_FAIL;
}
- joint = ast_format_ng_joint(first, second);
+ joint = ast_format_joint(first, second);
if (joint) {
ast_test_status_update(test, "Got a joint format between two formats with different codecs\n");
return AST_TEST_FAIL;
@@ -294,13 +294,13 @@
return AST_TEST_FAIL;
}
- format = ast_format_ng_create(codec);
+ format = ast_format_create(codec);
if (!format) {
ast_test_status_update(test, "Could not create format using built-in codec\n");
return AST_TEST_FAIL;
}
- copy = ast_format_ng_copy(format);
+ copy = ast_format_copy(format);
if (!copy) {
ast_test_status_update(test, "Copying of a just created format failed\n");
return AST_TEST_FAIL;
@@ -335,13 +335,13 @@
return AST_TEST_FAIL;
}
- format = ast_format_ng_create(codec);
+ format = ast_format_create(codec);
if (!format) {
ast_test_status_update(test, "Could not create format using built-in codec\n");
return AST_TEST_FAIL;
}
- if (!ast_format_ng_attribute_set(format, "bees", "cool")) {
+ if (!ast_format_attribute_set(format, "bees", "cool")) {
ast_test_status_update(test, "Successfully set an attribute on a format without an interface\n");
return AST_TEST_FAIL;
}
@@ -372,13 +372,13 @@
return AST_TEST_FAIL;
}
- format = ast_format_ng_create(codec);
+ format = ast_format_create(codec);
if (!format) {
ast_test_status_update(test, "Could not create format using built-in codec\n");
return AST_TEST_FAIL;
}
- if (!ast_format_ng_sdp_parse(format, "tacos")) {
+ if (!ast_format_sdp_parse(format, "tacos")) {
ast_test_status_update(test, "Successfully parsed SDP on a format without an interface\n");
return AST_TEST_FAIL;
}
Modified: team/file/media_formats-impl/tests/test_format_cache.c
URL: http://svnview.digium.com/svn/asterisk/team/file/media_formats-impl/tests/test_format_cache.c?view=diff&rev=410156&r1=410155&r2=410156
==============================================================================
--- team/file/media_formats-impl/tests/test_format_cache.c (original)
+++ team/file/media_formats-impl/tests/test_format_cache.c Fri Mar 7 09:05:49 2014
@@ -36,7 +36,7 @@
#include "asterisk/test.h"
#include "asterisk/module.h"
#include "asterisk/codec.h"
-#include "asterisk/format_ng.h"
+#include "asterisk/format.h"
#include "asterisk/format_cache.h"
AST_TEST_DEFINE(format_cache_add)
@@ -62,7 +62,7 @@
return AST_TEST_FAIL;
}
- format = ast_format_ng_create(codec);
+ format = ast_format_create(codec);
if (!format) {
ast_test_status_update(test, "Could not create format using built-in codec\n");
return AST_TEST_FAIL;
@@ -99,7 +99,7 @@
return AST_TEST_FAIL;
}
- format = ast_format_ng_create(codec);
+ format = ast_format_create(codec);
if (!format) {
ast_test_status_update(test, "Could not create format using built-in codec\n");
return AST_TEST_FAIL;
@@ -141,7 +141,7 @@
return AST_TEST_FAIL;
}
- format = ast_format_ng_create(codec);
+ format = ast_format_create(codec);
if (!format) {
ast_test_status_update(test, "Could not create format using built-in codec\n");
return AST_TEST_FAIL;
@@ -185,7 +185,7 @@
return AST_TEST_FAIL;
}
- format = ast_format_ng_create(codec);
+ format = ast_format_create(codec);
if (!format) {
ast_test_status_update(test, "Could not create format using built-in codec\n");
return AST_TEST_FAIL;
@@ -232,7 +232,7 @@
return AST_TEST_FAIL;
}
- format = ast_format_ng_create(codec);
+ format = ast_format_create(codec);
if (!format) {
ast_test_status_update(test, "Could not create format using built-in codec\n");
return AST_TEST_FAIL;
Modified: team/file/media_formats-impl/tests/test_format_cap.c
URL: http://svnview.digium.com/svn/asterisk/team/file/media_formats-impl/tests/test_format_cap.c?view=diff&rev=410156&r1=410155&r2=410156
==============================================================================
--- team/file/media_formats-impl/tests/test_format_cap.c (original)
+++ team/file/media_formats-impl/tests/test_format_cap.c Fri Mar 7 09:05:49 2014
@@ -36,8 +36,8 @@
#include "asterisk/test.h"
#include "asterisk/module.h"
#include "asterisk/codec.h"
-#include "asterisk/format_ng.h"
-#include "asterisk/format_cap_ng.h"
+#include "asterisk/format.h"
+#include "asterisk/format_cap.h"
AST_TEST_DEFINE(format_cap_alloc)
{
@@ -55,7 +55,7 @@
break;
}
- caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+ caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
if (!caps) {
ast_test_status_update(test, "Could not allocate an empty format capabilities structure\n");
return AST_TEST_FAIL;
@@ -84,7 +84,7 @@
break;
}
- caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+ caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
if (!caps) {
ast_test_status_update(test, "Could not allocate an empty format capabilities structure\n");
return AST_TEST_FAIL;
@@ -96,29 +96,29 @@
return AST_TEST_FAIL;
}
- format = ast_format_ng_create(codec);
+ format = ast_format_create(codec);
if (!format) {
ast_test_status_update(test, "Could not create format using built-in codec\n");
return AST_TEST_FAIL;
}
- if (ast_format_cap_ng_add(caps, format, 42)) {
+ if (ast_format_cap_add(caps, format, 42)) {
ast_test_status_update(test, "Could not add newly created format to capabilities structure\n");
return AST_TEST_FAIL;
- } else if (ast_format_cap_ng_count(caps) != 1) {
+ } else if (ast_format_cap_count(caps) != 1) {
ast_test_status_update(test, "Number of formats in capabilities structure should be 1 but is %zd\n",
- ast_format_cap_ng_count(caps));
- return AST_TEST_FAIL;
- }
-
- retrieved = ast_format_cap_ng_get_format(caps, 0);
+ ast_format_cap_count(caps));
+ return AST_TEST_FAIL;
+ }
+
+ retrieved = ast_format_cap_get_format(caps, 0);
if (!retrieved) {
ast_test_status_update(test, "Attempted to get single format from capabilities structure but got nothing\n");
return AST_TEST_FAIL;
} else if (retrieved != format) {
ast_test_status_update(test, "Retrieved format is not the same as the one we added\n");
return AST_TEST_FAIL;
- } else if (ast_format_cap_ng_get_framing(caps, retrieved) != 42) {
+ } else if (ast_format_cap_get_framing(caps, retrieved) != 42) {
ast_test_status_update(test, "Framing for format in capabilities structure does not match what we provided\n");
return AST_TEST_FAIL;
}
@@ -147,7 +147,7 @@
break;
}
- caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+ caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
if (!caps) {
ast_test_status_update(test, "Could not allocate an empty format capabilities structure\n");
return AST_TEST_FAIL;
@@ -159,7 +159,7 @@
return AST_TEST_FAIL;
}
- ulaw_format = ast_format_ng_create(ulaw);
+ ulaw_format = ast_format_create(ulaw);
if (!ulaw_format) {
ast_test_status_update(test, "Could not create ulaw format using built-in codec\n");
return AST_TEST_FAIL;
@@ -171,44 +171,44 @@
return AST_TEST_FAIL;
}
- alaw_format = ast_format_ng_create(alaw);
+ alaw_format = ast_format_create(alaw);
if (!alaw_format) {
ast_test_status_update(test, "Could not create alaw format using built-in codec\n");
return AST_TEST_FAIL;
}
- if (ast_format_cap_ng_add(caps, ulaw_format, 42)) {
+ if (ast_format_cap_add(caps, ulaw_format, 42)) {
ast_test_status_update(test, "Could not add newly created ulaw format to capabilities structure\n");
return AST_TEST_FAIL;
- } else if (ast_format_cap_ng_add(caps, alaw_format, 84)) {
+ } else if (ast_format_cap_add(caps, alaw_format, 84)) {
ast_test_status_update(test, "Could not add newly created alaw format to capabilities structure\n");
return AST_TEST_FAIL;
- } else if (ast_format_cap_ng_count(caps) != 2) {
+ } else if (ast_format_cap_count(caps) != 2) {
ast_test_status_update(test, "Number of formats in capabilities structure should be 2 but is %zd\n",
- ast_format_cap_ng_count(caps));
- return AST_TEST_FAIL;
- }
-
- retrieved = ast_format_cap_ng_get_format(caps, 0);
+ ast_format_cap_count(caps));
+ return AST_TEST_FAIL;
+ }
+
+ retrieved = ast_format_cap_get_format(caps, 0);
if (!retrieved) {
ast_test_status_update(test, "Attempted to get first format from capabilities structure but got nothing\n");
return AST_TEST_FAIL;
} else if (retrieved != ulaw_format) {
ast_test_status_update(test, "First retrieved format is not the ulaw one we added\n");
return AST_TEST_FAIL;
- } else if (ast_format_cap_ng_get_framing(caps, retrieved) != 42) {
+ } else if (ast_format_cap_get_framing(caps, retrieved) != 42) {
ast_test_status_update(test, "Framing for ulaw format in capabilities structure does not match what we provided\n");
}
ao2_ref(retrieved, -1);
- retrieved = ast_format_cap_ng_get_format(caps, 1);
+ retrieved = ast_format_cap_get_format(caps, 1);
if (!retrieved) {
ast_test_status_update(test, "Attempted to get second format from capabilities structure but got nothing\n");
return AST_TEST_FAIL;
} else if (retrieved != alaw_format) {
ast_test_status_update(test, "First retrieved format is not the alaw one we added\n");
return AST_TEST_FAIL;
- } else if (ast_format_cap_ng_get_framing(caps, retrieved) != 84) {
+ } else if (ast_format_cap_get_framing(caps, retrieved) != 84) {
ast_test_status_update(test, "Framing for alaw format in capabilities structure does not match what we provided\n");
}
@@ -231,20 +231,20 @@
break;
}
- caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
- if (!caps) {
- ast_test_status_update(test, "Could not allocate an empty format capabilities structure\n");
- return AST_TEST_FAIL;
- } else if (ast_format_cap_ng_add_all_by_type(caps, AST_MEDIA_TYPE_UNKNOWN)) {
+ caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+ if (!caps) {
+ ast_test_status_update(test, "Could not allocate an empty format capabilities structure\n");
+ return AST_TEST_FAIL;
+ } else if (ast_format_cap_add_all_by_type(caps, AST_MEDIA_TYPE_UNKNOWN)) {
ast_test_status_update(test, "Failed to add all media formats of all types to capabilities structure\n");
return AST_TEST_FAIL;
- } else if (!ast_format_cap_ng_has_type(caps, AST_MEDIA_TYPE_AUDIO)) {
+ } else if (!ast_format_cap_has_type(caps, AST_MEDIA_TYPE_AUDIO)) {
ast_test_status_update(test, "Added all media formats but no audio formats exist when they should\n");
return AST_TEST_FAIL;
- } else if (!ast_format_cap_ng_has_type(caps, AST_MEDIA_TYPE_VIDEO)) {
+ } else if (!ast_format_cap_has_type(caps, AST_MEDIA_TYPE_VIDEO)) {
ast_test_status_update(test, "Added all media formats but no video formats exist when they should\n");
return AST_TEST_FAIL;
- } else if ((ast_format_cap_ng_count(caps) + 1) != ast_codec_get_max()) {
+ } else if ((ast_format_cap_count(caps) + 1) != ast_codec_get_max()) {
ast_test_status_update(test, "The number of formats in the capabilities structure does not match known number\n");
return AST_TEST_FAIL;
}
@@ -268,23 +268,23 @@
break;
}
- caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
- if (!caps) {
- ast_test_status_update(test, "Could not allocate an empty format capabilities structure\n");
- return AST_TEST_FAIL;
- } else if (ast_format_cap_ng_add_all_by_type(caps, AST_MEDIA_TYPE_AUDIO)) {
+ caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+ if (!caps) {
+ ast_test_status_update(test, "Could not allocate an empty format capabilities structure\n");
+ return AST_TEST_FAIL;
+ } else if (ast_format_cap_add_all_by_type(caps, AST_MEDIA_TYPE_AUDIO)) {
ast_test_status_update(test, "Failed to add all audio media formats to capabilities structure\n");
return AST_TEST_FAIL;
- } else if (!ast_format_cap_ng_has_type(caps, AST_MEDIA_TYPE_AUDIO)) {
+ } else if (!ast_format_cap_has_type(caps, AST_MEDIA_TYPE_AUDIO)) {
ast_test_status_update(test, "Added audio media formats but no audio formats exist when they should\n");
return AST_TEST_FAIL;
- } else if (ast_format_cap_ng_has_type(caps, AST_MEDIA_TYPE_VIDEO)) {
+ } else if (ast_format_cap_has_type(caps, AST_MEDIA_TYPE_VIDEO)) {
ast_test_status_update(test, "Added only audio media formats but video formats exist when they should not\n");
return AST_TEST_FAIL;
- } else if (ast_format_cap_ng_has_type(caps, AST_MEDIA_TYPE_TEXT)) {
+ } else if (ast_format_cap_has_type(caps, AST_MEDIA_TYPE_TEXT)) {
ast_test_status_update(test, "Added only audio media formats but text formats exist when they should not\n");
return AST_TEST_FAIL;
- } else if (ast_format_cap_ng_has_type(caps, AST_MEDIA_TYPE_IMAGE)) {
+ } else if (ast_format_cap_has_type(caps, AST_MEDIA_TYPE_IMAGE)) {
ast_test_status_update(test, "Added only audio media formats but image formats exist when they should not\n");
return AST_TEST_FAIL;
}
@@ -309,31 +309,31 @@
break;
}
- dst_caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+ dst_caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
if (!dst_caps) {
ast_test_status_update(test, "Could not allocate an empty format capabilities structure\n");
return AST_TEST_FAIL;
- } else if (ast_format_cap_ng_add_all_by_type(dst_caps, AST_MEDIA_TYPE_AUDIO)) {
+ } else if (ast_format_cap_add_all_by_type(dst_caps, AST_MEDIA_TYPE_AUDIO)) {
ast_test_status_update(test, "Failed to add all audio media formats to capabilities structure\n");
return AST_TEST_FAIL;
}
- src_caps = ast_format_cap_ng_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+ src_caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
if (!src_caps) {
[... 474 lines stripped ...]
More information about the asterisk-commits
mailing list