<p>Joshua Colp has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6080">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 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>5 files changed, 26 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/80/6080/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c<br>index f009943..51b5dab 100644<br>--- a/channels/chan_pjsip.c<br>+++ b/channels/chan_pjsip.c<br>@@ -1596,6 +1596,7 @@<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>+                                        ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), ast_format_vp9) != AST_FORMAT_CMP_NOT_EQUAL ||<br>                                     (channel->session->endpoint->media.webrtc &&<br>                                          ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), ast_format_h264) != AST_FORMAT_CMP_NOT_EQUAL)) {<br>                                  /* FIXME Fake RTP write, this will be sent as an RTCP packet. Ideally the<br>diff --git a/include/asterisk/format_cache.h b/include/asterisk/format_cache.h<br>index 92272e8..0675463 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 32ec12d..25aa513 100644<br>--- a/main/codec_builtin.c<br>+++ b/main/codec_builtin.c<br>@@ -820,6 +820,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>@@ -966,6 +973,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(t38);<br>diff --git a/main/format_cache.c b/main/format_cache.c<br>index 302bbf8..1a67ebe 100644<br>--- a/main/format_cache.c<br>+++ b/main/format_cache.c<br>@@ -191,6 +191,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>@@ -345,6 +350,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_t38, NULL);<br>@@ -444,6 +450,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 abd4b1f..fe60c4e 100644<br>--- a/main/rtp_engine.c<br>+++ b/main/rtp_engine.c<br>@@ -3268,9 +3268,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>@@ -3311,6 +3312,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>@@ -3413,4 +3415,4 @@<br>           rtp->engine->set_stream_num(rtp, stream_num);<br>   }<br>     ao2_unlock(rtp);<br>-}<br>\ No newline at end of file<br>+}<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6080">change 6080</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/6080"/><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: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I025a93ed05cf96153d66f36db1839109cc24c5cc </div>
<div style="display:none"> Gerrit-Change-Number: 6080 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@digium.com> </div>