<p>Florian Floimair has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/12886">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">core: Add H.265/HEVC passthrough support<br><br>This change adds H.265/HEVC as a known codec and creates a cached<br>"h265" media format for use.<br><br>Note that RFC 7798 section 7.2 also describes additional SDP<br>parameters. Handling of these is not yet supported.<br><br>ASTERISK-28512<br><br>Change-Id: I26d262cc4110b4f7e99348a3ddc53bad0d2cd1f2<br>---<br>M channels/chan_pjsip.c<br>A doc/CHANGES-staging/h265-passthrough.txt<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, 30 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/86/12886/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c</span><br><span>index 0035a02..8abdfde 100644</span><br><span>--- a/channels/chan_pjsip.c</span><br><span>+++ b/channels/chan_pjsip.c</span><br><span>@@ -1648,6 +1648,7 @@</span><br><span> </span><br><span>                          if (ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), ast_format_vp8) != AST_FORMAT_CMP_NOT_EQUAL ||</span><br><span>                                        ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), ast_format_vp9) != AST_FORMAT_CMP_NOT_EQUAL ||</span><br><span style="color: hsl(120, 100%, 40%);">+                                     ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), ast_format_h265) != AST_FORMAT_CMP_NOT_EQUAL ||</span><br><span>                                   (channel->session->endpoint->media.webrtc &&</span><br><span>                                         ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), ast_format_h264) != AST_FORMAT_CMP_NOT_EQUAL)) {</span><br><span>                                         /* FIXME Fake RTP write, this will be sent as an RTCP packet. Ideally the</span><br><span>diff --git a/doc/CHANGES-staging/h265-passthrough.txt b/doc/CHANGES-staging/h265-passthrough.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..b2c449a</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/h265-passthrough.txt</span><br><span>@@ -0,0 +1,6 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: Core</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+H.265/HEVC is now a supported video codec and it can be used by</span><br><span style="color: hsl(120, 100%, 40%);">+specifying "h265" in the allow line.</span><br><span style="color: hsl(120, 100%, 40%);">+Please note however, that handling of the additional SDP parameters</span><br><span style="color: hsl(120, 100%, 40%);">+described in RFC 7798 section 7.2 is not yet supported.</span><br><span>diff --git a/include/asterisk/format_cache.h b/include/asterisk/format_cache.h</span><br><span>index 0675463..5a2add6 100644</span><br><span>--- a/include/asterisk/format_cache.h</span><br><span>+++ b/include/asterisk/format_cache.h</span><br><span>@@ -174,6 +174,11 @@</span><br><span> extern struct ast_format *ast_format_h264;</span><br><span> </span><br><span> /*!</span><br><span style="color: hsl(120, 100%, 40%);">+ * \brief Built-in cached h265 format.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+extern struct ast_format *ast_format_h265;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/*!</span><br><span>  * \brief Built-in cached mp4 format.</span><br><span>  */</span><br><span> extern struct ast_format *ast_format_mp4;</span><br><span>diff --git a/main/codec_builtin.c b/main/codec_builtin.c</span><br><span>index 25aa513..ce65754 100644</span><br><span>--- a/main/codec_builtin.c</span><br><span>+++ b/main/codec_builtin.c</span><br><span>@@ -806,6 +806,13 @@</span><br><span>    .sample_rate = 1000,</span><br><span> };</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static struct ast_codec h265 = {</span><br><span style="color: hsl(120, 100%, 40%);">+      .name = "h265",</span><br><span style="color: hsl(120, 100%, 40%);">+     .description = "H.265 video",</span><br><span style="color: hsl(120, 100%, 40%);">+       .type = AST_MEDIA_TYPE_VIDEO,</span><br><span style="color: hsl(120, 100%, 40%);">+ .sample_rate = 1000,</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static struct ast_codec mpeg4 = {</span><br><span>      .name = "mpeg4",</span><br><span>   .description = "MPEG4 video",</span><br><span>@@ -971,6 +978,7 @@</span><br><span>        res |= CODEC_REGISTER_AND_CACHE(h263);</span><br><span>       res |= CODEC_REGISTER_AND_CACHE(h263p);</span><br><span>      res |= CODEC_REGISTER_AND_CACHE(h264);</span><br><span style="color: hsl(120, 100%, 40%);">+        res |= CODEC_REGISTER_AND_CACHE(h265);</span><br><span>       res |= CODEC_REGISTER_AND_CACHE(mpeg4);</span><br><span>      res |= CODEC_REGISTER_AND_CACHE(vp8);</span><br><span>        res |= CODEC_REGISTER_AND_CACHE(vp9);</span><br><span>diff --git a/main/format_cache.c b/main/format_cache.c</span><br><span>index 95ad5ea..fbe659f 100644</span><br><span>--- a/main/format_cache.c</span><br><span>+++ b/main/format_cache.c</span><br><span>@@ -181,6 +181,11 @@</span><br><span> struct ast_format *ast_format_h264;</span><br><span> </span><br><span> /*!</span><br><span style="color: hsl(120, 100%, 40%);">+ * \brief Built-in cached h265 format.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+struct ast_format *ast_format_h265;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/*!</span><br><span>  * \brief Built-in cached mp4 format.</span><br><span>  */</span><br><span> struct ast_format *ast_format_mp4;</span><br><span>@@ -348,6 +353,7 @@</span><br><span>         ao2_replace(ast_format_h263, NULL);</span><br><span>  ao2_replace(ast_format_h263p, NULL);</span><br><span>         ao2_replace(ast_format_h264, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+   ao2_replace(ast_format_h265, NULL);</span><br><span>  ao2_replace(ast_format_mp4, NULL);</span><br><span>   ao2_replace(ast_format_vp8, NULL);</span><br><span>   ao2_replace(ast_format_vp9, NULL);</span><br><span>@@ -446,6 +452,8 @@</span><br><span>             ao2_replace(ast_format_h263p, format);</span><br><span>       } else if (!strcmp(name, "h264")) {</span><br><span>                ao2_replace(ast_format_h264, format);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcmp(name, "h265")) {</span><br><span style="color: hsl(120, 100%, 40%);">+         ao2_replace(ast_format_h265, format);</span><br><span>        } else if (!strcmp(name, "mpeg4")) {</span><br><span>               ao2_replace(ast_format_mp4, format);</span><br><span>         } else if (!strcmp(name, "vp8")) {</span><br><span>diff --git a/main/rtp_engine.c b/main/rtp_engine.c</span><br><span>index 3403d70..ac429ca 100644</span><br><span>--- a/main/rtp_engine.c</span><br><span>+++ b/main/rtp_engine.c</span><br><span>@@ -3611,6 +3611,7 @@</span><br><span>        set_next_mime_type(ast_format_h263, 0, "video", "H263", 90000);</span><br><span>  set_next_mime_type(ast_format_h263p, 0, "video", "h263-1998", 90000);</span><br><span>    set_next_mime_type(ast_format_h264, 0, "video", "H264", 90000);</span><br><span style="color: hsl(120, 100%, 40%);">+   set_next_mime_type(ast_format_h265, 0, "video", "H265", 90000);</span><br><span>  set_next_mime_type(ast_format_mp4, 0, "video", "MP4V-ES", 90000);</span><br><span>        set_next_mime_type(ast_format_t140_red, 0, "text", "RED", 1000);</span><br><span>         set_next_mime_type(ast_format_t140, 0, "text", "T140", 1000);</span><br><span>@@ -3662,6 +3663,7 @@</span><br><span>    add_static_payload(106, ast_format_t140, 0);     /* Real time text chat */</span><br><span>   add_static_payload(107, ast_format_opus, 0);</span><br><span>         add_static_payload(108, ast_format_vp9, 0);</span><br><span style="color: hsl(120, 100%, 40%);">+   add_static_payload(109, ast_format_h265, 0);</span><br><span> </span><br><span>     add_static_payload(110, ast_format_speex, 0);</span><br><span>        add_static_payload(111, ast_format_g726, 0);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/12886">change 12886</a>. To unsubscribe, or for help writing mail filters, 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/c/asterisk/+/12886"/><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-Change-Id: I26d262cc4110b4f7e99348a3ddc53bad0d2cd1f2 </div>
<div style="display:none"> Gerrit-Change-Number: 12886 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Florian Floimair <f.floimair@commend.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>