Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
c58da50f
提交
c58da50f
authored
6月 14, 2018
作者:
Seven Du
提交者:
Muteesa Fred
7月 24, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-11189 tweak log
上级
32b15594
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
53 行增加
和
37 行删除
+53
-37
switch_vpx.c
src/switch_vpx.c
+53
-37
没有找到文件。
src/switch_vpx.c
浏览文件 @
c58da50f
...
@@ -51,6 +51,45 @@
...
@@ -51,6 +51,45 @@
#define SLICE_SIZE SWITCH_DEFAULT_VIDEO_SIZE
#define SLICE_SIZE SWITCH_DEFAULT_VIDEO_SIZE
#define KEY_FRAME_MIN_FREQ 250000
#define KEY_FRAME_MIN_FREQ 250000
#define SHOW(cfg, field) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " %-28s = %d\n", #field, cfg->field);
static
void
show_enc_config
(
vpx_codec_enc_cfg_t
*
cfg
)
{
SHOW
(
cfg
,
g_usage
);
SHOW
(
cfg
,
g_threads
);
SHOW
(
cfg
,
g_profile
);
SHOW
(
cfg
,
g_w
);
SHOW
(
cfg
,
g_h
);
SHOW
(
cfg
,
g_bit_depth
);
SHOW
(
cfg
,
g_input_bit_depth
);
SHOW
(
cfg
,
g_timebase
.
num
);
SHOW
(
cfg
,
g_timebase
.
den
);
SHOW
(
cfg
,
g_error_resilient
);
SHOW
(
cfg
,
g_pass
);
SHOW
(
cfg
,
g_lag_in_frames
);
SHOW
(
cfg
,
rc_dropframe_thresh
);
SHOW
(
cfg
,
rc_resize_allowed
);
SHOW
(
cfg
,
rc_scaled_width
);
SHOW
(
cfg
,
rc_scaled_height
);
SHOW
(
cfg
,
rc_resize_up_thresh
);
SHOW
(
cfg
,
rc_resize_down_thresh
);
SHOW
(
cfg
,
rc_end_usage
);
SHOW
(
cfg
,
rc_target_bitrate
);
SHOW
(
cfg
,
rc_min_quantizer
);
SHOW
(
cfg
,
rc_max_quantizer
);
SHOW
(
cfg
,
rc_undershoot_pct
);
SHOW
(
cfg
,
rc_overshoot_pct
);
SHOW
(
cfg
,
rc_buf_sz
);
SHOW
(
cfg
,
rc_buf_initial_sz
);
SHOW
(
cfg
,
rc_buf_optimal_sz
);
SHOW
(
cfg
,
rc_2pass_vbr_bias_pct
);
SHOW
(
cfg
,
rc_2pass_vbr_minsection_pct
);
SHOW
(
cfg
,
rc_2pass_vbr_maxsection_pct
);
SHOW
(
cfg
,
kf_mode
);
SHOW
(
cfg
,
kf_min_dist
);
SHOW
(
cfg
,
kf_max_dist
);
}
/* http://tools.ietf.org/html/draft-ietf-payload-vp8-10
/* http://tools.ietf.org/html/draft-ietf-payload-vp8-10
The first octets after the RTP header are the VP8 payload descriptor, with the following structure.
The first octets after the RTP header are the VP8 payload descriptor, with the following structure.
...
@@ -458,43 +497,8 @@ static switch_status_t init_encoder(switch_codec_t *codec)
...
@@ -458,43 +497,8 @@ static switch_status_t init_encoder(switch_codec_t *codec)
}
else
if
(
context
->
flags
&
SWITCH_CODEC_FLAG_ENCODE
)
{
}
else
if
(
context
->
flags
&
SWITCH_CODEC_FLAG_ENCODE
)
{
if
(
vpx_globals
.
debug
)
{
if
(
vpx_globals
.
debug
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Codec: %s
\n
"
,
vpx_codec_iface_name
(
context
->
encoder_interface
));
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Codec: %s
\n
"
,
vpx_codec_iface_name
(
context
->
encoder_interface
));
show_enc_config
(
config
);
#define SHOW(field) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, " %-28s = %d\n", #field, config->field);
SHOW
(
g_usage
);
SHOW
(
g_threads
);
SHOW
(
g_profile
);
SHOW
(
g_w
);
SHOW
(
g_h
);
SHOW
(
g_bit_depth
);
SHOW
(
g_input_bit_depth
);
SHOW
(
g_timebase
.
num
);
SHOW
(
g_timebase
.
den
);
SHOW
(
g_error_resilient
);
SHOW
(
g_pass
);
SHOW
(
g_lag_in_frames
);
SHOW
(
rc_dropframe_thresh
);
SHOW
(
rc_resize_allowed
);
SHOW
(
rc_scaled_width
);
SHOW
(
rc_scaled_height
);
SHOW
(
rc_resize_up_thresh
);
SHOW
(
rc_resize_down_thresh
);
SHOW
(
rc_end_usage
);
SHOW
(
rc_target_bitrate
);
SHOW
(
rc_min_quantizer
);
SHOW
(
rc_max_quantizer
);
SHOW
(
rc_undershoot_pct
);
SHOW
(
rc_overshoot_pct
);
SHOW
(
rc_buf_sz
);
SHOW
(
rc_buf_initial_sz
);
SHOW
(
rc_buf_optimal_sz
);
SHOW
(
rc_2pass_vbr_bias_pct
);
SHOW
(
rc_2pass_vbr_minsection_pct
);
SHOW
(
rc_2pass_vbr_maxsection_pct
);
SHOW
(
kf_mode
);
SHOW
(
kf_min_dist
);
SHOW
(
kf_max_dist
);
}
}
if
(
vpx_codec_enc_init
(
&
context
->
encoder
,
context
->
encoder_interface
,
config
,
0
&
VPX_CODEC_USE_OUTPUT_PARTITION
)
!=
VPX_CODEC_OK
)
{
if
(
vpx_codec_enc_init
(
&
context
->
encoder
,
context
->
encoder_interface
,
config
,
0
&
VPX_CODEC_USE_OUTPUT_PARTITION
)
!=
VPX_CODEC_OK
)
{
...
@@ -1582,6 +1586,18 @@ SWITCH_STANDARD_API(vpx_api_function)
...
@@ -1582,6 +1586,18 @@ SWITCH_STANDARD_API(vpx_api_function)
stream
->
write_function
(
stream
,
"Reload XML [%s]
\n
"
,
err
);
stream
->
write_function
(
stream
,
"Reload XML [%s]
\n
"
,
err
);
load_config
();
load_config
();
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
" %-26s = %d
\n
"
,
"vp8-dec-threads"
,
vpx_globals
.
vp8_dec_cfg
.
threads
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
" %-26s = %d
\n
"
,
"vp9-dec-threads"
,
vpx_globals
.
vp9_dec_cfg
.
threads
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
" %-26s = %d
\n
"
,
"vp10-dec-threads"
,
vpx_globals
.
vp10_dec_cfg
.
threads
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Codec: %s
\n
"
,
vpx_codec_iface_name
(
vpx_codec_vp8_cx
()));
show_enc_config
(
&
vpx_globals
.
vp8_enc_cfg
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Codec: %s
\n
"
,
vpx_codec_iface_name
(
vpx_codec_vp9_cx
()));
show_enc_config
(
&
vpx_globals
.
vp9_enc_cfg
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Codec: VP10
\n
"
);
show_enc_config
(
&
vpx_globals
.
vp10_enc_cfg
);
stream
->
write_function
(
stream
,
"+OK
\n
"
);
stream
->
write_function
(
stream
,
"+OK
\n
"
);
}
else
if
(
!
strcasecmp
(
cmd
,
"debug"
))
{
}
else
if
(
!
strcasecmp
(
cmd
,
"debug"
))
{
stream
->
write_function
(
stream
,
"+OK debug %s
\n
"
,
vpx_globals
.
debug
?
"on"
:
"off"
);
stream
->
write_function
(
stream
,
"+OK debug %s
\n
"
,
vpx_globals
.
debug
?
"on"
:
"off"
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论