Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
dc4c38da
提交
dc4c38da
authored
5月 05, 2015
作者:
Anthony Minessale
提交者:
Michael Jerris
5月 28, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7499 FS-7508 FS-7501 some more general improvements for initial call setup
上级
aacede19
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
69 行增加
和
15 行删除
+69
-15
switch_rtp.h
src/include/switch_rtp.h
+1
-0
switch_vidderbuffer.h
src/include/switch_vidderbuffer.h
+1
-0
mod_vpx.c
src/mod/codecs/mod_vpx/mod_vpx.c
+1
-1
switch_channel.c
src/switch_channel.c
+10
-2
switch_core_media.c
src/switch_core_media.c
+20
-10
switch_rtp.c
src/switch_rtp.c
+18
-2
switch_vidderbuffer.c
src/switch_vidderbuffer.c
+18
-0
没有找到文件。
src/include/switch_rtp.h
浏览文件 @
dc4c38da
...
@@ -328,6 +328,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_rtcp(switch_rtp_t *rtp_sessi
...
@@ -328,6 +328,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_rtcp(switch_rtp_t *rtp_sessi
SWITCH_DECLARE
(
switch_timer_t
*
)
switch_rtp_get_media_timer
(
switch_rtp_t
*
rtp_session
);
SWITCH_DECLARE
(
switch_timer_t
*
)
switch_rtp_get_media_timer
(
switch_rtp_t
*
rtp_session
);
SWITCH_DECLARE
(
switch_status_t
)
switch_rtp_set_video_buffer_size
(
switch_rtp_t
*
rtp_session
,
uint32_t
frames
);
SWITCH_DECLARE
(
switch_status_t
)
switch_rtp_set_video_buffer_size
(
switch_rtp_t
*
rtp_session
,
uint32_t
frames
);
SWITCH_DECLARE
(
uint32_t
)
switch_rtp_get_video_buffer_size
(
switch_rtp_t
*
rtp_session
);
/*!
/*!
\brief Acvite a jitter buffer on an RTP session
\brief Acvite a jitter buffer on an RTP session
...
...
src/include/switch_vidderbuffer.h
浏览文件 @
dc4c38da
...
@@ -41,6 +41,7 @@ typedef enum {
...
@@ -41,6 +41,7 @@ typedef enum {
SWITCH_BEGIN_EXTERN_C
SWITCH_BEGIN_EXTERN_C
SWITCH_DECLARE
(
switch_status_t
)
switch_vb_create
(
switch_vb_t
**
vbp
,
uint32_t
min_frame_len
,
uint32_t
max_frame_len
,
switch_memory_pool_t
*
pool
);
SWITCH_DECLARE
(
switch_status_t
)
switch_vb_create
(
switch_vb_t
**
vbp
,
uint32_t
min_frame_len
,
uint32_t
max_frame_len
,
switch_memory_pool_t
*
pool
);
SWITCH_DECLARE
(
switch_status_t
)
switch_vb_set_frames
(
switch_vb_t
*
vb
,
uint32_t
min_frame_len
,
uint32_t
max_frame_len
);
SWITCH_DECLARE
(
switch_status_t
)
switch_vb_set_frames
(
switch_vb_t
*
vb
,
uint32_t
min_frame_len
,
uint32_t
max_frame_len
);
SWITCH_DECLARE
(
switch_status_t
)
switch_vb_get_frames
(
switch_vb_t
*
vb
,
uint32_t
*
min_frame_len
,
uint32_t
*
max_frame_len
);
SWITCH_DECLARE
(
switch_status_t
)
switch_vb_destroy
(
switch_vb_t
**
vbp
);
SWITCH_DECLARE
(
switch_status_t
)
switch_vb_destroy
(
switch_vb_t
**
vbp
);
SWITCH_DECLARE
(
void
)
switch_vb_reset
(
switch_vb_t
*
vb
);
SWITCH_DECLARE
(
void
)
switch_vb_reset
(
switch_vb_t
*
vb
);
SWITCH_DECLARE
(
void
)
switch_vb_debug_level
(
switch_vb_t
*
vb
,
uint8_t
level
);
SWITCH_DECLARE
(
void
)
switch_vb_debug_level
(
switch_vb_t
*
vb
,
uint8_t
level
);
...
...
src/mod/codecs/mod_vpx/mod_vpx.c
浏览文件 @
dc4c38da
...
@@ -772,7 +772,7 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
...
@@ -772,7 +772,7 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
if
(
context
->
is_vp9
)
{
if
(
context
->
is_vp9
)
{
is_keyframe
=
IS_VP9_KEY_FRAME
(
*
(
unsigned
char
*
)
frame
->
data
);
is_keyframe
=
IS_VP9_KEY_FRAME
(
*
(
unsigned
char
*
)
frame
->
data
);
}
else
{
// vp8
}
else
{
// vp8
is_keyframe
=
(
*
(
unsigned
char
*
)
frame
->
data
&
0x10
)
||
IS_VP8_KEY_FRAME
((
uint8_t
*
)
frame
->
data
);
is_keyframe
=
IS_VP8_KEY_FRAME
((
uint8_t
*
)
frame
->
data
);
}
}
// if (is_keyframe) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "got key %d\n", is_keyframe);
// if (is_keyframe) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "got key %d\n", is_keyframe);
...
...
src/switch_channel.c
浏览文件 @
dc4c38da
...
@@ -1785,7 +1785,8 @@ SWITCH_DECLARE(char *) switch_channel_get_cap_string(switch_channel_t *channel)
...
@@ -1785,7 +1785,8 @@ SWITCH_DECLARE(char *) switch_channel_get_cap_string(switch_channel_t *channel)
SWITCH_DECLARE
(
void
)
switch_channel_set_flag_value
(
switch_channel_t
*
channel
,
switch_channel_flag_t
flag
,
uint32_t
value
)
SWITCH_DECLARE
(
void
)
switch_channel_set_flag_value
(
switch_channel_t
*
channel
,
switch_channel_flag_t
flag
,
uint32_t
value
)
{
{
int
HELD
=
0
;
int
HELD
=
0
;
int
just_set
=
0
;
switch_assert
(
channel
);
switch_assert
(
channel
);
switch_assert
(
channel
->
flag_mutex
);
switch_assert
(
channel
->
flag_mutex
);
...
@@ -1793,9 +1794,16 @@ SWITCH_DECLARE(void) switch_channel_set_flag_value(switch_channel_t *channel, sw
...
@@ -1793,9 +1794,16 @@ SWITCH_DECLARE(void) switch_channel_set_flag_value(switch_channel_t *channel, sw
if
(
flag
==
CF_LEG_HOLDING
&&
!
channel
->
flags
[
flag
]
&&
channel
->
flags
[
CF_ANSWERED
])
{
if
(
flag
==
CF_LEG_HOLDING
&&
!
channel
->
flags
[
flag
]
&&
channel
->
flags
[
CF_ANSWERED
])
{
HELD
=
1
;
HELD
=
1
;
}
}
channel
->
flags
[
flag
]
=
value
;
if
(
channel
->
flags
[
flag
]
!=
value
)
{
just_set
=
1
;
channel
->
flags
[
flag
]
=
value
;
}
switch_mutex_unlock
(
channel
->
flag_mutex
);
switch_mutex_unlock
(
channel
->
flag_mutex
);
if
(
flag
==
CF_VIDEO_READY
&&
just_set
)
{
switch_core_session_request_video_refresh
(
channel
->
session
);
}
if
(
flag
==
CF_ORIGINATOR
&&
switch_channel_test_flag
(
channel
,
CF_ANSWERED
)
&&
switch_channel_up_nosig
(
channel
))
{
if
(
flag
==
CF_ORIGINATOR
&&
switch_channel_test_flag
(
channel
,
CF_ANSWERED
)
&&
switch_channel_up_nosig
(
channel
))
{
switch_channel_set_callstate
(
channel
,
CCS_RING_WAIT
);
switch_channel_set_callstate
(
channel
,
CCS_RING_WAIT
);
}
}
...
...
src/switch_core_media.c
浏览文件 @
dc4c38da
...
@@ -1947,8 +1947,11 @@ static void check_jb_sync(switch_core_session_t *session)
...
@@ -1947,8 +1947,11 @@ static void check_jb_sync(switch_core_session_t *session)
jb_sync_msec
=
tmp
;
jb_sync_msec
=
tmp
;
}
}
}
}
// TBD IMPROVE get_fps func
if
(
smh
->
vid_frames
<
10
)
{
fps
=
15
;
//switch_core_media_get_video_fps(session);
fps
=
15
;
}
else
{
fps
=
switch_core_media_get_video_fps
(
session
);
}
if
(
!
fps
)
return
;
if
(
!
fps
)
return
;
...
@@ -1959,13 +1962,20 @@ static void check_jb_sync(switch_core_session_t *session)
...
@@ -1959,13 +1962,20 @@ static void check_jb_sync(switch_core_session_t *session)
frames
=
fps
/
(
1000
/
jb_sync_msec
);
frames
=
fps
/
(
1000
/
jb_sync_msec
);
}
}
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
if
(
frames
==
switch_rtp_get_video_buffer_size
(
v_engine
->
rtp_session
))
{
SWITCH_LOG_DEBUG
,
"%s Sync Audio and Video Jitterbuffer to %dms %u Video Frames FPS %u
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
switch_channel_get_name
(
session
->
channel
),
SWITCH_LOG_DEBUG1
,
"%s Audio and Video Jitterbuffer settings not changed %dms %u Video Frames FPS %u
\n
"
,
jb_sync_msec
,
frames
,
fps
);
switch_channel_get_name
(
session
->
channel
),
jb_sync_msec
,
frames
,
fps
);
switch_rtp_set_video_buffer_size
(
v_engine
->
rtp_session
,
frames
);
}
else
{
check_jb
(
session
,
NULL
,
jb_sync_msec
,
jb_sync_msec
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_INFO
,
"%s Sync Audio and Video Jitterbuffer to %dms %u Video Frames FPS %u
\n
"
,
switch_channel_get_name
(
session
->
channel
),
jb_sync_msec
,
frames
,
fps
);
switch_rtp_set_video_buffer_size
(
v_engine
->
rtp_session
,
frames
);
check_jb
(
session
,
NULL
,
jb_sync_msec
,
jb_sync_msec
);
}
}
}
...
@@ -2088,7 +2098,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session
...
@@ -2088,7 +2098,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session
}
}
smh
->
vid_frames
++
;
smh
->
vid_frames
++
;
if
(
smh
->
vid_frames
==
45
)
{
if
(
smh
->
vid_frames
==
1
||
((
smh
->
vid_frames
%
300
)
==
0
)
)
{
check_jb_sync
(
session
);
check_jb_sync
(
session
);
}
}
}
}
...
...
src/switch_rtp.c
浏览文件 @
dc4c38da
...
@@ -3855,6 +3855,17 @@ static void jb_logger(const char *file, const char *func, int line, int level, c
...
@@ -3855,6 +3855,17 @@ static void jb_logger(const char *file, const char *func, int line, int level, c
va_end
(
ap
);
va_end
(
ap
);
}
}
SWITCH_DECLARE
(
uint32_t
)
switch_rtp_get_video_buffer_size
(
switch_rtp_t
*
rtp_session
)
{
uint32_t
frames
=
0
;
if
(
rtp_session
->
vb
)
{
switch_vb_get_frames
(
rtp_session
->
vb
,
&
frames
,
NULL
);
}
return
frames
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_rtp_set_video_buffer_size
(
switch_rtp_t
*
rtp_session
,
uint32_t
frames
)
SWITCH_DECLARE
(
switch_status_t
)
switch_rtp_set_video_buffer_size
(
switch_rtp_t
*
rtp_session
,
uint32_t
frames
)
{
{
if
(
!
switch_rtp_ready
(
rtp_session
))
{
if
(
!
switch_rtp_ready
(
rtp_session
))
{
...
@@ -5415,7 +5426,9 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t
...
@@ -5415,7 +5426,9 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t
if
(
msg
->
header
.
type
==
RTCP_PT_PSFB
&&
(
extp
->
header
.
fmt
==
RTCP_PSFB_FIR
||
extp
->
header
.
fmt
==
RTCP_PSFB_PLI
))
{
if
(
msg
->
header
.
type
==
RTCP_PT_PSFB
&&
(
extp
->
header
.
fmt
==
RTCP_PSFB_FIR
||
extp
->
header
.
fmt
==
RTCP_PSFB_PLI
))
{
switch_core_media_gen_key_frame
(
rtp_session
->
session
);
switch_core_media_gen_key_frame
(
rtp_session
->
session
);
//switch_channel_set_flag(switch_core_session_get_channel(rtp_session->session), CF_VIDEO_REFRESH_REQ);
if
(
rtp_session
->
vbw
)
{
switch_vb_reset
(
rtp_session
->
vbw
);
}
}
}
if
(
msg
->
header
.
type
==
RTCP_PT_RTPFB
&&
extp
->
header
.
fmt
==
RTCP_RTPFB_NACK
)
{
if
(
msg
->
header
.
type
==
RTCP_PT_RTPFB
&&
extp
->
header
.
fmt
==
RTCP_RTPFB_NACK
)
{
...
@@ -5423,11 +5436,14 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t
...
@@ -5423,11 +5436,14 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t
int
i
;
int
i
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG1
,
"Got NACK count %d
\n
"
,
ntohs
(
extp
->
header
.
length
)
-
2
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG1
,
"Got NACK count %d
\n
"
,
ntohs
(
extp
->
header
.
length
)
-
2
);
switch_core_media_gen_key_frame
(
rtp_session
->
session
);
for
(
i
=
0
;
i
<
ntohs
(
extp
->
header
.
length
)
-
2
;
i
++
)
{
for
(
i
=
0
;
i
<
ntohs
(
extp
->
header
.
length
)
-
2
;
i
++
)
{
handle_nack
(
rtp_session
,
*
nack
);
handle_nack
(
rtp_session
,
*
nack
);
nack
++
;
nack
++
;
}
}
switch_core_media_gen_key_frame
(
rtp_session
->
session
);
}
}
}
else
}
else
...
...
src/switch_vidderbuffer.c
浏览文件 @
dc4c38da
...
@@ -412,6 +412,24 @@ SWITCH_DECLARE(void) switch_vb_reset(switch_vb_t *vb)
...
@@ -412,6 +412,24 @@ SWITCH_DECLARE(void) switch_vb_reset(switch_vb_t *vb)
switch_mutex_unlock
(
vb
->
mutex
);
switch_mutex_unlock
(
vb
->
mutex
);
}
}
SWITCH_DECLARE
(
switch_status_t
)
switch_vb_get_frames
(
switch_vb_t
*
vb
,
uint32_t
*
min_frame_len
,
uint32_t
*
max_frame_len
)
{
switch_mutex_lock
(
vb
->
mutex
);
if
(
min_frame_len
)
{
*
min_frame_len
=
vb
->
min_frame_len
;
}
if
(
max_frame_len
)
{
*
max_frame_len
=
vb
->
max_frame_len
;
}
switch_mutex_unlock
(
vb
->
mutex
);
return
SWITCH_STATUS_SUCCESS
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_vb_set_frames
(
switch_vb_t
*
vb
,
uint32_t
min_frame_len
,
uint32_t
max_frame_len
)
SWITCH_DECLARE
(
switch_status_t
)
switch_vb_set_frames
(
switch_vb_t
*
vb
,
uint32_t
min_frame_len
,
uint32_t
max_frame_len
)
{
{
switch_mutex_lock
(
vb
->
mutex
);
switch_mutex_lock
(
vb
->
mutex
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论