core: Add H.265/HEVC passthrough support

This change adds H.265/HEVC as a known codec and creates a cached
"h265" media format for use.

Note that RFC 7798 section 7.2 also describes additional SDP
parameters. Handling of these is not yet supported.

ASTERISK-28512

Change-Id: I26d262cc4110b4f7e99348a3ddc53bad0d2cd1f2
This commit is contained in:
Florian Floimair
2019-08-22 14:44:07 +02:00
parent 32ce6e9a06
commit c18983207d
6 changed files with 30 additions and 0 deletions

View File

@@ -806,6 +806,13 @@ static struct ast_codec h264 = {
.sample_rate = 1000,
};
static struct ast_codec h265 = {
.name = "h265",
.description = "H.265 video",
.type = AST_MEDIA_TYPE_VIDEO,
.sample_rate = 1000,
};
static struct ast_codec mpeg4 = {
.name = "mpeg4",
.description = "MPEG4 video",
@@ -971,6 +978,7 @@ int ast_codec_builtin_init(void)
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);

View File

@@ -180,6 +180,11 @@ struct ast_format *ast_format_h263p;
*/
struct ast_format *ast_format_h264;
/*!
* \brief Built-in cached h265 format.
*/
struct ast_format *ast_format_h265;
/*!
* \brief Built-in cached mp4 format.
*/
@@ -348,6 +353,7 @@ static void format_cache_shutdown(void)
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);
@@ -446,6 +452,8 @@ static void set_cached_format(const char *name, struct ast_format *format)
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")) {

View File

@@ -3611,6 +3611,7 @@ int ast_rtp_engine_init(void)
set_next_mime_type(ast_format_h263, 0, "video", "H263", 90000);
set_next_mime_type(ast_format_h263p, 0, "video", "h263-1998", 90000);
set_next_mime_type(ast_format_h264, 0, "video", "H264", 90000);
set_next_mime_type(ast_format_h265, 0, "video", "H265", 90000);
set_next_mime_type(ast_format_mp4, 0, "video", "MP4V-ES", 90000);
set_next_mime_type(ast_format_t140_red, 0, "text", "RED", 1000);
set_next_mime_type(ast_format_t140, 0, "text", "T140", 1000);
@@ -3662,6 +3663,7 @@ int ast_rtp_engine_init(void)
add_static_payload(106, ast_format_t140, 0); /* Real time text chat */
add_static_payload(107, ast_format_opus, 0);
add_static_payload(108, ast_format_vp9, 0);
add_static_payload(109, ast_format_h265, 0);
add_static_payload(110, ast_format_speex, 0);
add_static_payload(111, ast_format_g726, 0);