Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
0d2a804c
提交
0d2a804c
authored
2月 03, 2015
作者:
Seven Du
提交者:
Anthony Minessale
5月 27, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7514: make vlc endpoint works with originate in addition to bridge
上级
3efd622c
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
13 行增加
和
13 行删除
+13
-13
mod_vlc.c
src/mod/formats/mod_vlc/mod_vlc.c
+12
-12
switch_core_media.c
src/switch_core_media.c
+1
-1
没有找到文件。
src/mod/formats/mod_vlc/mod_vlc.c
浏览文件 @
0d2a804c
...
@@ -880,6 +880,14 @@ static switch_status_t setup_tech_pvt(switch_core_session_t *osession, switch_co
...
@@ -880,6 +880,14 @@ 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
{
/* hard coded values, could also be set according to var_event if we want to support HD audio or stereo */
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
.
decoded_bytes_per_packet
=
320
*
tech_pvt
->
read_impl
.
number_of_channels
;
}
}
tech_pvt
->
session
=
session
;
tech_pvt
->
session
=
session
;
...
@@ -1115,8 +1123,8 @@ static switch_call_cause_t vlc_outgoing_channel(switch_core_session_t *session,
...
@@ -1115,8 +1123,8 @@ static switch_call_cause_t vlc_outgoing_channel(switch_core_session_t *session,
}
}
if
(
!
codec_str
)
{
if
(
!
codec_str
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_
ERROR
,
"No video codec?
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_
WARNING
,
"No video codec set, default to VP8
\n
"
);
goto
fail
;
codec_str
=
"VP8"
;
}
}
if
(
switch_core_codec_init
(
&
tech_pvt
->
video_codec
,
if
(
switch_core_codec_init
(
&
tech_pvt
->
video_codec
,
...
@@ -1155,11 +1163,6 @@ static switch_call_cause_t vlc_outgoing_channel(switch_core_session_t *session,
...
@@ -1155,11 +1163,6 @@ static switch_call_cause_t vlc_outgoing_channel(switch_core_session_t *session,
switch_core_session_start_video_thread
(
*
new_session
);
switch_core_session_start_video_thread
(
*
new_session
);
switch_channel_set_state
(
channel
,
CS_INIT
);
switch_channel_set_state
(
channel
,
CS_INIT
);
if
(
switch_core_session_thread_launch
(
*
new_session
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Couldn't start session thread.
\n
"
);
goto
fail
;
}
switch_channel_mark_answered
(
channel
);
switch_channel_mark_answered
(
channel
);
// start play
// start play
...
@@ -1209,14 +1212,12 @@ static switch_status_t vlc_read_frame(switch_core_session_t *session, switch_fra
...
@@ -1209,14 +1212,12 @@ static switch_status_t vlc_read_frame(switch_core_session_t *session, switch_fra
tech_pvt
=
switch_core_session_get_private
(
session
);
tech_pvt
=
switch_core_session_get_private
(
session
);
assert
(
tech_pvt
!=
NULL
);
assert
(
tech_pvt
!=
NULL
);
switch_yield
(
20000
);
switch_yield
(
tech_pvt
->
read_impl
.
microseconds_per_packet
);
audio_datalen
=
tech_pvt
->
read_impl
.
decoded_bytes_per_packet
;
audio_datalen
=
tech_pvt
->
read_impl
.
decoded_bytes_per_packet
;
// goto cng;
context
=
tech_pvt
->
context
;
context
=
tech_pvt
->
context
;
assert
(
context
);
switch_
assert
(
context
);
vlc_status
=
libvlc_media_get_state
(
context
->
m
);
vlc_status
=
libvlc_media_get_state
(
context
->
m
);
...
@@ -1230,7 +1231,6 @@ static switch_status_t vlc_read_frame(switch_core_session_t *session, switch_fra
...
@@ -1230,7 +1231,6 @@ static switch_status_t vlc_read_frame(switch_core_session_t *session, switch_fra
if
(
switch_buffer_inuse
(
context
->
audio_buffer
)
>=
audio_datalen
)
{
if
(
switch_buffer_inuse
(
context
->
audio_buffer
)
>=
audio_datalen
)
{
tech_pvt
->
read_frame
.
data
=
tech_pvt
->
audio_data
;
tech_pvt
->
read_frame
.
data
=
tech_pvt
->
audio_data
;
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%d %d\n", (int)switch_buffer_inuse(context->audio_buffer), (int)audio_datalen);
switch_buffer_read
(
context
->
audio_buffer
,
tech_pvt
->
read_frame
.
data
,
audio_datalen
);
switch_buffer_read
(
context
->
audio_buffer
,
tech_pvt
->
read_frame
.
data
,
audio_datalen
);
tech_pvt
->
read_frame
.
datalen
=
audio_datalen
;
tech_pvt
->
read_frame
.
datalen
=
audio_datalen
;
tech_pvt
->
read_frame
.
buflen
=
audio_datalen
;
tech_pvt
->
read_frame
.
buflen
=
audio_datalen
;
...
...
src/switch_core_media.c
浏览文件 @
0d2a804c
...
@@ -9985,7 +9985,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core
...
@@ -9985,7 +9985,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core
}
}
}
}
if
(
switch_channel_test_flag
(
session
->
channel
,
CF_VIDEO_DECODED_READ
))
{
if (switch_channel_test_flag(session->channel, CF_VIDEO_DECODED_READ)
&& (*frame)->img == NULL
) {
switch_status_t decode_status;
switch_status_t decode_status;
(*frame)->img = NULL;
(*frame)->img = NULL;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论