mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 20:08:17 +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:
@@ -119,6 +119,51 @@ static int has_interface(const struct ast_format *format)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ast_format_sdp_parse(struct ast_format *format, const char *attributes)
|
||||
{
|
||||
struct interface_ao2_wrapper *wrapper;
|
||||
int res;
|
||||
|
||||
if (!(wrapper = find_interface(format))) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
ao2_rdlock(wrapper);
|
||||
if (!(wrapper->interface || !wrapper->interface->format_attr_sdp_parse)) {
|
||||
ao2_unlock(wrapper);
|
||||
ao2_ref(wrapper, -1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
res = wrapper->interface->format_attr_sdp_parse(&format->fattr, attributes);
|
||||
|
||||
ao2_unlock(wrapper);
|
||||
ao2_ref(wrapper, -1);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
void ast_format_sdp_generate(const struct ast_format *format, unsigned int payload, struct ast_str **str)
|
||||
{
|
||||
struct interface_ao2_wrapper *wrapper;
|
||||
|
||||
if (!(wrapper = find_interface(format))) {
|
||||
return;
|
||||
}
|
||||
|
||||
ao2_rdlock(wrapper);
|
||||
if (!(wrapper->interface || !wrapper->interface->format_attr_sdp_generate)) {
|
||||
ao2_unlock(wrapper);
|
||||
ao2_ref(wrapper, -1);
|
||||
return;
|
||||
}
|
||||
|
||||
wrapper->interface->format_attr_sdp_generate(&format->fattr, payload, str);
|
||||
|
||||
ao2_unlock(wrapper);
|
||||
ao2_ref(wrapper, -1);
|
||||
}
|
||||
|
||||
/*! \internal
|
||||
* \brief set format attributes using an interface
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user