Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
fdcfcaec
提交
fdcfcaec
authored
3月 11, 2015
作者:
Anthony Minessale
提交者:
Michael Jerris
5月 28, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7500: don't wait for video ready from inside video thread that sets that flag
上级
24254bb1
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
32 行增加
和
10 行删除
+32
-10
switch_core_media.h
src/include/switch_core_media.h
+1
-0
mod_fsv.c
src/mod/applications/mod_fsv/mod_fsv.c
+6
-4
switch_channel.c
src/switch_channel.c
+3
-1
switch_core_media.c
src/switch_core_media.c
+22
-5
没有找到文件。
src/include/switch_core_media.h
浏览文件 @
fdcfcaec
...
...
@@ -326,6 +326,7 @@ SWITCH_DECLARE(void) switch_core_session_stop_media(switch_core_session_t *sessi
SWITCH_DECLARE
(
switch_media_flow_t
)
switch_core_session_media_flow
(
switch_core_session_t
*
session
,
switch_media_type_t
type
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_get_vid_params
(
switch_core_session_t
*
session
,
switch_vid_params_t
*
vid_params
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_set_video_file
(
switch_core_session_t
*
session
,
switch_file_handle_t
*
fh
,
switch_rw_t
rw
);
SWITCH_DECLARE
(
switch_bool_t
)
switch_core_session_in_video_thread
(
switch_core_session_t
*
session
);
SWITCH_END_EXTERN_C
#endif
...
...
src/mod/applications/mod_fsv/mod_fsv.c
浏览文件 @
fdcfcaec
...
...
@@ -670,10 +670,6 @@ static void decode_video_thread(switch_core_session_t *session, void *obj)
goto
done
;
}
switch_channel_set_flag
(
channel
,
CF_VIDEO_DECODED_READ
);
switch_channel_set_flag
(
channel
,
CF_VIDEO_DEBUG_READ
);
switch_channel_set_flag
(
channel
,
CF_VIDEO_DEBUG_WRITE
);
while
(
switch_channel_ready
(
channel
))
{
switch_status_t
status
=
switch_core_session_read_video_frame
(
session
,
&
frame
,
SWITCH_IO_FLAG_NONE
,
0
);
...
...
@@ -687,6 +683,7 @@ static void decode_video_thread(switch_core_session_t *session, void *obj)
}
if
(
frame
&&
frame
->
datalen
>
0
)
{
printf
(
"WTF %p
\n
"
,
(
void
*
)
frame
->
img
);
switch_core_session_write_video_frame
(
session
,
frame
,
SWITCH_IO_FLAG_NONE
,
0
);
}
else
{
continue
;
...
...
@@ -733,6 +730,11 @@ SWITCH_STANDARD_APP(decode_video_function)
switch_channel_answer
(
channel
);
switch_core_session_request_video_refresh
(
session
);
switch_channel_set_flag
(
channel
,
CF_VIDEO_DECODED_READ
);
switch_channel_set_flag
(
channel
,
CF_VIDEO_DEBUG_READ
);
switch_channel_set_flag
(
channel
,
CF_VIDEO_DEBUG_WRITE
);
switch_core_media_start_video_function
(
session
,
decode_video_thread
,
&
max_pictures
);
switch_ivr_play_file
(
session
,
NULL
,
moh
,
NULL
);
...
...
src/switch_channel.c
浏览文件 @
fdcfcaec
...
...
@@ -1831,7 +1831,9 @@ SWITCH_DECLARE(void) switch_channel_set_flag_value(switch_channel_t *channel, sw
}
if
(
flag
==
CF_VIDEO_DECODED_READ
)
{
switch_channel_wait_for_flag
(
channel
,
CF_VIDEO_READY
,
SWITCH_TRUE
,
10000
,
NULL
);
if
(
!
switch_core_session_in_video_thread
(
channel
->
session
))
{
switch_channel_wait_for_flag
(
channel
,
CF_VIDEO_READY
,
SWITCH_TRUE
,
10000
,
NULL
);
}
}
}
...
...
src/switch_core_media.c
浏览文件 @
fdcfcaec
...
...
@@ -159,6 +159,7 @@ typedef struct switch_rtp_engine_s {
switch_codec_settings_t
codec_settings
;
switch_media_flow_t
rmode
;
switch_media_flow_t
smode
;
switch_thread_id_t
thread_id
;
}
switch_rtp_engine_t
;
struct
switch_media_handle_s
{
...
...
@@ -4634,7 +4635,7 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
switch_status_t
status
;
switch_frame_t
*
read_frame
;
switch_media_handle_t
*
smh
;
uint32_t
loops
=
0
,
xloops
=
0
,
vloops
=
0
;
uint32_t
loops
=
0
,
xloops
=
0
,
vloops
=
0
,
viloops
=
0
;
switch_frame_t
fr
=
{
0
};
unsigned
char
*
buf
=
NULL
;
switch_image_t
*
blank_img
=
NULL
;
...
...
@@ -4645,13 +4646,12 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
blank_img
=
switch_img_alloc
(
NULL
,
SWITCH_IMG_FMT_I420
,
320
,
240
,
1
);
switch_img_fill
(
blank_img
,
0
,
0
,
blank_img
->
d_w
,
blank_img
->
d_h
,
&
bgcolor
);
if
(
!
(
smh
=
session
->
media_handle
))
{
return
NULL
;
}
v_engine
=
&
smh
->
engines
[
SWITCH_MEDIA_TYPE_VIDEO
];
v_engine
->
thread_id
=
switch_thread_self
();
switch_core_session_read_lock
(
session
);
...
...
@@ -4731,9 +4731,9 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
if
(
switch_test_flag
(
read_frame
,
SFF_CNG
))
{
continue
;
}
if
(
read_frame
->
img
)
{
if
(
v
loops
>
10
)
{
if
(
++
vi
loops
>
10
)
{
switch_channel_set_flag
(
channel
,
CF_VIDEO_READY
);
smh
->
vid_params
.
width
=
read_frame
->
img
->
d_w
;
smh
->
vid_params
.
height
=
read_frame
->
img
->
d_h
;
...
...
@@ -4884,6 +4884,23 @@ SWITCH_DECLARE(void) switch_core_media_end_video_function(switch_core_session_t
}
}
SWITCH_DECLARE
(
switch_bool_t
)
switch_core_session_in_video_thread
(
switch_core_session_t
*
session
)
{
switch_rtp_engine_t
*
v_engine
;
switch_media_handle_t
*
smh
;
switch_assert
(
session
);
if
(
!
(
smh
=
session
->
media_handle
))
{
return
SWITCH_FALSE
;
}
v_engine
=
&
smh
->
engines
[
SWITCH_MEDIA_TYPE_VIDEO
];
return
switch_thread_equal
(
switch_thread_self
(),
v_engine
->
thread_id
)
?
SWITCH_TRUE
:
SWITCH_FALSE
;
}
//?
#define RA_PTR_LEN 512
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_proxy_remote_addr
(
switch_core_session_t
*
session
,
const
char
*
sdp_str
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论