<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/6079">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Sean Bright: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, but someone else must approve
  Matthew Fredrickson: Looks good to me, approved
  Joshua Colp: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">core: Add VP9 passthrough support.<br><br>This change adds VP9 as a known codec and creates a cached<br>"vp9" media format for use.<br><br>Change-Id: I025a93ed05cf96153d66f36db1839109cc24c5cc<br>---<br>M CHANGES<br>M channels/chan_pjsip.c<br>M include/asterisk/format_cache.h<br>M main/codec_builtin.c<br>M main/format_cache.c<br>M main/rtp_engine.c<br>6 files changed, 32 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/CHANGES b/CHANGES<br>index c7d801d..6407d13 100644<br>--- a/CHANGES<br>+++ b/CHANGES<br>@@ -12,6 +12,11 @@<br> --- Functionality changes from Asterisk 13.17.0 to Asterisk 13.18.0 ----------<br> ------------------------------------------------------------------------------<br> <br>+Core<br>+------------------<br>+ * VP9 is now a supported passthrough video codec and it can be used by<br>+   specifying "vp9" in the allow line.<br>+<br> res_musiconhold<br> ------------------<br>  * By default, when res_musiconhold reloads or unloads, it sends a HUP signal<br>diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c<br>index e2fd13c..c542e14 100644<br>--- a/channels/chan_pjsip.c<br>+++ b/channels/chan_pjsip.c<br>@@ -1376,7 +1376,8 @@<br>                         /* FIXME: Only use this for VP8. Additional work would have to be done to<br>                      * fully support other video codecs */<br> <br>-                    if (ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), ast_format_vp8) != AST_FORMAT_CMP_NOT_EQUAL) {<br>+                        if (ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), ast_format_vp8) != AST_FORMAT_CMP_NOT_EQUAL ||<br>+                                ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), ast_format_vp9) != AST_FORMAT_CMP_NOT_EQUAL) {<br>                             /* FIXME Fake RTP write, this will be sent as an RTCP packet. Ideally the<br>                              * RTP engine would provide a way to externally write/schedule RTCP<br>                            * packets */<br>diff --git a/include/asterisk/format_cache.h b/include/asterisk/format_cache.h<br>index ff03bb4..d716cea 100644<br>--- a/include/asterisk/format_cache.h<br>+++ b/include/asterisk/format_cache.h<br>@@ -184,6 +184,11 @@<br> extern struct ast_format *ast_format_vp8;<br> <br> /*!<br>+ * \brief Built-in cached vp9 format.<br>+ */<br>+extern struct ast_format *ast_format_vp9;<br>+<br>+/*!<br>  * \brief Built-in cached jpeg format.<br>  */<br> extern struct ast_format *ast_format_jpeg;<br>diff --git a/main/codec_builtin.c b/main/codec_builtin.c<br>index 5fdfa7e..9ba33ee 100644<br>--- a/main/codec_builtin.c<br>+++ b/main/codec_builtin.c<br>@@ -783,6 +783,13 @@<br>   .sample_rate = 1000,<br> };<br> <br>+static struct ast_codec vp9 = {<br>+       .name = "vp9",<br>+     .description = "VP9 video",<br>+        .type = AST_MEDIA_TYPE_VIDEO,<br>+        .sample_rate = 1000,<br>+};<br>+<br> static struct ast_codec t140red = {<br>    .name = "red",<br>      .description = "T.140 Realtime Text with redundancy",<br>@@ -922,6 +929,7 @@<br>  res |= CODEC_REGISTER_AND_CACHE(h264);<br>        res |= CODEC_REGISTER_AND_CACHE(mpeg4);<br>       res |= CODEC_REGISTER_AND_CACHE(vp8);<br>+        res |= CODEC_REGISTER_AND_CACHE(vp9);<br>         res |= CODEC_REGISTER_AND_CACHE(t140red);<br>     res |= CODEC_REGISTER_AND_CACHE(t140);<br>        res |= CODEC_REGISTER_AND_CACHE(none);<br>diff --git a/main/format_cache.c b/main/format_cache.c<br>index 74ebfe8..00563e8 100644<br>--- a/main/format_cache.c<br>+++ b/main/format_cache.c<br>@@ -193,6 +193,11 @@<br> struct ast_format *ast_format_vp8;<br> <br> /*!<br>+ * \brief Built-in cached vp9 format.<br>+ */<br>+struct ast_format *ast_format_vp9;<br>+<br>+/*!<br>  * \brief Built-in cached jpeg format.<br>  */<br> struct ast_format *ast_format_jpeg;<br>@@ -336,6 +341,7 @@<br>         ao2_replace(ast_format_h264, NULL);<br>   ao2_replace(ast_format_mp4, NULL);<br>    ao2_replace(ast_format_vp8, NULL);<br>+   ao2_replace(ast_format_vp9, NULL);<br>    ao2_replace(ast_format_t140_red, NULL);<br>       ao2_replace(ast_format_t140, NULL);<br>   ao2_replace(ast_format_none, NULL);<br>@@ -432,6 +438,8 @@<br>              ao2_replace(ast_format_mp4, format);<br>  } else if (!strcmp(name, "vp8")) {<br>          ao2_replace(ast_format_vp8, format);<br>+ } else if (!strcmp(name, "vp9")) {<br>+         ao2_replace(ast_format_vp9, format);<br>  } else if (!strcmp(name, "red")) {<br>          ao2_replace(ast_format_t140_red, format);<br>     } else if (!strcmp(name, "t140")) {<br>diff --git a/main/rtp_engine.c b/main/rtp_engine.c<br>index 3377087..11c1b93 100644<br>--- a/main/rtp_engine.c<br>+++ b/main/rtp_engine.c<br>@@ -2695,9 +2695,10 @@<br>    set_next_mime_type(ast_format_siren7, 0, "audio", "G7221", 16000);<br>        set_next_mime_type(ast_format_siren14, 0, "audio", "G7221", 32000);<br>       set_next_mime_type(ast_format_g719, 0, "audio", "G719", 48000);<br>-  /* Opus and VP8 */<br>+   /* Opus, VP8, and VP9 */<br>      set_next_mime_type(ast_format_opus, 0,  "audio", "opus", 48000);<br>  set_next_mime_type(ast_format_vp8, 0,  "video", "VP8", 90000);<br>+   set_next_mime_type(ast_format_vp9, 0, "video", "VP9", 90000);<br> <br>  /* Define the static rtp payload mappings */<br>  add_static_payload(0, ast_format_ulaw, 0);<br>@@ -2730,6 +2731,8 @@<br>     add_static_payload(104, ast_format_mp4, 0);<br>   add_static_payload(105, ast_format_t140_red, 0);   /* Real time text chat (with redundancy encoding) */<br>       add_static_payload(106, ast_format_t140, 0);     /* Real time text chat */<br>+   add_static_payload(108, ast_format_vp9, 0);<br>+<br>        add_static_payload(110, ast_format_speex, 0);<br>         add_static_payload(111, ast_format_g726, 0);<br>  add_static_payload(112, ast_format_g726_aal2, 0);<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6079">change 6079</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/6079"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I025a93ed05cf96153d66f36db1839109cc24c5cc </div>
<div style="display:none"> Gerrit-Change-Number: 6079 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@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: Matthew Fredrickson <creslin@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>