Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
1eacc9f4
提交
1eacc9f4
authored
6月 14, 2018
作者:
Seven Du
提交者:
Muteesa Fred
7月 24, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-11189 add vpx codec specific and debug controls
上级
c58da50f
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
40 行增加
和
20 行删除
+40
-20
switch_vpx.c
src/switch_vpx.c
+40
-20
没有找到文件。
src/switch_vpx.c
浏览文件 @
1eacc9f4
...
...
@@ -306,6 +306,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_vpx_load);
SWITCH_MODULE_DEFINITION
(
CORE_VPX_MODULE
,
mod_vpx_load
,
NULL
,
NULL
);
struct
vpx_context
{
int
debug
;
switch_codec_t
*
codec
;
int
is_vp9
;
vp9_info_t
vp9
;
...
...
@@ -840,11 +841,10 @@ static switch_status_t buffer_vp8_packets(vpx_context_t *context, switch_frame_t
uint8_t
DES
;
// uint8_t PID;
int
len
;
#if 0
int key = 0;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
"VIDEO VPX: seq: %d ts: %u len: %ld %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x mark: %d\n",
if
(
context
->
debug
>
0
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
context
->
debug
,
"VIDEO VPX: seq: %d ts: %u len: %u %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x mark: %d
\n
"
,
frame
->
seq
,
frame
->
timestamp
,
frame
->
datalen
,
*
((
uint8_t
*
)
data
),
*
((
uint8_t
*
)
data
+
1
),
*
((
uint8_t
*
)
data
+
2
),
*
((
uint8_t
*
)
data
+
3
),
...
...
@@ -852,8 +852,7 @@ static switch_status_t buffer_vp8_packets(vpx_context_t *context, switch_frame_t
*
((
uint8_t
*
)
data
+
6
),
*
((
uint8_t
*
)
data
+
7
),
*
((
uint8_t
*
)
data
+
8
),
*
((
uint8_t
*
)
data
+
9
),
*
((
uint8_t
*
)
data
+
10
),
frame
->
m
);
#endif
}
DES
=
*
data
;
data
++
;
...
...
@@ -931,8 +930,8 @@ static switch_status_t buffer_vp9_packets(vpx_context_t *context, switch_frame_t
vp9_payload_descriptor_t
*
desc
=
(
vp9_payload_descriptor_t
*
)
vp9
;
int
len
=
0
;
#ifdef DEBUG_VP9
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
frame
->
m
?
SWITCH_LOG_ERROR
:
SWITCH_LOG_INFO
,
if
(
context
->
debug
>
0
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
frame
->
m
?
SWITCH_LOG_ERROR
:
SWITCH_LOG_INFO
,
"[%02x %02x %02x %02x] m=%d len=%4d seq=%d ts=%u ssrc=%u "
"have_pid=%d "
"have_p_layer=%d "
...
...
@@ -951,7 +950,7 @@ static switch_status_t buffer_vp9_packets(vpx_context_t *context, switch_frame_t
desc
->
end
,
desc
->
have_ss
,
desc
->
zero
);
#endif
}
vp9
++
;
...
...
@@ -1066,12 +1065,12 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
int
is_start
=
0
,
is_keyframe
=
0
,
get_refresh
=
0
;
#if 0
vp9_payload_descriptor_t *desc = (vp9_payload_descriptor_t *)frame->data;
uint8_t *data = frame->data;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%02x %02x %02x %02x m=%d start=%d end=%d m=%d len=%d\n",
*data, *(data+1), *(data+2), *(data+3), frame->m, desc->start, desc->end, frame->m, frame->datalen);
#endif
if
(
context
->
debug
>
0
&&
context
->
debug
<
4
)
{
vp9_payload_descriptor_t
*
desc
=
(
vp9_payload_descriptor_t
*
)
frame
->
data
;
uint8_t
*
data
=
frame
->
data
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"%02x %02x %02x %02x m=%d start=%d end=%d m=%d len=%d
\n
"
,
*
data
,
*
(
data
+
1
),
*
(
data
+
2
),
*
(
data
+
3
),
frame
->
m
,
desc
->
start
,
desc
->
end
,
frame
->
m
,
frame
->
datalen
);
}
if
(
context
->
is_vp9
)
{
is_keyframe
=
IS_VP9_KEY_FRAME
(
*
(
unsigned
char
*
)
frame
->
data
);
...
...
@@ -1090,10 +1089,6 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
}
else
{
// vp8
is_start
=
(
*
(
unsigned
char
*
)
frame
->
data
&
0x10
);
is_keyframe
=
IS_VP8_KEY_FRAME
((
uint8_t
*
)
frame
->
data
);
#ifdef DEBUG_VP9
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"VP8
\n
"
);
#endif
}
if
(
!
is_keyframe
&&
context
->
got_key_frame
<=
0
)
{
...
...
@@ -1106,7 +1101,9 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
}
}
// if (is_keyframe) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "got key %d\n", context->got_key_frame);
if
(
context
->
debug
>
0
&&
is_keyframe
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"GOT KEY FRAME %d
\n
"
,
context
->
got_key_frame
);
}
if
(
context
->
need_decoder_reset
!=
0
)
{
vpx_codec_destroy
(
&
context
->
decoder
);
...
...
@@ -1294,6 +1291,29 @@ static switch_status_t switch_vpx_control(switch_codec_t *codec,
}
}
break
;
case
SCC_CODEC_SPECIFIC
:
{
const
char
*
command
=
(
const
char
*
)
cmd_data
;
if
(
ctype
==
SCCT_INT
)
{
}
else
if
(
ctype
==
SCCT_STRING
&&
!
zstr
(
command
))
{
if
(
!
strcasecmp
(
command
,
"VP8E_SET_CPUUSED"
))
{
vpx_codec_control
(
&
context
->
encoder
,
VP8E_SET_CPUUSED
,
*
(
int
*
)
cmd_arg
);
}
else
if
(
!
strcasecmp
(
command
,
"VP8E_SET_TOKEN_PARTITIONS"
))
{
vpx_codec_control
(
&
context
->
encoder
,
VP8E_SET_TOKEN_PARTITIONS
,
*
(
int
*
)
cmd_arg
);
}
else
if
(
!
strcasecmp
(
command
,
"VP8E_SET_NOISE_SENSITIVITY"
))
{
vpx_codec_control
(
&
context
->
encoder
,
VP8E_SET_NOISE_SENSITIVITY
,
*
(
int
*
)
cmd_arg
);
}
}
}
break
;
case
SCC_DEBUG
:
{
int32_t
level
=
*
((
uint32_t
*
)
cmd_data
);
context
->
debug
=
level
;
}
break
;
default:
break
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论