Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
455c2098
提交
455c2098
authored
2月 28, 2015
作者:
Seven Du
提交者:
Michael Jerris
5月 28, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7514: vlc endpoint stereo support, add vlc_rate and vlc_channels
上级
500b32b3
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
23 行增加
和
8 行删除
+23
-8
mod_vlc.c
src/mod/formats/mod_vlc/mod_vlc.c
+23
-8
没有找到文件。
src/mod/formats/mod_vlc/mod_vlc.c
浏览文件 @
455c2098
...
@@ -1873,7 +1873,7 @@ switch_io_routines_t vlc_io_routines = {
...
@@ -1873,7 +1873,7 @@ switch_io_routines_t vlc_io_routines = {
/*state_run*/
NULL
/*state_run*/
NULL
};
};
static
switch_status_t
setup_tech_pvt
(
switch_core_session_t
*
osession
,
switch_core_session_t
*
session
,
const
char
*
path
)
static
switch_status_t
setup_tech_pvt
(
switch_core_session_t
*
osession
,
switch_core_session_t
*
session
,
switch_event_t
*
var_event
,
const
char
*
path
)
{
{
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
switch_memory_pool_t
*
pool
=
switch_core_session_get_pool
(
session
);
switch_memory_pool_t
*
pool
=
switch_core_session_get_pool
(
session
);
...
@@ -1890,13 +1890,29 @@ static switch_status_t setup_tech_pvt(switch_core_session_t *osession, switch_co
...
@@ -1890,13 +1890,29 @@ static switch_status_t setup_tech_pvt(switch_core_session_t *osession, switch_co
if
(
osession
)
{
if
(
osession
)
{
switch_core_session_get_read_impl
(
osession
,
&
tech_pvt
->
read_impl
);
switch_core_session_get_read_impl
(
osession
,
&
tech_pvt
->
read_impl
);
}
else
{
}
else
{
/* hard coded values, could also be set according to var_event if we want to support HD audio or stereo */
const
char
*
val
;
int
tmp
=
0
;
tech_pvt
->
read_impl
.
microseconds_per_packet
=
20000
;
tech_pvt
->
read_impl
.
microseconds_per_packet
=
20000
;
tech_pvt
->
read_impl
.
samples_per_packet
=
8000
;
tech_pvt
->
read_impl
.
actual_samples_per_second
=
tech_pvt
->
read_impl
.
samples_per_packet
;
tech_pvt
->
read_impl
.
number_of_channels
=
1
;
tech_pvt
->
read_impl
.
iananame
=
"L16"
;
tech_pvt
->
read_impl
.
iananame
=
"L16"
;
tech_pvt
->
read_impl
.
decoded_bytes_per_packet
=
320
*
tech_pvt
->
read_impl
.
number_of_channels
;
val
=
switch_event_get_header
(
var_event
,
"vlc_rate"
);
if
(
val
)
tmp
=
atoi
(
val
);
if
(
tmp
==
0
)
tmp
=
8000
;
tech_pvt
->
read_impl
.
samples_per_second
=
tmp
;
tech_pvt
->
read_impl
.
actual_samples_per_second
=
tmp
;
tech_pvt
->
read_impl
.
samples_per_packet
=
tech_pvt
->
read_impl
.
samples_per_second
/
(
tech_pvt
->
read_impl
.
microseconds_per_packet
/
1000
);
tmp
=
0
;
val
=
switch_event_get_header
(
var_event
,
"vlc_channels"
);
if
(
val
)
tmp
=
atoi
(
val
);
if
(
tmp
==
0
)
{
tmp
=
1
;
}
else
if
(
tmp
>
2
)
{
tmp
=
2
;
}
tech_pvt
->
read_impl
.
number_of_channels
=
tmp
;
tech_pvt
->
read_impl
.
decoded_bytes_per_packet
=
tech_pvt
->
read_impl
.
samples_per_packet
*
2
*
tech_pvt
->
read_impl
.
number_of_channels
;
}
}
tech_pvt
->
session
=
session
;
tech_pvt
->
session
=
session
;
...
@@ -1907,7 +1923,6 @@ static switch_status_t setup_tech_pvt(switch_core_session_t *osession, switch_co
...
@@ -1907,7 +1923,6 @@ static switch_status_t setup_tech_pvt(switch_core_session_t *osession, switch_co
switch_core_session_set_private
(
session
,
tech_pvt
);
switch_core_session_set_private
(
session
,
tech_pvt
);
context
=
switch_core_session_alloc
(
session
,
sizeof
(
vlc_video_context_t
));
context
=
switch_core_session_alloc
(
session
,
sizeof
(
vlc_video_context_t
));
switch_assert
(
context
);
memset
(
context
,
0
,
sizeof
(
vlc_file_context_t
));
memset
(
context
,
0
,
sizeof
(
vlc_file_context_t
));
tech_pvt
->
context
=
context
;
tech_pvt
->
context
=
context
;
context
->
vlc_handle
=
libvlc_new
(
sizeof
(
vlc_args
)
/
sizeof
(
char
*
),
vlc_args
);
context
->
vlc_handle
=
libvlc_new
(
sizeof
(
vlc_args
)
/
sizeof
(
char
*
),
vlc_args
);
...
@@ -2094,7 +2109,7 @@ static switch_call_cause_t vlc_outgoing_channel(switch_core_session_t *session,
...
@@ -2094,7 +2109,7 @@ static switch_call_cause_t vlc_outgoing_channel(switch_core_session_t *session,
switch_channel_set_name
(
channel
,
name
);
switch_channel_set_name
(
channel
,
name
);
switch_channel_set_flag
(
channel
,
CF_VIDEO
);
switch_channel_set_flag
(
channel
,
CF_VIDEO
);
if
(
setup_tech_pvt
(
session
,
*
new_session
,
outbound_profile
->
destination_number
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
setup_tech_pvt
(
session
,
*
new_session
,
var_event
,
outbound_profile
->
destination_number
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Error steup tech_pvt!
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Error steup tech_pvt!
\n
"
);
goto
fail
;
goto
fail
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论