summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-07-24 18:30:59 +0000
committerJoshua Colp <jcolp@digium.com>2017-07-24 18:51:01 +0000
commit10bbf04656658a25b547f3b7201e67d293521169 (patch)
treec56c03407b86097e46fdf0a35329ddeefffc4c23 /main
parent9f263409627df2e3c42cff408cf3bba6ea720295 (diff)
core: Add VP9 passthrough support.
This change adds VP9 as a known codec and creates a cached "vp9" media format for use. Change-Id: I025a93ed05cf96153d66f36db1839109cc24c5cc
Diffstat (limited to 'main')
-rw-r--r--main/codec_builtin.c8
-rw-r--r--main/format_cache.c8
-rw-r--r--main/rtp_engine.c4
3 files changed, 19 insertions, 1 deletions
diff --git a/main/codec_builtin.c b/main/codec_builtin.c
index 96868e674..3f0fdf148 100644
--- a/main/codec_builtin.c
+++ b/main/codec_builtin.c
@@ -789,6 +789,13 @@ static struct ast_codec vp8 = {
.sample_rate = 1000,
};
+static struct ast_codec vp9 = {
+ .name = "vp9",
+ .description = "VP9 video",
+ .type = AST_MEDIA_TYPE_VIDEO,
+ .sample_rate = 1000,
+};
+
static struct ast_codec t140red = {
.name = "red",
.description = "T.140 Realtime Text with redundancy",
@@ -928,6 +935,7 @@ int ast_codec_builtin_init(void)
res |= CODEC_REGISTER_AND_CACHE(h264);
res |= CODEC_REGISTER_AND_CACHE(mpeg4);
res |= CODEC_REGISTER_AND_CACHE(vp8);
+ res |= CODEC_REGISTER_AND_CACHE(vp9);
res |= CODEC_REGISTER_AND_CACHE(t140red);
res |= CODEC_REGISTER_AND_CACHE(t140);
res |= CODEC_REGISTER_AND_CACHE(none);
diff --git a/main/format_cache.c b/main/format_cache.c
index b4d426092..39685e4af 100644
--- a/main/format_cache.c
+++ b/main/format_cache.c
@@ -193,6 +193,11 @@ struct ast_format *ast_format_mp4;
struct ast_format *ast_format_vp8;
/*!
+ * \brief Built-in cached vp9 format.
+ */
+struct ast_format *ast_format_vp9;
+
+/*!
* \brief Built-in cached jpeg format.
*/
struct ast_format *ast_format_jpeg;
@@ -336,6 +341,7 @@ static void format_cache_shutdown(void)
ao2_replace(ast_format_h264, NULL);
ao2_replace(ast_format_mp4, NULL);
ao2_replace(ast_format_vp8, NULL);
+ ao2_replace(ast_format_vp9, NULL);
ao2_replace(ast_format_t140_red, NULL);
ao2_replace(ast_format_t140, NULL);
ao2_replace(ast_format_none, NULL);
@@ -432,6 +438,8 @@ static void set_cached_format(const char *name, struct ast_format *format)
ao2_replace(ast_format_mp4, format);
} else if (!strcmp(name, "vp8")) {
ao2_replace(ast_format_vp8, format);
+ } else if (!strcmp(name, "vp9")) {
+ ao2_replace(ast_format_vp9, format);
} else if (!strcmp(name, "red")) {
ao2_replace(ast_format_t140_red, format);
} else if (!strcmp(name, "t140")) {
diff --git a/main/rtp_engine.c b/main/rtp_engine.c
index 23995a1a3..8d6c337a4 100644
--- a/main/rtp_engine.c
+++ b/main/rtp_engine.c
@@ -3252,9 +3252,10 @@ int ast_rtp_engine_init(void)
set_next_mime_type(ast_format_siren7, 0, "audio", "G7221", 16000);
set_next_mime_type(ast_format_siren14, 0, "audio", "G7221", 32000);
set_next_mime_type(ast_format_g719, 0, "audio", "G719", 48000);
- /* Opus and VP8 */
+ /* Opus, VP8, and VP9 */
set_next_mime_type(ast_format_opus, 0, "audio", "opus", 48000);
set_next_mime_type(ast_format_vp8, 0, "video", "VP8", 90000);
+ set_next_mime_type(ast_format_vp9, 0, "video", "VP9", 90000);
/* Define the static rtp payload mappings */
add_static_payload(0, ast_format_ulaw, 0);
@@ -3295,6 +3296,7 @@ int ast_rtp_engine_init(void)
add_static_payload(105, ast_format_t140_red, 0); /* Real time text chat (with redundancy encoding) */
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(110, ast_format_speex, 0);
add_static_payload(111, ast_format_g726, 0);