forked from traud/asterisk-evs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodec_evs.patch
69 lines (64 loc) · 2.1 KB
/
codec_evs.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
--- include/asterisk/format_cache.h (Asterisk 13.13.1)
+++ include/asterisk/format_cache.h (working copy)
@@ -234,2 +234,7 @@
/*!
+ * \brief Built-in cached 3GPP EVS format.
+ */
+extern struct ast_format *ast_format_evs;
+
+/*!
* \brief Initialize format cache support within the core.
--- main/codec_builtin.c (Asterisk 13.13.1)
+++ main/codec_builtin.c (working copy)
@@ -855,2 +855,13 @@
+
+static struct ast_codec evs = {
+ .name = "evs",
+ .description = "3GPP EVS",
+ .type = AST_MEDIA_TYPE_AUDIO,
+ .sample_rate = 16000,
+ .minimum_ms = 20,
+ .maximum_ms = 300,
+ .default_ms = 20,
+};
+
#define CODEC_REGISTER_AND_CACHE(codec) \
@@ -887,2 +898,4 @@
+ res |= CODEC_REGISTER_AND_CACHE(evs);
+
res |= CODEC_REGISTER_AND_CACHE(g723);
--- main/format_cache.c (Asterisk 13.13.1)
+++ main/format_cache.c (working copy)
@@ -220,2 +220,7 @@
/*!
+ * \brief Built-in cached 3GPP EVS format.
+ */
+struct ast_format *ast_format_evs;
+
+/*!
* \brief Built-in cached t140 format.
@@ -302,2 +307,4 @@
+ ao2_replace(ast_format_evs, NULL);
+
ao2_replace(ast_format_g723, NULL);
@@ -416,2 +423,4 @@
ao2_replace(ast_format_g719, format);
+ } else if (!strcmp(name, "evs")) {
+ ao2_replace(ast_format_evs, format);
} else if (!strcmp(name, "opus")) {
--- main/rtp_engine.c 2024-12-28 02:22:04.888730659 +0000
+++ main/rtp_engine.c 2024-12-28 02:24:39.553838441 +0000
@@ -3905,6 +3905,7 @@
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);
+ set_next_mime_type(ast_format_evs, 0, "audio", "EVS", 16000);
/* Define the static rtp payload mappings */
add_static_payload(0, ast_format_ulaw, 0);
@@ -3945,6 +3946,7 @@
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);
+ ast_rtp_engine_load_format(ast_format_evs);
add_static_payload(108, ast_format_vp9, 0);
add_static_payload(109, ast_format_h265, 0);