diff options
author | Joshua Colp <jcolp@digium.com> | 2012-08-07 13:07:58 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2012-08-07 13:07:58 +0000 |
commit | 15e41c7542fba77244ec709a76c49efdc74d450e (patch) | |
tree | 08a86fa9d8e990a70f46121e79ed348b44cc0a33 /include | |
parent | 5c4578f4ad9af0d13638ec72a2bc141227ec8b3c (diff) |
Reduce memory consumption significantly for users of the RTP engine API by storing only the payloads present and in use instead of every possible one.
Review: https://reviewboard.asterisk.org/r/2052/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/rtp_engine.h | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/include/asterisk/rtp_engine.h b/include/asterisk/rtp_engine.h index bd47e42b1..dad2a60f8 100644 --- a/include/asterisk/rtp_engine.h +++ b/include/asterisk/rtp_engine.h @@ -431,10 +431,10 @@ struct ast_rtp_engine { /*! Structure that represents codec and packetization information */ struct ast_rtp_codecs { + /*! Payloads present */ + struct ao2_container *payloads; /*! Codec packetization preferences */ struct ast_codec_pref pref; - /*! Payloads present */ - struct ast_rtp_payload_type payloads[AST_RTP_MAX_PT]; }; /*! Structure that represents the glue that binds an RTP instance to a channel */ @@ -945,6 +945,41 @@ int ast_rtp_instance_get_prop(struct ast_rtp_instance *instance, enum ast_rtp_pr struct ast_rtp_codecs *ast_rtp_instance_get_codecs(struct ast_rtp_instance *instance); /*! + * \brief Initialize an RTP codecs structure + * + * \param codecs The codecs structure to initialize + * + * \retval 0 success + * \retval -1 failure + * + * Example usage: + * + * \code + * struct ast_rtp_codecs codecs; + * ast_rtp_codecs_payloads_initialize(&codecs); + * \endcode + * + * \since 11 + */ +int ast_rtp_codecs_payloads_initialize(struct ast_rtp_codecs *codecs); + +/*! + * \brief Destroy the contents of an RTP codecs structure (but not the structure itself) + * + * \param codecs The codecs structure to destroy the contents of + * + * Example usage: + * + * \code + * struct ast_rtp_codecs codecs; + * ast_rtp_codecs_payloads_destroy(&codecs); + * \endcode + * + * \since 11 + */ +void ast_rtp_codecs_payloads_destroy(struct ast_rtp_codecs *codecs); + +/*! * \brief Clear payload information from an RTP instance * * \param codecs The codecs structure that payloads will be cleared from |