Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
c701ce61
提交
c701ce61
authored
11月 10, 2016
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-9708 #resolve [RTP timing when doing repacketization]
上级
30c84b4b
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
904 行增加
和
722 行删除
+904
-722
switch_types.h
src/include/switch_types.h
+2
-1
switch_utils.h
src/include/switch_utils.h
+5
-1
conference_video.c
src/mod/applications/mod_conference/conference_video.c
+10
-8
mod_conference.c
src/mod/applications/mod_conference/mod_conference.c
+2
-3
mod_conference.h
src/mod/applications/mod_conference/mod_conference.h
+0
-1
switch_core_io.c
src/switch_core_io.c
+0
-702
switch_core_media.c
src/switch_core_media.c
+854
-1
switch_utils.c
src/switch_utils.c
+31
-5
没有找到文件。
src/include/switch_types.h
浏览文件 @
c701ce61
...
@@ -1861,7 +1861,8 @@ typedef enum {
...
@@ -1861,7 +1861,8 @@ typedef enum {
SWITCH_IO_FLAG_NONE
=
0
,
SWITCH_IO_FLAG_NONE
=
0
,
SWITCH_IO_FLAG_NOBLOCK
=
(
1
<<
0
),
SWITCH_IO_FLAG_NOBLOCK
=
(
1
<<
0
),
SWITCH_IO_FLAG_SINGLE_READ
=
(
1
<<
1
),
SWITCH_IO_FLAG_SINGLE_READ
=
(
1
<<
1
),
SWITCH_IO_FLAG_FORCE
=
(
1
<<
2
)
SWITCH_IO_FLAG_FORCE
=
(
1
<<
2
),
SWITCH_IO_FLAG_QUEUED
=
(
1
<<
3
)
}
switch_io_flag_enum_t
;
}
switch_io_flag_enum_t
;
typedef
uint32_t
switch_io_flag_t
;
typedef
uint32_t
switch_io_flag_t
;
...
...
src/include/switch_utils.h
浏览文件 @
c701ce61
...
@@ -1329,7 +1329,11 @@ SWITCH_DECLARE(void) switch_http_parse_qs(switch_http_request_t *request, char *
...
@@ -1329,7 +1329,11 @@ SWITCH_DECLARE(void) switch_http_parse_qs(switch_http_request_t *request, char *
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_free
(
switch_frame_buffer_t
*
fb
,
switch_frame_t
**
frameP
);
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_free
(
switch_frame_buffer_t
*
fb
,
switch_frame_t
**
frameP
);
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_dup
(
switch_frame_buffer_t
*
fb
,
switch_frame_t
*
orig
,
switch_frame_t
**
clone
);
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_dup
(
switch_frame_buffer_t
*
fb
,
switch_frame_t
*
orig
,
switch_frame_t
**
clone
);
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_destroy
(
switch_frame_buffer_t
**
fbP
);
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_destroy
(
switch_frame_buffer_t
**
fbP
);
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_create
(
switch_frame_buffer_t
**
fbP
);
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_create
(
switch_frame_buffer_t
**
fbP
,
switch_size_t
qlen
);
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_push
(
switch_frame_buffer_t
*
fb
,
void
*
ptr
);
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_trypush
(
switch_frame_buffer_t
*
fb
,
void
*
ptr
);
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_pop
(
switch_frame_buffer_t
*
fb
,
void
**
ptr
);
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_trypop
(
switch_frame_buffer_t
*
fb
,
void
**
ptr
);
typedef
struct
{
typedef
struct
{
int64_t
userms
;
int64_t
userms
;
...
...
src/mod/applications/mod_conference/conference_video.c
浏览文件 @
c701ce61
...
@@ -1326,7 +1326,7 @@ void conference_video_write_canvas_image_to_codec_group(conference_obj_t *confer
...
@@ -1326,7 +1326,7 @@ void conference_video_write_canvas_image_to_codec_group(conference_obj_t *confer
switch_set_flag
(
frame
,
SFF_ENCODED
);
switch_set_flag
(
frame
,
SFF_ENCODED
);
if
(
switch_frame_buffer_dup
(
imember
->
fb
,
frame
,
&
dupframe
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_frame_buffer_dup
(
imember
->
fb
,
frame
,
&
dupframe
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_
queue_trypush
(
imember
->
mux_out_queue
,
dupframe
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_
frame_buffer_trypush
(
imember
->
fb
,
dupframe
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_frame_buffer_free
(
imember
->
fb
,
&
dupframe
);
switch_frame_buffer_free
(
imember
->
fb
,
&
dupframe
);
}
}
dupframe
=
NULL
;
dupframe
=
NULL
;
...
@@ -1529,9 +1529,9 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_write_thread_run(switch_thread_
...
@@ -1529,9 +1529,9 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_write_thread_run(switch_thread_
while
(
conference_utils_member_test_flag
(
member
,
MFLAG_RUNNING
))
{
while
(
conference_utils_member_test_flag
(
member
,
MFLAG_RUNNING
))
{
if
(
patched
)
{
if
(
patched
)
{
pop_status
=
switch_
queue_trypop
(
member
->
mux_out_queue
,
&
pop
);
pop_status
=
switch_
frame_buffer_trypop
(
member
->
fb
,
&
pop
);
}
else
{
}
else
{
pop_status
=
switch_
queue_pop
(
member
->
mux_out_queue
,
&
pop
);
pop_status
=
switch_
frame_buffer_pop
(
member
->
fb
,
&
pop
);
}
}
if
(
pop_status
==
SWITCH_STATUS_SUCCESS
)
{
if
(
pop_status
==
SWITCH_STATUS_SUCCESS
)
{
...
@@ -1599,7 +1599,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_write_thread_run(switch_thread_
...
@@ -1599,7 +1599,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_write_thread_run(switch_thread_
}
}
}
}
while
(
switch_
queue_trypop
(
member
->
mux_out_queue
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
)
{
while
(
switch_
frame_buffer_trypop
(
member
->
fb
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
pop
)
{
if
(
pop
)
{
if
((
switch_size_t
)
pop
!=
1
)
{
if
((
switch_size_t
)
pop
!=
1
)
{
frame
=
(
switch_frame_t
*
)
pop
;
frame
=
(
switch_frame_t
*
)
pop
;
...
@@ -2198,7 +2198,7 @@ static void wait_for_canvas(mcu_canvas_t *canvas)
...
@@ -2198,7 +2198,7 @@ static void wait_for_canvas(mcu_canvas_t *canvas)
if
(
layer
->
need_patch
)
{
if
(
layer
->
need_patch
)
{
if
(
layer
->
member
)
{
if
(
layer
->
member
)
{
switch_
queue_trypush
(
layer
->
member
->
mux_out_queue
,
(
void
*
)
1
);
switch_
frame_buffer_trypush
(
layer
->
member
->
fb
,
(
void
*
)
1
);
x
++
;
x
++
;
}
else
{
}
else
{
layer
->
need_patch
=
0
;
layer
->
need_patch
=
0
;
...
@@ -2949,7 +2949,9 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
...
@@ -2949,7 +2949,9 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
write_frame
.
packetlen
=
0
;
write_frame
.
packetlen
=
0
;
if
(
switch_frame_buffer_dup
(
imember
->
fb
,
&
write_frame
,
&
dupframe
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_frame_buffer_dup
(
imember
->
fb
,
&
write_frame
,
&
dupframe
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_queue_push
(
imember
->
mux_out_queue
,
dupframe
);
if
(
switch_frame_buffer_trypush
(
imember
->
fb
,
dupframe
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_frame_buffer_free
(
imember
->
fb
,
&
dupframe
);
}
dupframe
=
NULL
;
dupframe
=
NULL
;
}
}
}
}
...
@@ -3139,7 +3141,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
...
@@ -3139,7 +3141,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
//switch_core_session_write_video_frame(imember->session, &write_frame, SWITCH_IO_FLAG_NONE, 0);
//switch_core_session_write_video_frame(imember->session, &write_frame, SWITCH_IO_FLAG_NONE, 0);
if
(
switch_frame_buffer_dup
(
imember
->
fb
,
&
write_frame
,
&
dupframe
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_frame_buffer_dup
(
imember
->
fb
,
&
write_frame
,
&
dupframe
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_
queue_trypush
(
imember
->
mux_out_queue
,
dupframe
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_
frame_buffer_trypush
(
imember
->
fb
,
dupframe
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_frame_buffer_free
(
imember
->
fb
,
&
dupframe
);
switch_frame_buffer_free
(
imember
->
fb
,
&
dupframe
);
}
}
dupframe
=
NULL
;
dupframe
=
NULL
;
...
@@ -3487,7 +3489,7 @@ void *SWITCH_THREAD_FUNC conference_video_super_muxing_thread_run(switch_thread_
...
@@ -3487,7 +3489,7 @@ void *SWITCH_THREAD_FUNC conference_video_super_muxing_thread_run(switch_thread_
//switch_core_session_write_video_frame(imember->session, &write_frame, SWITCH_IO_FLAG_NONE, 0);
//switch_core_session_write_video_frame(imember->session, &write_frame, SWITCH_IO_FLAG_NONE, 0);
if
(
switch_frame_buffer_dup
(
imember
->
fb
,
&
write_frame
,
&
dupframe
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_frame_buffer_dup
(
imember
->
fb
,
&
write_frame
,
&
dupframe
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_
queue_trypush
(
imember
->
mux_out_queue
,
dupframe
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_
frame_buffer_trypush
(
imember
->
fb
,
dupframe
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_frame_buffer_free
(
imember
->
fb
,
&
dupframe
);
switch_frame_buffer_free
(
imember
->
fb
,
&
dupframe
);
}
}
dupframe
=
NULL
;
dupframe
=
NULL
;
...
...
src/mod/applications/mod_conference/mod_conference.c
浏览文件 @
c701ce61
...
@@ -2297,8 +2297,7 @@ SWITCH_STANDARD_APP(conference_function)
...
@@ -2297,8 +2297,7 @@ SWITCH_STANDARD_APP(conference_function)
if
(
conference
->
conference_video_mode
==
CONF_VIDEO_MODE_MUX
)
{
if
(
conference
->
conference_video_mode
==
CONF_VIDEO_MODE_MUX
)
{
switch_queue_create
(
&
member
.
video_queue
,
200
,
member
.
pool
);
switch_queue_create
(
&
member
.
video_queue
,
200
,
member
.
pool
);
switch_queue_create
(
&
member
.
mux_out_queue
,
500
,
member
.
pool
);
switch_frame_buffer_create
(
&
member
.
fb
,
500
);
switch_frame_buffer_create
(
&
member
.
fb
);
}
}
/* Add the caller to the conference */
/* Add the caller to the conference */
...
@@ -2349,7 +2348,7 @@ SWITCH_STANDARD_APP(conference_function)
...
@@ -2349,7 +2348,7 @@ SWITCH_STANDARD_APP(conference_function)
if
(
member
.
video_muxing_write_thread
)
{
if
(
member
.
video_muxing_write_thread
)
{
switch_status_t
st
=
SWITCH_STATUS_SUCCESS
;
switch_status_t
st
=
SWITCH_STATUS_SUCCESS
;
switch_
queue_push
(
member
.
mux_out_queue
,
NULL
);
switch_
frame_buffer_push
(
member
.
fb
,
NULL
);
switch_thread_join
(
&
st
,
member
.
video_muxing_write_thread
);
switch_thread_join
(
&
st
,
member
.
video_muxing_write_thread
);
member
.
video_muxing_write_thread
=
NULL
;
member
.
video_muxing_write_thread
=
NULL
;
}
}
...
...
src/mod/applications/mod_conference/mod_conference.h
浏览文件 @
c701ce61
...
@@ -750,7 +750,6 @@ struct conference_member {
...
@@ -750,7 +750,6 @@ struct conference_member {
char
*
kicked_sound
;
char
*
kicked_sound
;
switch_queue_t
*
dtmf_queue
;
switch_queue_t
*
dtmf_queue
;
switch_queue_t
*
video_queue
;
switch_queue_t
*
video_queue
;
switch_queue_t
*
mux_out_queue
;
switch_thread_t
*
video_muxing_write_thread
;
switch_thread_t
*
video_muxing_write_thread
;
switch_thread_t
*
input_thread
;
switch_thread_t
*
input_thread
;
cJSON
*
json
;
cJSON
*
json
;
...
...
src/switch_core_io.c
浏览文件 @
c701ce61
差异被折叠。
点击展开。
src/switch_core_media.c
浏览文件 @
c701ce61
差异被折叠。
点击展开。
src/switch_utils.c
浏览文件 @
c701ce61
...
@@ -110,6 +110,7 @@ typedef struct switch_frame_node_s {
...
@@ -110,6 +110,7 @@ typedef struct switch_frame_node_s {
struct
switch_frame_buffer_s
{
struct
switch_frame_buffer_s
{
switch_frame_node_t
*
head
;
switch_frame_node_t
*
head
;
switch_memory_pool_t
*
pool
;
switch_memory_pool_t
*
pool
;
switch_queue_t
*
queue
;
switch_mutex_t
*
mutex
;
switch_mutex_t
*
mutex
;
uint32_t
total
;
uint32_t
total
;
};
};
...
@@ -164,8 +165,8 @@ static switch_frame_t *find_free_frame(switch_frame_buffer_t *fb, switch_frame_t
...
@@ -164,8 +165,8 @@ static switch_frame_t *find_free_frame(switch_frame_buffer_t *fb, switch_frame_t
np
->
frame
->
ssrc
=
orig
->
ssrc
;
np
->
frame
->
ssrc
=
orig
->
ssrc
;
np
->
frame
->
m
=
orig
->
m
;
np
->
frame
->
m
=
orig
->
m
;
np
->
frame
->
flags
=
orig
->
flags
;
np
->
frame
->
flags
=
orig
->
flags
;
np
->
frame
->
codec
=
NULL
;
np
->
frame
->
codec
=
orig
->
codec
;
np
->
frame
->
pmap
=
NULL
;
np
->
frame
->
pmap
=
orig
->
pmap
;
np
->
frame
->
img
=
NULL
;
np
->
frame
->
img
=
NULL
;
np
->
frame
->
extra_data
=
np
;
np
->
frame
->
extra_data
=
np
;
np
->
inuse
=
1
;
np
->
inuse
=
1
;
...
@@ -243,6 +244,26 @@ SWITCH_DECLARE(switch_status_t) switch_frame_buffer_dup(switch_frame_buffer_t *f
...
@@ -243,6 +244,26 @@ SWITCH_DECLARE(switch_status_t) switch_frame_buffer_dup(switch_frame_buffer_t *f
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_push
(
switch_frame_buffer_t
*
fb
,
void
*
ptr
)
{
return
switch_queue_push
(
fb
->
queue
,
ptr
);
}
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_trypush
(
switch_frame_buffer_t
*
fb
,
void
*
ptr
)
{
return
switch_queue_trypush
(
fb
->
queue
,
ptr
);
}
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_pop
(
switch_frame_buffer_t
*
fb
,
void
**
ptr
)
{
return
switch_queue_pop
(
fb
->
queue
,
ptr
);
}
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_trypop
(
switch_frame_buffer_t
*
fb
,
void
**
ptr
)
{
return
switch_queue_trypop
(
fb
->
queue
,
ptr
);
}
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_destroy
(
switch_frame_buffer_t
**
fbP
)
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_destroy
(
switch_frame_buffer_t
**
fbP
)
{
{
switch_frame_buffer_t
*
fb
=
*
fbP
;
switch_frame_buffer_t
*
fb
=
*
fbP
;
...
@@ -254,14 +275,17 @@ SWITCH_DECLARE(switch_status_t) switch_frame_buffer_destroy(switch_frame_buffer_
...
@@ -254,14 +275,17 @@ SWITCH_DECLARE(switch_status_t) switch_frame_buffer_destroy(switch_frame_buffer_
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_create
(
switch_frame_buffer_t
**
fbP
)
SWITCH_DECLARE
(
switch_status_t
)
switch_frame_buffer_create
(
switch_frame_buffer_t
**
fbP
,
switch_size_t
qlen
)
{
{
switch_frame_buffer_t
*
fb
;
switch_frame_buffer_t
*
fb
;
switch_memory_pool_t
*
pool
;
switch_memory_pool_t
*
pool
;
if
(
!
qlen
)
qlen
=
500
;
switch_core_new_memory_pool
(
&
pool
);
switch_core_new_memory_pool
(
&
pool
);
fb
=
switch_core_alloc
(
pool
,
sizeof
(
*
fb
));
fb
=
switch_core_alloc
(
pool
,
sizeof
(
*
fb
));
fb
->
pool
=
pool
;
fb
->
pool
=
pool
;
switch_queue_create
(
&
fb
->
queue
,
qlen
,
fb
->
pool
);
switch_mutex_init
(
&
fb
->
mutex
,
SWITCH_MUTEX_NESTED
,
pool
);
switch_mutex_init
(
&
fb
->
mutex
,
SWITCH_MUTEX_NESTED
,
pool
);
*
fbP
=
fb
;
*
fbP
=
fb
;
...
@@ -297,9 +321,11 @@ SWITCH_DECLARE(switch_status_t) switch_frame_dup(switch_frame_t *orig, switch_fr
...
@@ -297,9 +321,11 @@ SWITCH_DECLARE(switch_status_t) switch_frame_dup(switch_frame_t *orig, switch_fr
}
}
new_frame
->
codec
=
NULL
;
new_frame
->
codec
=
orig
->
codec
;
new_frame
->
pmap
=
NULL
;
new_frame
->
pmap
=
orig
->
pmap
;
new_frame
->
img
=
NULL
;
new_frame
->
img
=
NULL
;
if
(
orig
->
img
&&
!
switch_test_flag
(
orig
,
SFF_ENCODED
))
{
if
(
orig
->
img
&&
!
switch_test_flag
(
orig
,
SFF_ENCODED
))
{
switch_img_copy
(
orig
->
img
,
&
new_frame
->
img
);
switch_img_copy
(
orig
->
img
,
&
new_frame
->
img
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论