Skip to content
Snippets Groups Projects
Commit 47d9ff17 authored by Matt Jordan's avatar Matt Jordan Committed by Gerrit Code Review
Browse files

Merge "res/res_format_attr_silk: Expose format attributes to other modules" into 13

parents 53247673 8e194047
Branches
Tags
No related merge requests found
...@@ -200,12 +200,36 @@ static struct ast_format *silk_set(const struct ast_format *format, const char * ...@@ -200,12 +200,36 @@ static struct ast_format *silk_set(const struct ast_format *format, const char *
return cloned; return cloned;
} }
static const void *silk_get(const struct ast_format *format, const char *name)
{
struct silk_attr *attr = ast_format_get_attribute_data(format);
unsigned int *val;
if (!strcasecmp(name, "sample_rate")) {
val = &attr->samplerate;
} else if (!strcasecmp(name, "max_bitrate")) {
val = &attr->maxbitrate;
} else if (!strcasecmp(name, "dtx")) {
val = &attr->dtx;
} else if (!strcasecmp(name, "fec")) {
val = &attr->fec;
} else if (!strcasecmp(name, "packetloss_percentage")) {
val = &attr->packetloss_percentage;
} else {
ast_log(LOG_WARNING, "unknown attribute type %s\n", name);
return NULL;
}
return val;
}
static struct ast_format_interface silk_interface = { static struct ast_format_interface silk_interface = {
.format_destroy = silk_destroy, .format_destroy = silk_destroy,
.format_clone = silk_clone, .format_clone = silk_clone,
.format_cmp = silk_cmp, .format_cmp = silk_cmp,
.format_get_joint = silk_getjoint, .format_get_joint = silk_getjoint,
.format_attribute_set = silk_set, .format_attribute_set = silk_set,
.format_attribute_get = silk_get,
.format_parse_sdp_fmtp = silk_parse_sdp_fmtp, .format_parse_sdp_fmtp = silk_parse_sdp_fmtp,
.format_generate_sdp_fmtp = silk_generate_sdp_fmtp, .format_generate_sdp_fmtp = silk_generate_sdp_fmtp,
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment