<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/5818">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">SDP: Add get/set option calls for RTP sched context per type.<br><br>Change-Id: I82dc75c63c48904e9e5a49e2205dcc06e88487e4<br>---<br>M include/asterisk/sdp_options.h<br>M main/sdp_options.c<br>M main/sdp_private.h<br>M main/sdp_state.c<br>4 files changed, 62 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/include/asterisk/sdp_options.h b/include/asterisk/sdp_options.h<br>index f49b794..b8c1bbd 100644<br>--- a/include/asterisk/sdp_options.h<br>+++ b/include/asterisk/sdp_options.h<br>@@ -522,4 +522,29 @@<br> */<br> unsigned int ast_sdp_options_get_ssrc(const struct ast_sdp_options *options);<br> <br>+/*!<br>+ * \brief Set the SDP options scheduler context used to create new streams of the type.<br>+ * \since 15.0.0<br>+ *<br>+ * \param options SDP Options<br>+ * \param type Media type the scheduler context is for.<br>+ * \param sched Scheduler context to use for the specified media type.<br>+ *<br>+ * \return Nothing<br>+ */<br>+void ast_sdp_options_set_sched_type(struct ast_sdp_options *options,<br>+ enum ast_media_type type, struct ast_sched_context *sched);<br>+<br>+/*!<br>+ * \brief Get the SDP options scheduler context used to create new streams of the type.<br>+ * \since 15.0.0<br>+ *<br>+ * \param options SDP Options<br>+ * \param type Media type the format cap represents.<br>+ *<br>+ * \return The stored scheduler context to create new streams of the type.<br>+ */<br>+struct ast_sched_context *ast_sdp_options_get_sched_type(const struct ast_sdp_options *options,<br>+ enum ast_media_type type);<br>+<br> #endif /* _ASTERISK_SDP_OPTIONS_H */<br>diff --git a/main/sdp_options.c b/main/sdp_options.c<br>index ab8fb29..a938583 100644<br>--- a/main/sdp_options.c<br>+++ b/main/sdp_options.c<br>@@ -77,6 +77,39 @@<br> DEFINE_GETTERS_SETTERS_FOR(enum ast_sdp_options_encryption, encryption);<br> DEFINE_GETTERS_SETTERS_FOR(unsigned int, ssrc);<br> <br>+struct ast_sched_context *ast_sdp_options_get_sched_type(const struct ast_sdp_options *options, enum ast_media_type type)<br>+{<br>+ struct ast_sched_context *sched = NULL;<br>+<br>+ switch (type) {<br>+ case AST_MEDIA_TYPE_AUDIO:<br>+ case AST_MEDIA_TYPE_VIDEO:<br>+ case AST_MEDIA_TYPE_IMAGE:<br>+ case AST_MEDIA_TYPE_TEXT:<br>+ sched = options->sched[type];<br>+ break;<br>+ case AST_MEDIA_TYPE_UNKNOWN:<br>+ case AST_MEDIA_TYPE_END:<br>+ break;<br>+ }<br>+ return sched;<br>+}<br>+<br>+void ast_sdp_options_set_sched_type(struct ast_sdp_options *options, enum ast_media_type type, struct ast_sched_context *sched)<br>+{<br>+ switch (type) {<br>+ case AST_MEDIA_TYPE_AUDIO:<br>+ case AST_MEDIA_TYPE_VIDEO:<br>+ case AST_MEDIA_TYPE_IMAGE:<br>+ case AST_MEDIA_TYPE_TEXT:<br>+ options->sched[type] = sched;<br>+ break;<br>+ case AST_MEDIA_TYPE_UNKNOWN:<br>+ case AST_MEDIA_TYPE_END:<br>+ break;<br>+ }<br>+}<br>+<br> static void set_defaults(struct ast_sdp_options *options)<br> {<br> options->dtmf = DEFAULT_DTMF;<br>diff --git a/main/sdp_private.h b/main/sdp_private.h<br>index a0b63df..62228a5 100644<br>--- a/main/sdp_private.h<br>+++ b/main/sdp_private.h<br>@@ -35,6 +35,8 @@<br> /*! RTP Engine Name */<br> AST_STRING_FIELD(rtp_engine);<br> );<br>+ /*! Scheduler context for the media stream types (Mainly for RTP) */<br>+ struct ast_sched_context *sched[AST_MEDIA_TYPE_END];<br> struct {<br> unsigned int rtp_symmetric:1;<br> unsigned int udptl_symmetric:1;<br>diff --git a/main/sdp_state.c b/main/sdp_state.c<br>index 0f06bf9..99421ad 100644<br>--- a/main/sdp_state.c<br>+++ b/main/sdp_state.c<br>@@ -151,12 +151,6 @@<br> ast_free(capabilities);<br> }<br> <br>-/* TODO<br>- * This isn't set anywhere yet.<br>- */<br>-/*! \brief Scheduler for RTCP purposes */<br>-static struct ast_sched_context *sched;<br>-<br> /*! \brief Internal function which creates an RTP instance */<br> static struct sdp_state_rtp *create_rtp(const struct ast_sdp_options *options,<br> enum ast_media_type media_type)<br>@@ -185,7 +179,8 @@<br> return NULL;<br> }<br> <br>- rtp->instance = ast_rtp_instance_new(options->rtp_engine, sched, media_address, NULL);<br>+ rtp->instance = ast_rtp_instance_new(options->rtp_engine,<br>+ ast_sdp_options_get_sched_type(options, media_type), media_address, NULL);<br> if (!rtp->instance) {<br> ast_log(LOG_ERROR, "Unable to create RTP instance using RTP engine '%s'\n",<br> options->rtp_engine);<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/5818">change 5818</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/5818"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I82dc75c63c48904e9e5a49e2205dcc06e88487e4 </div>
<div style="display:none"> Gerrit-Change-Number: 5818 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>