diff options
author | Joshua Colp <jcolp@digium.com> | 2016-11-28 08:57:44 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2016-11-28 08:57:44 -0600 |
commit | c9cc64b911243dfce860ff7e9902a1265a54f889 (patch) | |
tree | 0bbcc7e032a1ae7e51b80371c860d974d2a89b21 /main | |
parent | e3dae763ee77485bcbcf8818d2b8c9570afe3013 (diff) | |
parent | b2b5f9d897d1534f366b1b96fb10ad1de4f9ba5d (diff) |
Merge "ast_format: Adds an identifier for interleaved audio formats to the ast_format"
Diffstat (limited to 'main')
-rw-r--r-- | main/format.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/main/format.c b/main/format.c index b5e577913..5ae5ad986 100644 --- a/main/format.c +++ b/main/format.c @@ -49,6 +49,8 @@ struct ast_format { void *attribute_data; /*! \brief Pointer to the optional format interface */ const struct ast_format_interface *interface; + /*! \brief The number if audio channels used, if more than one an interleaved format is required */ + unsigned int channel_count; }; /*! \brief Structure used when registering a format interface */ @@ -175,6 +177,16 @@ void ast_format_set_attribute_data(struct ast_format *format, void *attribute_da format->attribute_data = attribute_data; } +unsigned int ast_format_get_channel_count(const struct ast_format *format) +{ + return format->channel_count; +} + +void ast_format_set_channel_count(struct ast_format *format, unsigned int channel_count) +{ + format->channel_count = channel_count; +} + /*! \brief Destructor for media formats */ static void format_destroy(void *obj) { @@ -199,6 +211,7 @@ struct ast_format *ast_format_create_named(const char *format_name, struct ast_c } format->name = format_name; format->codec = ao2_bump(codec); + format->channel_count = 1; format_interface = ao2_find(interfaces, codec->name, OBJ_SEARCH_KEY); if (format_interface) { |