Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
0bbea7e1
提交
0bbea7e1
authored
10月 01, 2018
作者:
Seven Du
提交者:
Andrey Volk
7月 16, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-11425 refactor vpx to support more profiles
上级
2a6fb572
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
345 行增加
和
273 行删除
+345
-273
switch_vpx.c
src/switch_vpx.c
+345
-273
没有找到文件。
src/switch_vpx.c
浏览文件 @
0bbea7e1
...
...
@@ -52,6 +52,7 @@
#define KEY_FRAME_MIN_FREQ 250000
typedef
struct
my_vpx_cfg_s
{
char
name
[
64
];
int
lossless
;
int
cpuused
;
int
token_parts
;
...
...
@@ -399,23 +400,24 @@ struct vpx_context {
};
typedef
struct
vpx_context
vpx_context_t
;
#define MAX_PROFILES 100
struct
vpx_globals
{
int
debug
;
uint32_t
max_bitrate
;
uint32_t
rtp_slice_size
;
uint32_t
key_frame_min_freq
;
char
vp8_profile
[
20
];
char
vp9_profile
[
20
];
char
vp10_profile
[
20
];
uint32_t
dec_threads
;
uint32_t
enc_threads
;
my_vpx_cfg_t
vp8
;
my_vpx_cfg_t
vp9
;
my_vpx_cfg_t
vp10
;
my_vpx_cfg_t
*
profiles
[
MAX_PROFILES
];
};
struct
vpx_globals
vpx_globals
=
{
0
};
static
my_vpx_cfg_t
*
find_cfg_profile
(
const
char
*
name
,
switch_bool_t
reconfig
);
static
switch_status_t
init_decoder
(
switch_codec_t
*
codec
)
{
vpx_context_t
*
context
=
(
vpx_context_t
*
)
codec
->
private_info
;
...
...
@@ -433,11 +435,13 @@ static switch_status_t init_decoder(switch_codec_t *codec)
vpx_codec_err_t
err
;
if
(
context
->
is_vp9
)
{
my_cfg
=
&
vpx_globals
.
vp9
;
my_cfg
=
find_cfg_profile
(
"vp9"
,
SWITCH_FALSE
)
;
}
else
{
my_cfg
=
&
vpx_globals
.
vp8
;
my_cfg
=
find_cfg_profile
(
"vp8"
,
SWITCH_FALSE
)
;
}
if
(
!
my_cfg
)
return
SWITCH_STATUS_FALSE
;
cfg
.
threads
=
my_cfg
->
dec_cfg
.
threads
;
if
((
err
=
vpx_codec_dec_init
(
&
context
->
decoder
,
context
->
decoder_interface
,
&
cfg
,
dec_flags
))
!=
VPX_CODEC_OK
)
{
...
...
@@ -482,11 +486,13 @@ static switch_status_t init_encoder(switch_codec_t *codec)
vpx_codec_err_t
err
;
if
(
context
->
is_vp9
)
{
my_cfg
=
&
vpx_globals
.
vp9
;
my_cfg
=
find_cfg_profile
(
"vp9"
,
SWITCH_FALSE
)
;
}
else
{
my_cfg
=
&
vpx_globals
.
vp8
;
my_cfg
=
find_cfg_profile
(
"vp8"
,
SWITCH_FALSE
)
;
}
if
(
!
my_cfg
)
return
SWITCH_STATUS_FALSE
;
if
(
!
context
->
codec_settings
.
video
.
width
)
{
context
->
codec_settings
.
video
.
width
=
1280
;
}
...
...
@@ -1189,14 +1195,18 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
if
(
context
->
need_decoder_reset
!=
0
)
{
vpx_codec_destroy
(
&
context
->
decoder
);
context
->
decoder_init
=
0
;
init_decoder
(
codec
);
status
=
init_decoder
(
codec
);
context
->
need_decoder_reset
=
0
;
}
if
(
status
!=
SWITCH_STATUS_SUCCESS
)
goto
end
;
if
(
!
context
->
decoder_init
)
{
init_decoder
(
codec
);
status
=
init_decoder
(
codec
);
}
if
(
status
!=
SWITCH_STATUS_SUCCESS
)
goto
end
;
if
(
!
context
->
decoder_init
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"VPX decoder is not initialized!
\n
"
);
return
SWITCH_STATUS_FALSE
;
...
...
@@ -1434,116 +1444,103 @@ static switch_status_t switch_vpx_destroy(switch_codec_t *codec)
return
SWITCH_STATUS_SUCCESS
;
}
#define UINTVAL(v) (v > 0 ? v : 0);
static
void
load_config
()
static
void
init_vp8
(
my_vpx_cfg_t
*
my_cfg
)
{
switch_xml_t
cfg
=
NULL
,
xml
=
NULL
;
vpx_codec_enc_config_default
(
vpx_codec_vp8_cx
(),
&
vpx_globals
.
vp8
.
enc_cfg
,
0
);
vpx_codec_enc_config_default
(
vpx_codec_vp9_cx
(),
&
vpx_globals
.
vp9
.
enc_cfg
,
0
);
switch_set_string
(
vpx_globals
.
vp8_profile
,
"vp8"
);
switch_set_string
(
vpx_globals
.
vp9_profile
,
"vp9"
);
switch_set_string
(
vpx_globals
.
vp10_profile
,
"vp10"
);
vpx_codec_enc_config_default
(
vpx_codec_vp8_cx
(),
&
my_cfg
->
enc_cfg
,
0
);
my_cfg
->
cpuused
=
-
6
;
my_cfg
->
enc_cfg
.
g_profile
=
2
;
my_cfg
->
enc_cfg
.
g_timebase
.
den
=
1000
;
my_cfg
->
enc_cfg
.
g_error_resilient
=
VPX_ERROR_RESILIENT_PARTITIONS
;
my_cfg
->
enc_cfg
.
rc_resize_allowed
=
1
;
my_cfg
->
enc_cfg
.
rc_end_usage
=
VPX_CBR
;
my_cfg
->
enc_cfg
.
rc_target_bitrate
=
switch_parse_bandwidth_string
(
"1mb"
);
my_cfg
->
enc_cfg
.
rc_min_quantizer
=
4
;
my_cfg
->
enc_cfg
.
rc_max_quantizer
=
63
;
my_cfg
->
enc_cfg
.
rc_overshoot_pct
=
50
;
my_cfg
->
enc_cfg
.
rc_buf_sz
=
5000
;
my_cfg
->
enc_cfg
.
rc_buf_initial_sz
=
1000
;
my_cfg
->
enc_cfg
.
rc_buf_optimal_sz
=
1000
;
my_cfg
->
enc_cfg
.
kf_max_dist
=
360
;
}
vpx_globals
.
max_bitrate
=
0
;
vpx_globals
.
vp8
.
cpuused
=
-
6
;
vpx_globals
.
vp8
.
enc_cfg
.
g_profile
=
2
;
vpx_globals
.
vp8
.
enc_cfg
.
g_timebase
.
den
=
1000
;
vpx_globals
.
vp8
.
enc_cfg
.
g_error_resilient
=
VPX_ERROR_RESILIENT_PARTITIONS
;
vpx_globals
.
vp8
.
enc_cfg
.
rc_resize_allowed
=
1
;
vpx_globals
.
vp8
.
enc_cfg
.
rc_end_usage
=
VPX_CBR
;
vpx_globals
.
vp8
.
enc_cfg
.
rc_target_bitrate
=
switch_parse_bandwidth_string
(
"1mb"
);
vpx_globals
.
vp8
.
enc_cfg
.
rc_min_quantizer
=
4
;
vpx_globals
.
vp8
.
enc_cfg
.
rc_max_quantizer
=
63
;
vpx_globals
.
vp8
.
enc_cfg
.
rc_overshoot_pct
=
50
;
vpx_globals
.
vp8
.
enc_cfg
.
rc_buf_sz
=
5000
;
vpx_globals
.
vp8
.
enc_cfg
.
rc_buf_initial_sz
=
1000
;
vpx_globals
.
vp8
.
enc_cfg
.
rc_buf_optimal_sz
=
1000
;
vpx_globals
.
vp8
.
enc_cfg
.
kf_max_dist
=
360
;
vpx_globals
.
vp9
.
cpuused
=
-
6
;
vpx_globals
.
vp9
.
enc_cfg
.
g_profile
=
2
;
vpx_globals
.
vp9
.
enc_cfg
.
g_timebase
.
den
=
1000
;
vpx_globals
.
vp9
.
enc_cfg
.
g_error_resilient
=
VPX_ERROR_RESILIENT_PARTITIONS
;
vpx_globals
.
vp9
.
enc_cfg
.
rc_resize_allowed
=
1
;
vpx_globals
.
vp9
.
enc_cfg
.
rc_end_usage
=
VPX_CBR
;
vpx_globals
.
vp9
.
enc_cfg
.
rc_target_bitrate
=
switch_parse_bandwidth_string
(
"1mb"
);
vpx_globals
.
vp9
.
enc_cfg
.
rc_min_quantizer
=
4
;
vpx_globals
.
vp9
.
enc_cfg
.
rc_max_quantizer
=
63
;
vpx_globals
.
vp9
.
enc_cfg
.
rc_overshoot_pct
=
50
;
vpx_globals
.
vp9
.
enc_cfg
.
rc_buf_sz
=
5000
;
vpx_globals
.
vp9
.
enc_cfg
.
rc_buf_initial_sz
=
1000
;
vpx_globals
.
vp9
.
enc_cfg
.
rc_buf_optimal_sz
=
1000
;
vpx_globals
.
vp9
.
enc_cfg
.
kf_max_dist
=
360
;
vpx_globals
.
vp9
.
tune_content
=
VP9E_CONTENT_SCREEN
;
vpx_globals
.
vp10
.
cpuused
=
-
6
;
static
void
init_vp9
(
my_vpx_cfg_t
*
my_cfg
)
{
vpx_codec_enc_config_default
(
vpx_codec_vp9_cx
(),
&
my_cfg
->
enc_cfg
,
0
);
my_cfg
->
cpuused
=
-
6
;
my_cfg
->
enc_cfg
.
g_profile
=
2
;
my_cfg
->
enc_cfg
.
g_timebase
.
den
=
1000
;
my_cfg
->
enc_cfg
.
g_error_resilient
=
VPX_ERROR_RESILIENT_PARTITIONS
;
my_cfg
->
enc_cfg
.
rc_resize_allowed
=
1
;
my_cfg
->
enc_cfg
.
rc_end_usage
=
VPX_CBR
;
my_cfg
->
enc_cfg
.
rc_target_bitrate
=
switch_parse_bandwidth_string
(
"1mb"
);
my_cfg
->
enc_cfg
.
rc_min_quantizer
=
4
;
my_cfg
->
enc_cfg
.
rc_max_quantizer
=
63
;
my_cfg
->
enc_cfg
.
rc_overshoot_pct
=
50
;
my_cfg
->
enc_cfg
.
rc_buf_sz
=
5000
;
my_cfg
->
enc_cfg
.
rc_buf_initial_sz
=
1000
;
my_cfg
->
enc_cfg
.
rc_buf_optimal_sz
=
1000
;
my_cfg
->
enc_cfg
.
kf_max_dist
=
360
;
my_cfg
->
tune_content
=
VP9E_CONTENT_SCREEN
;
}
xml
=
switch_xml_open_cfg
(
"vpx.conf"
,
&
cfg
,
NULL
);
static
void
init_vp10
(
my_vpx_cfg_t
*
my_cfg
)
{
// vpx_codec_enc_config_default(vpx_codec_vp9_cx(), &cfg->enc_cfg, 0);
my_cfg
->
cpuused
=
-
6
;
}
if
(
xml
)
{
switch_xml_t
settings
=
switch_xml_child
(
cfg
,
"settings"
);
switch_xml_t
profiles
=
switch_xml_child
(
cfg
,
"profiles"
)
;
static
my_vpx_cfg_t
*
find_cfg_profile
(
const
char
*
name
,
switch_bool_t
reconfig
)
{
int
i
;
if
(
settings
)
{
switch_xml_t
param
;
for
(
i
=
0
;
i
<
MAX_PROFILES
;
i
++
)
{
if
(
!
vpx_globals
.
profiles
[
i
])
{
vpx_globals
.
profiles
[
i
]
=
malloc
(
sizeof
(
my_vpx_cfg_t
));
switch_assert
(
vpx_globals
.
profiles
[
i
]);
memset
(
vpx_globals
.
profiles
[
i
],
0
,
sizeof
(
my_vpx_cfg_t
));
switch_set_string
(
vpx_globals
.
profiles
[
i
]
->
name
,
name
);
for
(
param
=
switch_xml_child
(
settings
,
"param"
);
param
;
param
=
param
->
next
)
{
const
char
*
name
=
switch_xml_attr
(
param
,
"name"
);
const
char
*
value
=
switch_xml_attr
(
param
,
"value"
);
if
(
!
strcmp
(
name
,
"vp8"
))
{
init_vp8
(
vpx_globals
.
profiles
[
i
]);
}
else
if
(
!
strcmp
(
name
,
"vp9"
))
{
init_vp9
(
vpx_globals
.
profiles
[
i
]);
}
else
if
(
!
strcmp
(
name
,
"vp10"
))
{
init_vp10
(
vpx_globals
.
profiles
[
i
]);
}
if
(
zstr
(
name
)
||
zstr
(
value
))
continue
;
return
vpx_globals
.
profiles
[
i
];
}
if
(
!
strcmp
(
name
,
"max-bitrate"
))
{
vpx_globals
.
max_bitrate
=
switch_parse_bandwidth_string
(
value
);
}
else
if
(
!
strcmp
(
name
,
"rtp-slice-size"
))
{
int
val
=
atoi
(
value
);
vpx_globals
.
rtp_slice_size
=
UINTVAL
(
val
);
}
else
if
(
!
strcmp
(
name
,
"key-frame-min-freq"
))
{
int
val
=
atoi
(
value
);
vpx_globals
.
key_frame_min_freq
=
UINTVAL
(
val
);
vpx_globals
.
key_frame_min_freq
*=
1000
;
}
else
if
(
!
strcmp
(
name
,
"dec-threads"
))
{
vpx_globals
.
vp8
.
dec_cfg
.
threads
=
switch_parse_cpu_string
(
value
);
vpx_globals
.
vp9
.
dec_cfg
.
threads
=
switch_parse_cpu_string
(
value
);
vpx_globals
.
vp10
.
dec_cfg
.
threads
=
switch_parse_cpu_string
(
value
);
}
else
if
(
!
strcmp
(
name
,
"enc-threads"
))
{
vpx_globals
.
vp8
.
enc_cfg
.
g_threads
=
switch_parse_cpu_string
(
value
);
vpx_globals
.
vp9
.
enc_cfg
.
g_threads
=
switch_parse_cpu_string
(
value
);
vpx_globals
.
vp10
.
enc_cfg
.
g_threads
=
switch_parse_cpu_string
(
value
);
}
else
if
(
!
strcmp
(
name
,
"vp8-profile"
))
{
switch_set_string
(
vpx_globals
.
vp8_profile
,
value
);
}
else
if
(
!
strcmp
(
name
,
"vp9-profile"
))
{
switch_set_string
(
vpx_globals
.
vp9_profile
,
value
);
}
else
if
(
!
strcmp
(
name
,
"vp10-profile"
))
{
switch_set_string
(
vpx_globals
.
vp10_profile
,
value
);
if
(
!
strcmp
(
name
,
vpx_globals
.
profiles
[
i
]
->
name
))
{
if
(
reconfig
)
{
memset
(
vpx_globals
.
profiles
[
i
],
0
,
sizeof
(
my_vpx_cfg_t
));
switch_set_string
(
vpx_globals
.
profiles
[
i
]
->
name
,
name
);
}
return
vpx_globals
.
profiles
[
i
];
}
}
if
(
profiles
)
{
switch_xml_t
profile
=
switch_xml_child
(
profiles
,
"profile"
);
return
NULL
;
}
for
(;
profile
;
profile
=
profile
->
next
)
{
#define UINTVAL(v) (v > 0 ? v : 0);
static
void
parse_config
(
switch_xml_t
profile
)
{
switch_xml_t
param
=
NULL
;
const
char
*
profile_name
=
switch_xml_attr
(
profile
,
"name"
);
my_vpx_cfg_t
*
my_cfg
=
NULL
;
vpx_codec_dec_cfg_t
*
dec_cfg
=
NULL
;
vpx_codec_enc_cfg_t
*
enc_cfg
=
NULL
;
my_vpx_cfg_t
*
my_cfg
=
NULL
;
if
(
zstr
(
profile_name
))
continue
;
if
(
zstr
(
profile_name
))
return
;
if
(
!
strcmp
(
profile_name
,
vpx_globals
.
vp8_profile
))
{
my_cfg
=
&
vpx_globals
.
vp8
;
}
else
if
(
!
strcmp
(
profile_name
,
vpx_globals
.
vp9_profile
))
{
my_cfg
=
&
vpx_globals
.
vp9
;
}
else
if
(
!
strcmp
(
profile_name
,
vpx_globals
.
vp10_profile
))
{
my_cfg
=
&
vpx_globals
.
vp10
;
}
my_cfg
=
find_cfg_profile
(
profile_name
,
SWITCH_TRUE
);
if
(
!
my_cfg
)
continue
;
if
(
!
my_cfg
)
return
;
dec_cfg
=
&
my_cfg
->
dec_cfg
;
enc_cfg
=
&
my_cfg
->
enc_cfg
;
...
...
@@ -1698,10 +1695,10 @@ static void load_config()
}
else
if
(
!
strcmp
(
name
,
"lossless"
))
{
my_cfg
->
lossless
=
UINTVAL
(
val
);
}
else
if
(
!
strcmp
(
name
,
"cpuused"
))
{
if
(
my_cfg
==
&
vpx_globals
.
vp8
)
{
if
(
!
strcmp
(
my_cfg
->
name
,
"vp8"
)
)
{
if
(
val
<
-
16
)
val
=
-
16
;
if
(
val
>
16
)
val
=
16
;
}
else
if
(
my_cfg
==
&
vpx_globals
.
vp9
)
{
}
else
if
(
!
strcmp
(
my_cfg
->
name
,
"vp9"
)
)
{
if
(
val
<
-
8
)
val
=
-
8
;
if
(
val
>
8
)
val
=
8
;
}
...
...
@@ -1725,6 +1722,55 @@ static void load_config()
my_cfg
->
tune_content
=
tune
;
}
}
// for param
}
static
void
load_config
()
{
switch_xml_t
cfg
=
NULL
,
xml
=
NULL
;
my_vpx_cfg_t
*
my_cfg
=
NULL
;
memset
(
&
vpx_globals
,
0
,
sizeof
(
vpx_globals
));
vpx_globals
.
max_bitrate
=
0
;
vpx_globals
.
debug
=
1
;
xml
=
switch_xml_open_cfg
(
"vpx.conf"
,
&
cfg
,
NULL
);
if
(
xml
)
{
switch_xml_t
settings
=
switch_xml_child
(
cfg
,
"settings"
);
switch_xml_t
profiles
=
switch_xml_child
(
cfg
,
"profiles"
);
if
(
settings
)
{
switch_xml_t
param
;
for
(
param
=
switch_xml_child
(
settings
,
"param"
);
param
;
param
=
param
->
next
)
{
const
char
*
name
=
switch_xml_attr
(
param
,
"name"
);
const
char
*
value
=
switch_xml_attr
(
param
,
"value"
);
if
(
zstr
(
name
)
||
zstr
(
value
))
continue
;
if
(
!
strcmp
(
name
,
"max-bitrate"
))
{
vpx_globals
.
max_bitrate
=
switch_parse_bandwidth_string
(
value
);
}
else
if
(
!
strcmp
(
name
,
"rtp-slice-size"
))
{
int
val
=
atoi
(
value
);
vpx_globals
.
rtp_slice_size
=
UINTVAL
(
val
);
}
else
if
(
!
strcmp
(
name
,
"key-frame-min-freq"
))
{
int
val
=
atoi
(
value
);
vpx_globals
.
key_frame_min_freq
=
UINTVAL
(
val
);
vpx_globals
.
key_frame_min_freq
*=
1000
;
}
else
if
(
!
strcmp
(
name
,
"dec-threads"
))
{
vpx_globals
.
dec_threads
=
switch_parse_cpu_string
(
value
);
}
else
if
(
!
strcmp
(
name
,
"enc-threads"
))
{
vpx_globals
.
enc_threads
=
switch_parse_cpu_string
(
value
);
}
}
}
if
(
profiles
)
{
switch_xml_t
profile
=
switch_xml_child
(
profiles
,
"profile"
);
for
(;
profile
;
profile
=
profile
->
next
)
{
parse_config
(
profile
);
}
// for profile
}
// profiles
...
...
@@ -1743,12 +1789,27 @@ static void load_config()
vpx_globals
.
key_frame_min_freq
=
KEY_FRAME_MIN_FREQ
;
}
if
(
!
vpx_globals
.
vp8
.
enc_cfg
.
g_threads
)
vpx_globals
.
vp8
.
enc_cfg
.
g_threads
=
1
;
if
(
!
vpx_globals
.
vp8
.
dec_cfg
.
threads
)
vpx_globals
.
vp8
.
dec_cfg
.
threads
=
switch_parse_cpu_string
(
"cpu/2/4"
);
if
(
!
vpx_globals
.
vp9
.
enc_cfg
.
g_threads
)
vpx_globals
.
vp9
.
enc_cfg
.
g_threads
=
vpx_globals
.
vp8
.
enc_cfg
.
g_threads
;
if
(
!
vpx_globals
.
vp9
.
dec_cfg
.
threads
)
vpx_globals
.
vp9
.
dec_cfg
.
threads
=
vpx_globals
.
vp8
.
dec_cfg
.
threads
;
if
(
!
vpx_globals
.
vp10
.
enc_cfg
.
g_threads
)
vpx_globals
.
vp10
.
enc_cfg
.
g_threads
=
vpx_globals
.
vp8
.
enc_cfg
.
g_threads
;
if
(
!
vpx_globals
.
vp10
.
dec_cfg
.
threads
)
vpx_globals
.
vp10
.
dec_cfg
.
threads
=
vpx_globals
.
vp8
.
dec_cfg
.
threads
;
my_cfg
=
find_cfg_profile
(
"vp8"
,
SWITCH_FALSE
);
if
(
my_cfg
)
{
if
(
!
my_cfg
->
enc_cfg
.
g_threads
)
my_cfg
->
enc_cfg
.
g_threads
=
1
;
if
(
!
my_cfg
->
dec_cfg
.
threads
)
my_cfg
->
dec_cfg
.
threads
=
switch_parse_cpu_string
(
"cpu/2/4"
);
}
my_cfg
=
find_cfg_profile
(
"vp9"
,
SWITCH_FALSE
);
if
(
my_cfg
)
{
if
(
!
my_cfg
->
enc_cfg
.
g_threads
)
my_cfg
->
enc_cfg
.
g_threads
=
1
;
if
(
!
my_cfg
->
dec_cfg
.
threads
)
my_cfg
->
dec_cfg
.
threads
=
switch_parse_cpu_string
(
"cpu/2/4"
);
}
my_cfg
=
find_cfg_profile
(
"vp10"
,
SWITCH_FALSE
);
if
(
my_cfg
)
{
if
(
!
my_cfg
->
enc_cfg
.
g_threads
)
my_cfg
->
enc_cfg
.
g_threads
=
1
;
if
(
!
my_cfg
->
dec_cfg
.
threads
)
my_cfg
->
dec_cfg
.
threads
=
switch_parse_cpu_string
(
"cpu/2/4"
);
}
}
#define VPX_API_SYNTAX "<reload|debug <on|off>>"
...
...
@@ -1764,6 +1825,7 @@ SWITCH_STANDARD_API(vpx_api_function)
if
(
!
strcasecmp
(
cmd
,
"reload"
))
{
const
char
*
err
;
my_vpx_cfg_t
*
my_cfg
;
switch_xml_reload
(
&
err
);
stream
->
write_function
(
stream
,
"Reload XML [%s]
\n
"
,
err
);
...
...
@@ -1773,16 +1835,26 @@ SWITCH_STANDARD_API(vpx_api_function)
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
" %-26s = %d
\n
"
,
"rtp-slice-size"
,
vpx_globals
.
rtp_slice_size
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
" %-26s = %d
\n
"
,
"key-frame-min-freq"
,
vpx_globals
.
key_frame_min_freq
);
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
);
my_cfg
=
find_cfg_profile
(
"vp8"
,
SWITCH_FALSE
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Codec: %s
\n
"
,
vpx_codec_iface_name
(
vpx_codec_vp8_cx
()));
show_config
(
&
vpx_globals
.
vp8
,
&
vpx_globals
.
vp8
.
enc_cfg
);
if
(
my_cfg
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
" %-26s = %d
\n
"
,
"vp8-dec-threads"
,
my_cfg
->
dec_cfg
.
threads
);
show_config
(
my_cfg
,
&
my_cfg
->
enc_cfg
);
}
my_cfg
=
find_cfg_profile
(
"vp9"
,
SWITCH_FALSE
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Codec: %s
\n
"
,
vpx_codec_iface_name
(
vpx_codec_vp9_cx
()));
show_config
(
&
vpx_globals
.
vp9
,
&
vpx_globals
.
vp9
.
enc_cfg
);
if
(
my_cfg
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
" %-26s = %d
\n
"
,
"vp8-dec-threads"
,
my_cfg
->
dec_cfg
.
threads
);
show_config
(
my_cfg
,
&
my_cfg
->
enc_cfg
);
}
my_cfg
=
find_cfg_profile
(
"vp10"
,
SWITCH_FALSE
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Codec: VP10
\n
"
);
show_config
(
&
vpx_globals
.
vp10
,
&
vpx_globals
.
vp10
.
enc_cfg
);
if
(
my_cfg
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
" %-26s = %d
\n
"
,
"vp8-dec-threads"
,
my_cfg
->
dec_cfg
.
threads
);
show_config
(
my_cfg
,
&
my_cfg
->
enc_cfg
);
}
stream
->
write_function
(
stream
,
"+OK
\n
"
);
}
else
if
(
!
strcasecmp
(
cmd
,
"debug"
))
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论