--- include/asterisk/format_cache.h +++ include/asterisk/format_cache.h @@ -176,2 +176,7 @@ /*! + * \brief Built-in cached h265 format. + */ +extern struct ast_format *ast_format_h265; + +/*! * \brief Built-in cached mp4 format. --- main/codec_builtin.c +++ main/codec_builtin.c @@ -771,2 +771,9 @@ +static struct ast_codec h265 = { + .name = "h265", + .description = "H.265 video", + .type = AST_MEDIA_TYPE_VIDEO, + .sample_rate = 90000, +}; + static struct ast_codec mpeg4 = { @@ -927,6 +934,7 @@ res |= CODEC_REGISTER_AND_CACHE(h263); res |= CODEC_REGISTER_AND_CACHE(h263p); res |= CODEC_REGISTER_AND_CACHE(h264); + res |= CODEC_REGISTER_AND_CACHE(h265); res |= CODEC_REGISTER_AND_CACHE(mpeg4); res |= CODEC_REGISTER_AND_CACHE(vp8); res |= CODEC_REGISTER_AND_CACHE(vp9); --- main/format_cache.c +++ main/format_cache.c @@ -185,2 +185,7 @@ /*! + * \brief Built-in cached h265 format. + */ +struct ast_format *ast_format_h265; + +/*! * \brief Built-in cached mp4 format. @@ -339,6 +344,7 @@ ao2_replace(ast_format_h263, NULL); ao2_replace(ast_format_h263p, NULL); ao2_replace(ast_format_h264, NULL); + ao2_replace(ast_format_h265, NULL); ao2_replace(ast_format_mp4, NULL); ao2_replace(ast_format_vp8, NULL); ao2_replace(ast_format_vp9, NULL); @@ -434,6 +440,8 @@ ao2_replace(ast_format_h263p, format); } else if (!strcmp(name, "h264")) { ao2_replace(ast_format_h264, format); + } else if (!strcmp(name, "h265")) { + ao2_replace(ast_format_h265, format); } else if (!strcmp(name, "mpeg4")) { ao2_replace(ast_format_mp4, format); } else if (!strcmp(name, "vp8")) { --- main/rtp_engine.c +++ main/rtp_engine.c @@ -2796,2 +2796,4 @@ add_static_payload(107, ast_format_opus, 0); + + ast_rtp_engine_load_format(ast_format_h265);