Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
753f49fe
提交
753f49fe
authored
12月 10, 2014
作者:
Anthony Minessale
提交者:
Michael Jerris
5月 28, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7517: use start and end bits
上级
f5346bfe
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
45 行增加
和
4 行删除
+45
-4
mod_av.c
src/mod/applications/mod_av/mod_av.c
+17
-1
mod_openh264.cpp
src/mod/codecs/mod_openh264/mod_openh264.cpp
+28
-3
没有找到文件。
src/mod/applications/mod_av/mod_av.c
浏览文件 @
753f49fe
...
@@ -235,9 +235,25 @@ static void buffer_h264_nalu(h264_codec_context_t *context, switch_frame_t *fram
...
@@ -235,9 +235,25 @@ static void buffer_h264_nalu(h264_codec_context_t *context, switch_frame_t *fram
if
((
nalu_type
==
7
||
nalu_type
==
8
)
&&
frame
->
m
)
frame
->
m
=
SWITCH_FALSE
;
if
((
nalu_type
==
7
||
nalu_type
==
8
)
&&
frame
->
m
)
frame
->
m
=
SWITCH_FALSE
;
if
(
nalu_type
==
28
)
{
// 0x1c FU-A
if
(
nalu_type
==
28
)
{
// 0x1c FU-A
int
start
=
*
(
data
+
1
)
&
0x80
;
int
end
=
*
(
data
+
1
)
&
0x40
;
nalu_type
=
*
(
data
+
1
)
&
0x1f
;
nalu_type
=
*
(
data
+
1
)
&
0x1f
;
if
(
context
->
nalu_28_start
==
0
)
{
if
(
start
&&
end
)
return
;
if
(
start
)
{
if
(
context
->
nalu_28_start
)
{
context
->
nalu_28_start
=
0
;
switch_buffer_zero
(
buffer
);
}
}
else
if
(
end
)
{
context
->
nalu_28_start
=
0
;
}
else
if
(
!
context
->
nalu_28_start
)
{
return
;
}
if
(
start
)
{
uint8_t
nalu_idc
=
(
nalu_hdr
&
0x60
)
>>
5
;
uint8_t
nalu_idc
=
(
nalu_hdr
&
0x60
)
>>
5
;
nalu_type
|=
(
nalu_idc
<<
5
);
nalu_type
|=
(
nalu_idc
<<
5
);
...
...
src/mod/codecs/mod_openh264/mod_openh264.cpp
浏览文件 @
753f49fe
...
@@ -167,6 +167,8 @@ static switch_size_t buffer_h264_nalu(h264_codec_context_t *context, switch_fram
...
@@ -167,6 +167,8 @@ static switch_size_t buffer_h264_nalu(h264_codec_context_t *context, switch_fram
return
0
;
return
0
;
}
}
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "XXX GOT %d\n", nalu_type);
if
(
!
context
->
got_sps
)
{
if
(
!
context
->
got_sps
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Found SPS/PPS
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Found SPS/PPS
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"=========================================================================================
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"=========================================================================================
\n
"
);
...
@@ -177,12 +179,31 @@ static switch_size_t buffer_h264_nalu(h264_codec_context_t *context, switch_fram
...
@@ -177,12 +179,31 @@ static switch_size_t buffer_h264_nalu(h264_codec_context_t *context, switch_fram
if
((
nalu_type
==
7
||
nalu_type
==
8
)
&&
frame
->
m
)
frame
->
m
=
SWITCH_FALSE
;
if
((
nalu_type
==
7
||
nalu_type
==
8
)
&&
frame
->
m
)
frame
->
m
=
SWITCH_FALSE
;
if
(
nalu_type
==
28
)
{
// 0x1c FU-A
if
(
nalu_type
==
28
)
{
// 0x1c FU-A
int
start
=
*
(
data
+
1
)
&
0x80
;
int
end
=
*
(
data
+
1
)
&
0x40
;
nalu_type
=
*
(
data
+
1
)
&
0x1f
;
nalu_type
=
*
(
data
+
1
)
&
0x1f
;
if
(
context
->
nalu_28_start
==
0
)
{
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "WTF start:%d end:%d mark:%d\n", start, end, frame->m);
uint8_t
nalu_idc
=
(
nalu_hdr
&
0x60
)
>>
5
;
nalu_type
|=
(
nalu_idc
<<
5
)
;
if
(
frame
->
m
)
end
=
1
;
if
(
start
&&
end
)
return
1
;
if
(
start
)
{
if
(
context
->
nalu_28_start
)
{
context
->
nalu_28_start
=
0
;
switch_buffer_zero
(
buffer
);
}
}
else
if
(
end
)
{
context
->
nalu_28_start
=
0
;
}
else
if
(
!
context
->
nalu_28_start
)
{
return
0
;
}
if
(
start
)
{
//uint8_t nalu_idc = (nalu_hdr & 0x60) >> 5;
nalu_type
|=
(
nalu_idc
<<
5
);
size
=
switch_buffer_write
(
buffer
,
sync_bytes
,
sizeof
(
sync_bytes
));
size
=
switch_buffer_write
(
buffer
,
sync_bytes
,
sizeof
(
sync_bytes
));
size
=
switch_buffer_write
(
buffer
,
&
nalu_type
,
1
);
size
=
switch_buffer_write
(
buffer
,
&
nalu_type
,
1
);
context
->
nalu_28_start
=
1
;
context
->
nalu_28_start
=
1
;
...
@@ -514,6 +535,10 @@ static switch_status_t switch_h264_decode(switch_codec_t *codec, switch_frame_t
...
@@ -514,6 +535,10 @@ static switch_status_t switch_h264_decode(switch_codec_t *codec, switch_frame_t
size
=
buffer_h264_nalu
(
context
,
frame
);
size
=
buffer_h264_nalu
(
context
,
frame
);
// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "READ buf:%ld got_key:%d st:%d m:%d size:%" SWITCH_SIZE_T_FMT "\n", size, context->got_sps, status, frame->m, size);
// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "READ buf:%ld got_key:%d st:%d m:%d size:%" SWITCH_SIZE_T_FMT "\n", size, context->got_sps, status, frame->m, size);
if
(
size
==
1
)
{
switch_goto_status
(
SWITCH_STATUS_RESTART
,
end
);
}
if
(
frame
->
m
&&
size
)
{
if
(
frame
->
m
&&
size
)
{
int
got_picture
=
0
;
int
got_picture
=
0
;
int
i
;
int
i
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论