Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
56f8c11f
提交
56f8c11f
authored
10月 01, 2010
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor fmtp parser as a core func
上级
76a065ec
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
35 行增加
和
2 行删除
+35
-2
switch_core.h
src/include/switch_core.h
+1
-0
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+12
-2
switch_core_codec.c
src/switch_core_codec.c
+22
-0
没有找到文件。
src/include/switch_core.h
浏览文件 @
56f8c11f
...
...
@@ -1351,6 +1351,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_init_with_bitrate(switch_codec
uint32_t
flags
,
const
switch_codec_settings_t
*
codec_settings
,
switch_memory_pool_t
*
pool
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_codec_copy
(
switch_codec_t
*
codec
,
switch_codec_t
*
new_codec
,
switch_memory_pool_t
*
pool
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_codec_parse_fmtp
(
const
char
*
codec_name
,
const
char
*
fmtp
,
uint32_t
rate
,
switch_codec_fmtp_t
*
codec_fmtp
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_codec_reset
(
switch_codec_t
*
codec
);
/*!
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
56f8c11f
...
...
@@ -4152,6 +4152,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
const
char
*
rm_encoding
;
uint32_t
map_bit_rate
=
0
;
int
codec_ms
=
0
;
switch_codec_fmtp_t
codec_fmtp
=
{
0
};
if
(
x
++
<
skip
)
{
continue
;
...
...
@@ -4197,9 +4198,18 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
map_bit_rate
=
switch_known_bitrate
(
map
->
rm_pt
);
if
(
!
codec_ms
)
{
codec_ms
=
ptime
;
if
(
!
zstr
(
map
->
rm_fmtp
))
{
if
((
switch_core_codec_parse_fmtp
(
map
->
rm_encoding
,
map
->
rm_fmtp
,
map
->
rm_rate
,
&
codec_fmtp
))
==
SWITCH_STATUS_SUCCESS
)
{
if
(
codec_fmtp
.
bits_per_second
)
{
map_bit_rate
=
codec_fmtp
.
bits_per_second
;
}
if
(
codec_fmtp
.
microseconds_per_packet
)
{
ptime
=
(
codec_fmtp
.
microseconds_per_packet
/
1000
);
}
}
}
codec_ms
=
ptime
;
for
(
i
=
first
;
i
<
last
&&
i
<
tech_pvt
->
num_codecs
;
i
++
)
{
const
switch_codec_implementation_t
*
imp
=
tech_pvt
->
codecs
[
i
];
...
...
src/switch_core_codec.c
浏览文件 @
56f8c11f
...
...
@@ -450,6 +450,28 @@ SWITCH_DECLARE(switch_codec_t *) switch_core_session_get_video_write_codec(switc
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_codec_parse_fmtp
(
const
char
*
codec_name
,
const
char
*
fmtp
,
uint32_t
rate
,
switch_codec_fmtp_t
*
codec_fmtp
)
{
switch_codec_interface_t
*
codec_interface
;
switch_status_t
status
=
SWITCH_STATUS_FALSE
;
if
(
zstr
(
codec_name
)
||
zstr
(
fmtp
)
||
!
codec_fmtp
)
{
return
SWITCH_STATUS_FALSE
;
}
memset
(
codec_fmtp
,
0
,
sizeof
(
*
codec_fmtp
));
if
((
codec_interface
=
switch_loadable_module_get_codec_interface
(
codec_name
)))
{
if
(
codec_interface
->
parse_fmtp
)
{
codec_fmtp
->
actual_samples_per_second
=
rate
;
status
=
codec_interface
->
parse_fmtp
(
fmtp
,
codec_fmtp
);
}
UNPROTECT_INTERFACE
(
codec_interface
);
}
return
status
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_codec_reset
(
switch_codec_t
*
codec
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论