mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
Add support for parsing SDP attributes, generating SDP attributes, and passing it through.
This support includes codecs such as H.263, H.264, SILK, and CELT. You are able to set up a call and have attribute information pass. This should help considerably with video calls. Review: https://reviewboard.asterisk.org/r/2005/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370055 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -45,6 +45,29 @@ struct celt_attr {
|
||||
unsigned int framesize;
|
||||
};
|
||||
|
||||
static int celt_sdp_parse(struct ast_format_attr *format_attr, const char *attributes)
|
||||
{
|
||||
struct celt_attr *attr = (struct celt_attr *) format_attr;
|
||||
unsigned int val;
|
||||
|
||||
if (sscanf(attributes, "framesize=%30u", &val) == 1) {
|
||||
attr->framesize = val;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void celt_sdp_generate(const struct ast_format_attr *format_attr, unsigned int payload, struct ast_str **str)
|
||||
{
|
||||
struct celt_attr *attr = (struct celt_attr *) format_attr;
|
||||
|
||||
if (!attr->framesize) {
|
||||
return;
|
||||
}
|
||||
|
||||
ast_str_append(str, 0, "a=fmtp:%d framesize=%d\r\n", payload, attr->framesize);
|
||||
}
|
||||
|
||||
static enum ast_format_cmp_res celt_cmp(const struct ast_format_attr *fattr1, const struct ast_format_attr *fattr2)
|
||||
{
|
||||
struct celt_attr *attr1 = (struct celt_attr *) fattr1;
|
||||
@@ -161,6 +184,8 @@ static struct ast_format_attr_interface celt_interface = {
|
||||
.format_attr_set = celt_set,
|
||||
.format_attr_isset = celt_isset,
|
||||
.format_attr_get_val = celt_get_val,
|
||||
.format_attr_sdp_parse = celt_sdp_parse,
|
||||
.format_attr_sdp_generate = celt_sdp_generate,
|
||||
};
|
||||
|
||||
static int load_module(void)
|
||||
|
Reference in New Issue
Block a user