Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
f39c9e00
提交
f39c9e00
authored
3月 09, 2016
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-8909 FS-8914
上级
f7c6241f
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
157 行增加
和
120 行删除
+157
-120
switch_core.h
src/include/switch_core.h
+1
-1
switch_types.h
src/include/switch_types.h
+1
-0
conference_file.c
src/mod/applications/mod_conference/conference_file.c
+1
-1
conference_video.c
src/mod/applications/mod_conference/conference_video.c
+4
-4
mod_local_stream.c
src/mod/formats/mod_local_stream/mod_local_stream.c
+17
-15
switch_core_file.c
src/switch_core_file.c
+2
-2
switch_core_media.c
src/switch_core_media.c
+34
-11
switch_ivr_async.c
src/switch_ivr_async.c
+3
-3
switch_ivr_play_say.c
src/switch_ivr_play_say.c
+94
-83
没有找到文件。
src/include/switch_core.h
浏览文件 @
f39c9e00
...
...
@@ -1932,7 +1932,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_close(_In_ switch_file_handle_t
SWITCH_DECLARE
(
switch_status_t
)
switch_core_file_command
(
switch_file_handle_t
*
fh
,
switch_file_command_t
command
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_file_truncate
(
switch_file_handle_t
*
fh
,
int64_t
offset
);
SWITCH_DECLARE
(
switch_bool_t
)
switch_core_file_has_video
(
switch_file_handle_t
*
fh
);
SWITCH_DECLARE
(
switch_bool_t
)
switch_core_file_has_video
(
switch_file_handle_t
*
fh
,
switch_bool_t
CHECK_OPEN
);
///\}
...
...
src/include/switch_types.h
浏览文件 @
f39c9e00
...
...
@@ -1491,6 +1491,7 @@ typedef enum {
CF_VIDEO_BITRATE_UNMANAGABLE
,
CF_VIDEO_ECHO
,
CF_VIDEO_BLANK
,
CF_VIDEO_WRITING
,
CF_SLA_INTERCEPT
,
CF_VIDEO_BREAK
,
CF_AUDIO_PAUSE
,
...
...
src/mod/applications/mod_conference/conference_file.c
浏览文件 @
f39c9e00
...
...
@@ -91,7 +91,7 @@ switch_status_t conference_file_close(conference_obj_t *conference, conference_f
conference_al_close
(
node
->
al
);
}
#endif
if
(
conference
->
playing_video_file
&&
switch_core_file_has_video
(
&
node
->
fh
)
&&
conference
->
canvases
[
0
]
&&
node
->
canvas_id
>
-
1
)
{
if
(
conference
->
playing_video_file
&&
switch_core_file_has_video
(
&
node
->
fh
,
SWITCH_FALSE
)
&&
conference
->
canvases
[
0
]
&&
node
->
canvas_id
>
-
1
)
{
if
(
conference
->
canvases
[
node
->
canvas_id
]
->
timer
.
timer_interface
)
{
conference
->
canvases
[
node
->
canvas_id
]
->
timer
.
interval
=
conference
->
video_fps
.
ms
;
conference
->
canvases
[
node
->
canvas_id
]
->
timer
.
samples
=
conference
->
video_fps
.
samples
;
...
...
src/mod/applications/mod_conference/conference_video.c
浏览文件 @
f39c9e00
...
...
@@ -1586,7 +1586,7 @@ void conference_video_check_recording(conference_obj_t *conference, mcu_canvas_t
continue
;
}
if
(
switch_test_flag
((
&
imember
->
rec
->
fh
),
SWITCH_FILE_OPEN
)
&&
switch_core_file_has_video
(
&
imember
->
rec
->
fh
))
{
if
(
switch_test_flag
((
&
imember
->
rec
->
fh
),
SWITCH_FILE_OPEN
)
&&
switch_core_file_has_video
(
&
imember
->
rec
->
fh
,
SWITCH_TRUE
))
{
switch_core_file_write_video
(
&
imember
->
rec
->
fh
,
frame
);
}
}
...
...
@@ -1696,7 +1696,7 @@ void conference_video_patch_fnode(mcu_canvas_t *canvas, conference_file_node_t *
void
conference_video_fnode_check
(
conference_file_node_t
*
fnode
,
int
canvas_id
)
{
mcu_canvas_t
*
canvas
=
NULL
;
if
(
switch_core_file_has_video
(
&
fnode
->
fh
)
&&
switch_core_file_read_video
(
&
fnode
->
fh
,
NULL
,
SVR_CHECK
)
==
SWITCH_STATUS_BREAK
)
{
if
(
switch_core_file_has_video
(
&
fnode
->
fh
,
SWITCH_TRUE
)
&&
switch_core_file_read_video
(
&
fnode
->
fh
,
NULL
,
SVR_CHECK
)
==
SWITCH_STATUS_BREAK
)
{
int
full_screen
=
0
;
char
*
res_id
=
NULL
;
...
...
@@ -2220,13 +2220,13 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
do_refresh
=
100
;
}
if
(
conference
->
async_fnode
&&
switch_core_file_has_video
(
&
conference
->
async_fnode
->
fh
))
{
if
(
conference
->
async_fnode
&&
switch_core_file_has_video
(
&
conference
->
async_fnode
->
fh
,
SWITCH_TRUE
))
{
check_async_file
=
1
;
file_count
++
;
files_playing
=
1
;
}
if
(
conference
->
fnode
&&
switch_core_file_has_video
(
&
conference
->
fnode
->
fh
))
{
if
(
conference
->
fnode
&&
switch_core_file_has_video
(
&
conference
->
fnode
->
fh
,
SWITCH_TRUE
))
{
check_file
=
1
;
file_count
++
;
files_playing
=
1
;
...
...
src/mod/formats/mod_local_stream/mod_local_stream.c
浏览文件 @
f39c9e00
...
...
@@ -358,7 +358,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
switch_buffer_zero
(
audio_buffer
);
if
(
switch_core_file_has_video
(
&
fh
))
{
if
(
switch_core_file_has_video
(
&
fh
,
SWITCH_FALSE
))
{
flush_video_queue
(
source
->
video_q
);
}
...
...
@@ -425,7 +425,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
}
}
if
(
title
&&
(
source
->
cover_art
||
switch_core_file_has_video
(
&
fh
)))
{
if
(
title
&&
(
source
->
cover_art
||
switch_core_file_has_video
(
&
fh
,
SWITCH_TRUE
)))
{
const
char
*
format
=
"#cccccc:#333333:FreeSans.ttf:3%:"
;
if
(
artist
)
{
...
...
@@ -466,7 +466,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
}
if
(
switch_core_file_has_video
(
&
source
->
chime_fh
))
{
if
(
switch_core_file_has_video
(
&
source
->
chime_fh
,
SWITCH_FALSE
))
{
flush_video_queue
(
source
->
video_q
);
}
...
...
@@ -479,7 +479,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
retry:
source
->
has_video
=
switch_core_file_has_video
(
use_fh
)
||
source
->
cover_art
||
source
->
banner_txt
;
source
->
has_video
=
switch_core_file_has_video
(
use_fh
,
SWITCH_TRUE
)
||
source
->
cover_art
||
source
->
banner_txt
;
is_open
=
switch_test_flag
(
use_fh
,
SWITCH_FILE_OPEN
);
...
...
@@ -503,10 +503,10 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
if
(
is_open
)
{
int
svr
=
0
;
if
(
switch_core_has_video
()
&&
switch_core_file_has_video
(
use_fh
))
{
if
(
switch_core_has_video
()
&&
switch_core_file_has_video
(
use_fh
,
SWITCH_TRUE
))
{
switch_frame_t
vid_frame
=
{
0
};
if
(
use_fh
==
&
source
->
chime_fh
&&
switch_core_file_has_video
(
&
fh
))
{
if
(
use_fh
==
&
source
->
chime_fh
&&
switch_core_file_has_video
(
&
fh
,
SWITCH_TRUE
))
{
if
(
switch_core_file_read_video
(
&
fh
,
&
vid_frame
,
svr
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_img_free
(
&
vid_frame
.
img
);
}
...
...
@@ -599,14 +599,6 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
switch_mutex_lock
(
cp
->
audio_mutex
);
if
(
switch_test_flag
(
cp
->
handle
,
SWITCH_FILE_OPEN
))
{
if
(
source
->
has_video
&&
!
switch_test_flag
(
cp
->
handle
,
SWITCH_FILE_FLAG_VIDEO
))
{
switch_set_flag_locked
(
cp
->
handle
,
SWITCH_FILE_FLAG_VIDEO
);
}
else
{
if
(
switch_test_flag
(
cp
->
handle
,
SWITCH_FILE_FLAG_VIDEO
))
{
switch_clear_flag_locked
(
cp
->
handle
,
SWITCH_FILE_FLAG_VIDEO
);
}
}
if
(
switch_test_flag
(
cp
->
handle
,
SWITCH_FILE_CALLBACK
))
{
switch_mutex_unlock
(
cp
->
audio_mutex
);
continue
;
...
...
@@ -992,7 +984,7 @@ static switch_status_t local_stream_file_read_video(switch_file_handle_t *handle
return
SWITCH_STATUS_FALSE
;
}
while
(
switch_queue_size
(
context
->
video_q
)
<
5
)
{
while
(
!
(
flags
&
SVR_BLOCK
)
&&
switch_queue_size
(
context
->
video_q
)
<
5
)
{
return
SWITCH_STATUS_BREAK
;
}
...
...
@@ -1094,6 +1086,16 @@ static switch_status_t local_stream_file_read(switch_file_handle_t *handle, void
*
len
=
0
;
return
SWITCH_STATUS_FALSE
;
}
if
(
context
->
source
->
has_video
)
{
if
(
!
switch_test_flag
(
handle
,
SWITCH_FILE_FLAG_VIDEO
))
{
switch_set_flag_locked
(
handle
,
SWITCH_FILE_FLAG_VIDEO
);
}
}
else
{
if
(
switch_test_flag
(
handle
,
SWITCH_FILE_FLAG_VIDEO
))
{
switch_clear_flag_locked
(
handle
,
SWITCH_FILE_FLAG_VIDEO
);
}
}
switch_mutex_lock
(
context
->
audio_mutex
);
need
=
*
len
*
2
*
context
->
source
->
channels
;
...
...
src/switch_core_file.c
浏览文件 @
f39c9e00
...
...
@@ -495,9 +495,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_read(switch_file_handle_t *fh,
return
status
;
}
SWITCH_DECLARE
(
switch_bool_t
)
switch_core_file_has_video
(
switch_file_handle_t
*
fh
)
SWITCH_DECLARE
(
switch_bool_t
)
switch_core_file_has_video
(
switch_file_handle_t
*
fh
,
switch_bool_t
check_open
)
{
return
(
switch_test_flag
(
fh
,
SWITCH_FILE_OPEN
)
&&
switch_test_flag
(
fh
,
SWITCH_FILE_FLAG_VIDEO
))
?
SWITCH_TRUE
:
SWITCH_FALSE
;
return
(
(
!
check_open
||
switch_test_flag
(
fh
,
SWITCH_FILE_OPEN
)
)
&&
switch_test_flag
(
fh
,
SWITCH_FILE_FLAG_VIDEO
))
?
SWITCH_TRUE
:
SWITCH_FALSE
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_file_write
(
switch_file_handle_t
*
fh
,
void
*
data
,
switch_size_t
*
len
)
...
...
src/switch_core_media.c
浏览文件 @
f39c9e00
...
...
@@ -2667,8 +2667,6 @@ static void switch_core_session_parse_codec_settings(switch_core_session_t *sess
system_bw
=
switch_parse_bandwidth_string
(
bwv
);
printf
(
"%d %d
\n
"
,
engine
->
sdp_bw
,
system_bw
);
if
(
engine
->
sdp_bw
&&
engine
->
sdp_bw
<=
system_bw
)
{
engine
->
codec_settings
.
video
.
bandwidth
=
engine
->
sdp_bw
;
}
else
{
...
...
@@ -5008,6 +5006,7 @@ static void *SWITCH_THREAD_FUNC video_write_thread(switch_thread_t *thread, void
int
buflen
=
SWITCH_RTP_MAX_BUF_LEN
;
switch_timer_t
timer
=
{
0
};
int
fps
;
switch_video_read_flag_t
read_flags
=
SVR_FLUSH
|
SVR_BLOCK
;
if
(
switch_core_session_read_lock
(
session
)
!=
SWITCH_STATUS_SUCCESS
)
{
return
NULL
;
...
...
@@ -5017,6 +5016,8 @@ static void *SWITCH_THREAD_FUNC video_write_thread(switch_thread_t *thread, void
return
NULL
;
}
switch_channel_set_flag
(
session
->
channel
,
CF_VIDEO_WRITING
);
v_engine
=
&
smh
->
engines
[
SWITCH_MEDIA_TYPE_VIDEO
];
...
...
@@ -5054,7 +5055,7 @@ static void *SWITCH_THREAD_FUNC video_write_thread(switch_thread_t *thread, void
}
if
(
smh
->
video_write_fh
&&
!
switch_test_flag
(
smh
->
video_write_fh
,
SWITCH_FILE_FLAG_VIDEO_EOF
))
{
wstatus
=
switch_core_file_read_video
(
smh
->
video_write_fh
,
&
fr
,
SVR_BLOCK
);
wstatus
=
switch_core_file_read_video
(
smh
->
video_write_fh
,
&
fr
,
read_flags
);
if
(
wstatus
==
SWITCH_STATUS_SUCCESS
)
{
switch_core_session_write_video_frame
(
session
,
&
fr
,
SWITCH_IO_FLAG_NONE
,
SVR_FLUSH
);
...
...
@@ -5070,6 +5071,7 @@ static void *SWITCH_THREAD_FUNC video_write_thread(switch_thread_t *thread, void
switch_core_session_rwunlock
(
session
);
switch_channel_clear_flag
(
session
->
channel
,
CF_VIDEO_WRITING
);
smh
->
video_write_thread_running
=
0
;
return
NULL
;
...
...
@@ -5135,11 +5137,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_set_video_file(switch_core_ses
switch_assert
(
session
);
if
(
!
switch_channel_test_flag
(
session
->
channel
,
CF_VIDEO
))
{
if
(
!
(
smh
=
session
->
media_handle
))
{
return
SWITCH_STATUS_FALSE
;
}
if
(
!
(
smh
=
session
->
media_handle
))
{
if
(
!
smh
->
video_read_fh
&&
!
smh
->
video_read_fh
&&
!
switch_channel_test_flag
(
session
->
channel
,
CF_VIDEO
))
{
return
SWITCH_STATUS_FALSE
;
}
if
(
fh
&&
!
switch_core_file_has_video
(
fh
,
SWITCH_TRUE
))
{
return
SWITCH_STATUS_FALSE
;
}
...
...
@@ -5181,9 +5187,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_set_video_file(switch_core_ses
}
else
{
switch_mutex_lock
(
v_engine
->
mh
.
file_write_mutex
);
if
(
fh
&&
smh
->
video_write_fh
)
{
//
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "File is already open\n");
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"File is already open
\n
"
);
smh
->
video_write_fh
=
fh
;
switch_mutex_unlock
(
v_engine
->
mh
.
file_write_mutex
);
return
SWITCH_STATUS_SUCCESS
;
...
...
@@ -5199,7 +5204,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_set_video_file(switch_core_ses
if
(
fh
)
{
switch_threadattr_t
*
thd_attr
=
NULL
;
switch_threadattr_create
(
&
thd_attr
,
switch_core_session_get_pool
(
session
));
switch_threadattr_stacksize_set
(
thd_attr
,
SWITCH_THREAD_STACKSIZE
);
smh
->
video_write_thread_running
=
1
;
...
...
@@ -5208,6 +5213,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_set_video_file(switch_core_ses
if
(
!
fh
&&
smh
->
video_write_thread
)
{
switch_status_t
st
;
if
(
smh
->
video_write_thread_running
>
0
)
{
smh
->
video_write_thread_running
=
-
1
;
}
...
...
@@ -5385,7 +5391,8 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
switch_core_media_gen_key_frame
(
session
);
}
send_blank
=
1
;
if
(
switch_channel_test_flag
(
channel
,
CF_VIDEO_READY
))
{
switch_mutex_lock
(
mh
->
file_read_mutex
);
if
(
smh
->
video_read_fh
&&
switch_test_flag
(
smh
->
video_read_fh
,
SWITCH_FILE_OPEN
)
&&
read_frame
->
img
)
{
...
...
@@ -5393,10 +5400,24 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
send_blank
=
0
;
}
switch_mutex_unlock
(
mh
->
file_read_mutex
);
}
else
if
(
switch_channel_test_flag
(
channel
,
CF_VIDEO_DECODED_READ
)
||
v_engine
->
smode
==
SWITCH_MEDIA_FLOW_SENDONLY
)
{
send_blank
=
1
;
//} else if (switch_channel_test_flag(channel, CF_VIDEO_DECODED_READ) || v_engine->smode == SWITCH_MEDIA_FLOW_SENDONLY) {
//send_blank = 1;
}
if
(
switch_channel_test_flag
(
channel
,
CF_VIDEO_WRITING
)
||
session
->
video_read_callback
)
{
send_blank
=
0
;
}
if
(
send_blank
)
{
if
(
read_frame
&&
(
switch_channel_test_flag
(
channel
,
CF_VIDEO_ECHO
)))
{
switch_core_session_write_video_frame
(
session
,
read_frame
,
SWITCH_IO_FLAG_NONE
,
0
);
}
else
if
(
blank_img
)
{
fr
.
img
=
blank_img
;
switch_yield
(
10000
);
switch_core_session_write_video_frame
(
session
,
&
fr
,
SWITCH_IO_FLAG_FORCE
,
0
);
}
}
#if 0
if (blank_img && (send_blank || switch_channel_test_flag(channel, CF_VIDEO_BLANK)) && !session->video_read_callback) {
fr.img = blank_img;
switch_yield(10000);
...
...
@@ -5404,6 +5425,8 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
} else if (read_frame && (switch_channel_test_flag(channel, CF_VIDEO_ECHO))) {
switch_core_session_write_video_frame(session, read_frame, SWITCH_IO_FLAG_NONE, 0);
}
#endif
}
switch_img_free
(
&
blank_img
);
...
...
src/switch_ivr_async.c
浏览文件 @
f39c9e00
...
...
@@ -1139,7 +1139,7 @@ static void *SWITCH_THREAD_FUNC recording_thread(switch_thread_t *thread, void *
data
=
switch_core_session_alloc
(
session
,
SWITCH_RECOMMENDED_BUFFER_SIZE
);
while
(
switch_test_flag
(
rh
->
fh
,
SWITCH_FILE_OPEN
))
{
if
(
switch_core_file_has_video
(
rh
->
fh
))
{
if
(
switch_core_file_has_video
(
rh
->
fh
,
SWITCH_TRUE
))
{
switch_core_session_get_read_impl
(
session
,
&
read_impl
);
if
(
read_impl
.
decoded_bytes_per_packet
>
0
&&
read_impl
.
decoded_bytes_per_packet
<=
SWITCH_RECOMMENDED_BUFFER_SIZE
)
{
bsize
=
read_impl
.
decoded_bytes_per_packet
;
...
...
@@ -1352,7 +1352,7 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s
}
//if (switch_core_file_has_video(rh->fh)) {
//if (switch_core_file_has_video(rh->fh
, SWITCH_TRUE
)) {
//switch_core_media_set_video_file(session, NULL, SWITCH_RW_READ);
//switch_channel_clear_flag_recursive(session->channel, CF_VIDEO_DECODED_READ);
//}
...
...
@@ -2551,7 +2551,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t
return
SWITCH_STATUS_GENERR
;
}
if
(
switch_core_file_has_video
(
fh
))
{
if
(
switch_core_file_has_video
(
fh
,
SWITCH_TRUE
))
{
//switch_core_media_set_video_file(session, fh, SWITCH_RW_READ);
//switch_channel_set_flag_recursive(session->channel, CF_VIDEO_DECODED_READ);
...
...
src/switch_ivr_play_say.c
浏览文件 @
f39c9e00
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论