<p>Joshua Colp has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6081">View Change</a></p><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, 31 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/81/6081/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/CHANGES b/CHANGES<br>index 5907e13..18248c0 100644<br>--- a/CHANGES<br>+++ b/CHANGES<br>@@ -12,6 +12,11 @@<br> --- Functionality changes from Asterisk 14.6.0 to Asterisk 14.7.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 6a11b59..ad798f4 100644<br>--- a/channels/chan_pjsip.c<br>+++ b/channels/chan_pjsip.c<br>@@ -1409,7 +1409,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 3894ad2..21e5c51 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 96868e6..3f0fdf1 100644<br>--- a/main/codec_builtin.c<br>+++ b/main/codec_builtin.c<br>@@ -789,6 +789,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>@@ -928,6 +935,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 b4d4260..39685e4 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 23995a1..8d6c337 100644<br>--- a/main/rtp_engine.c<br>+++ b/main/rtp_engine.c<br>@@ -3252,9 +3252,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>@@ -3295,6 +3296,7 @@<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(107, ast_format_opus, 0);<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></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6081">change 6081</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/6081"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 14 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I025a93ed05cf96153d66f36db1839109cc24c5cc </div>
<div style="display:none"> Gerrit-Change-Number: 6081 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@digium.com> </div>