Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
68abb39e
提交
68abb39e
authored
10月 30, 2010
作者:
Moises Silva
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mod_sangoma_codec: add iLBC 13.3k and 15.2k
上级
1d5aa062
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
32 行增加
和
26 行删除
+32
-26
mod_sangoma_codec.c
src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c
+32
-26
没有找到文件。
src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c
浏览文件 @
68abb39e
...
...
@@ -85,12 +85,13 @@ vocallo_codec_t g_codec_map[] =
{
{
SNGTC_CODEC_PCMU
,
0
,
"PCMU"
,
"Sangoma PCMU"
,
40
,
64000
,
10000
,
80
,
160
,
80
,
1
},
{
SNGTC_CODEC_PCMA
,
8
,
"PCMA"
,
"Sangoma PCMA"
,
40
,
64000
,
10000
,
80
,
160
,
80
,
1
},
{
SNGTC_CODEC_L16_1
,
10
,
"L16"
,
"Sangoma L16"
,
40
,
120000
,
10000
,
80
,
160
,
160
,
1
},
{
SNGTC_CODEC_G729AB
,
18
,
"G729"
,
"Sangoma G729"
,
40
,
8000
,
10000
,
80
,
160
,
10
,
1
},
{
SNGTC_CODEC_G726_32
,
122
,
"G726-32"
,
"Sangoma G.726 32k"
,
40
,
32000
,
10000
,
80
,
160
,
40
,
1
},
{
SNGTC_CODEC_GSM_FR
,
3
,
"GSM"
,
"Sangoma GSM"
,
20
,
13200
,
20000
,
160
,
320
,
33
,
0
},
{
SNGTC_CODEC_ILBC_133
,
97
,
"iLBC"
,
"Sangoma iLBC 13.3k"
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
0
},
{
SNGTC_CODEC_ILBC_152
,
98
,
"iLBC"
,
"Sangoma iLBC 15.2k"
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
0
},
#if 0
/* FIXME: grandstream crashes with iLBC implementation */
{ SNGTC_CODEC_ILBC, 97, "iLBC", "Sangoma ILBC", -1, -1, -1, -1, -1, -1, 0 },
/* FIXME: sampling rate seems wrong with this, audioooo soooundssssss sloooooow ... */
{ SNGTC_CODEC_G722, 9, "G722", "Sangoma G722", 20, 64000, 20000, 160, 640, 160, 0 },
#endif
...
...
@@ -241,8 +242,8 @@ static int sangoma_create_rtp(void *usr_priv, sngtc_codec_request_leg_t *codec_r
sngtc_codec_ipv4_hex_to_str
(
codec_reply_leg
->
codec_ip
,
codec_ip
);
iana
=
codec_id_to_iana
(
codec_req_leg
->
codec_id
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Creating RTP session for host (%s/%d) vocallo(%s/%d) Iana=%d ms=%d idx=%lu
\n
"
,
local_ip
,
rtp_port
,
codec_ip
,
codec_reply_leg
->
codec_udp_port
,
iana
,
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Creating RTP session for host (%s/%d) vocallo(%s/%d) Iana=%d
CodecId=%d
ms=%d idx=%lu
\n
"
,
local_ip
,
rtp_port
,
codec_ip
,
codec_reply_leg
->
codec_udp_port
,
iana
,
codec_req_leg
->
codec_id
,
codec_req_leg
->
ms
*
1000
,
sess
->
sessid
);
/* create the RTP socket */
...
...
@@ -280,11 +281,11 @@ static switch_status_t switch_sangoma_init(switch_codec_t *codec, switch_codec_f
struct
sangoma_transcoding_session
*
sess
=
NULL
;
vocallo_codec_t
*
vcodec
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Sangoma init called.
\n
"
);
encoding
=
(
flags
&
SWITCH_CODEC_FLAG_ENCODE
);
decoding
=
(
flags
&
SWITCH_CODEC_FLAG_DECODE
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Sangoma init called (encoding = %d, decoding = %d, iana = %d)
\n
"
,
encoding
?
1
:
0
,
decoding
?
1
:
0
,
codec
->
implementation
->
ianacode
);
if
(
!
(
encoding
||
decoding
))
{
return
SWITCH_STATUS_FALSE
;
}
...
...
@@ -331,6 +332,7 @@ static switch_status_t switch_sangoma_init(switch_codec_t *codec, switch_codec_f
switch_snprintf
(
sess
->
hashkey
,
sizeof
(
sess
->
hashkey
),
SANGOMA_SESS_HASH_KEY_FORMAT
,
sess
->
sessid
);
switch_core_hash_insert
(
g_sessions_hash
,
sess
->
hashkey
,
sess
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Sangoma init done for codec %s/%s, iana = %d
\n
"
,
codec
->
implementation
->
iananame
,
vcodec
->
fs_name
,
codec
->
implementation
->
ianacode
);
switch_mutex_unlock
(
g_sessions_lock
);
codec
->
private_info
=
sess
;
...
...
@@ -1162,6 +1164,11 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sangoma_codec_load)
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Loading codecs, register='%s', noregister='%s'
\n
"
,
g_codec_register_list
,
g_codec_noregister_list
);
for
(
c
=
0
;
g_codec_map
[
c
].
codec_id
!=
-
1
;
c
++
)
{
if
(
g_codec_map
[
c
].
codec_id
==
SNGTC_CODEC_L16_1
)
{
/* registering L16 does not make any sense */
continue
;
}
/* check if the codec is in the load list, otherwise skip it */
if
(
strcasecmp
(
g_codec_register_list
,
"all"
)
&&
!
strcasestr
(
g_codec_register_list
,
g_codec_map
[
c
].
iana_name
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Not loading codec %s because was not found in the load list
\n
"
,
...
...
@@ -1241,46 +1248,45 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sangoma_codec_load)
switch_sangoma_destroy
);
/* deinitalize a codec handle using this implementation */
break
;
case
SNGTC_CODEC_ILBC
:
case
SNGTC_CODEC_ILBC
_133
:
switch_core_codec_add_implementation
(
pool
,
codec_interface
,
/* the codec interface we allocated and we want to register with the core */
SWITCH_CODEC_TYPE_AUDIO
,
/* enumeration defining the type of the codec */
g_codec_map
[
c
].
iana
,
/*
the IANA code number, ie http://www.iana.org/assignments/rtp-parameters
*/
g_codec_map
[
c
].
iana
,
/*
97, the IANA code number
*/
g_codec_map
[
c
].
iana_name
,
/* the IANA code name */
"mode=
2
0"
,
/* default fmtp to send (can be overridden by the init function), fmtp is used in SDP for format specific parameters */
"mode=
3
0"
,
/* default fmtp to send (can be overridden by the init function), fmtp is used in SDP for format specific parameters */
8000
,
/* samples transferred per second */
8000
,
/* actual samples transferred per second */
1
52
00
,
/* bits transferred per second */
2
0000
,
/* microseconds per frame */
16
0
,
/* samples per frame */
32
0
,
/* number of bytes per frame decompressed */
38
,
/* number of bytes per frame compressed */
1
33
00
,
/* bits transferred per second */
3
0000
,
/* microseconds per frame */
24
0
,
/* samples per frame */
48
0
,
/* number of bytes per frame decompressed */
50
,
/* number of bytes per frame compressed */
1
,
/* number of channels represented */
1
,
/* number of frames per network packet (I dont think this is used at all) */
switch_sangoma_init
_ilbc
,
/* function to initialize a codec session using this implementation */
switch_sangoma_init
,
/* function to initialize a codec session using this implementation */
switch_sangoma_encode
,
/* function to encode slinear data into encoded data */
switch_sangoma_decode
,
/* function to decode encoded data into slinear data */
switch_sangoma_destroy
);
/* deinitalize a codec handle using this implementation */
#if 0
break
;
case
SNGTC_CODEC_ILBC_152
:
switch_core_codec_add_implementation
(
pool
,
codec_interface
,
/* the codec interface we allocated and we want to register with the core */
SWITCH_CODEC_TYPE_AUDIO
,
/* enumeration defining the type of the codec */
g_codec_map[c].iana, /*
97, the IANA code number
*/
g_codec_map
[
c
].
iana
,
/*
the IANA code number, ie http://www.iana.org/assignments/rtp-parameters
*/
g_codec_map
[
c
].
iana_name
,
/* the IANA code name */
"mode=
3
0", /* default fmtp to send (can be overridden by the init function), fmtp is used in SDP for format specific parameters */
"mode=
2
0"
,
/* default fmtp to send (can be overridden by the init function), fmtp is used in SDP for format specific parameters */
8000
,
/* samples transferred per second */
8000
,
/* actual samples transferred per second */
1
33
00, /* bits transferred per second */
3
0000, /* microseconds per frame */
24
0, /* samples per frame */
48
0, /* number of bytes per frame decompressed */
50
, /* number of bytes per frame compressed */
1
52
00
,
/* bits transferred per second */
2
0000
,
/* microseconds per frame */
16
0
,
/* samples per frame */
32
0
,
/* number of bytes per frame decompressed */
38
,
/* number of bytes per frame compressed */
1
,
/* number of channels represented */
1
,
/* number of frames per network packet (I dont think this is used at all) */
switch_sangoma_init, /* function to initialize a codec session using this implementation */
switch_sangoma_init
_ilbc
,
/* function to initialize a codec session using this implementation */
switch_sangoma_encode
,
/* function to encode slinear data into encoded data */
switch_sangoma_decode
,
/* function to decode encoded data into slinear data */
switch_sangoma_destroy
);
/* deinitalize a codec handle using this implementation */
#endif
break
;
case
SNGTC_CODEC_G722
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论