Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
e1321c87
提交
e1321c87
authored
12月 08, 2014
作者:
Anthony Minessale
提交者:
Michael Jerris
5月 28, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7517: fix pack mode 1
上级
51f8679c
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
7 行增加
和
12 行删除
+7
-12
mod_openh264.cpp
src/mod/codecs/mod_openh264/mod_openh264.cpp
+7
-12
没有找到文件。
src/mod/codecs/mod_openh264/mod_openh264.cpp
浏览文件 @
e1321c87
...
...
@@ -41,7 +41,6 @@
#define FPS 30.0f // frame rate
#define H264_NALU_BUFFER_SIZE 65536
#define MAX_NALUS 100
#define SLICE_SIZE SWITCH_DEFAULT_VIDEO_SIZE //NALU Slice Size
SWITCH_MODULE_LOAD_FUNCTION
(
mod_openh264_load
);
...
...
@@ -79,9 +78,6 @@ int FillSpecificParameters(SEncParamExt& param) {
param
.
iPicHeight
=
720
;
// height of picture in samples
param
.
iTargetBitrate
=
1280
*
720
*
8
;
// target bitrate desired
param
.
iRCMode
=
RC_QUALITY_MODE
;
// rc mode control
#ifdef MT_ENABLED
param
.
uiMaxNalSize
=
SLICE_SIZE
;
#endif
param
.
iTemporalLayerNum
=
1
;
// layer number at temporal level
param
.
iSpatialLayerNum
=
1
;
// layer number at spatial level
param
.
bEnableDenoise
=
0
;
// denoise control
...
...
@@ -98,7 +94,7 @@ int FillSpecificParameters(SEncParamExt& param) {
param
.
uiIntraPeriod
=
FPS
*
3
;
// period of Intra frame
#ifdef MT_ENABLED
param
.
bEnableSpsPpsIdAddition
=
1
;
#else
#else
param
.
bEnableSpsPpsIdAddition
=
0
;
#endif
param
.
bPrefixNalAddingCtrl
=
0
;
...
...
@@ -122,6 +118,7 @@ int FillSpecificParameters(SEncParamExt& param) {
#ifdef MT_ENABLED
param
.
sSpatialLayers
[
iIndexLayer
].
sSliceCfg
.
uiSliceMode
=
SM_DYN_SLICE
;
param
.
sSpatialLayers
[
iIndexLayer
].
sSliceCfg
.
sSliceArgument
.
uiSliceSizeConstraint
=
SLICE_SIZE
;
param
.
uiMaxNalSize
=
SLICE_SIZE
;
#else
param
.
sSpatialLayers
[
iIndexLayer
].
sSliceCfg
.
uiSliceMode
=
SM_SINGLE_SLICE
;
#endif
...
...
@@ -252,11 +249,6 @@ static switch_status_t nalu_slice(h264_codec_context_t *context, switch_frame_t
switch_assert
(
nalu_len
>
0
);
if
(
nalu_len
>
SLICE_SIZE
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"LARGE SLICE OVER MTU %d BYTES
\n
"
,
nalu_len
);
}
//DFF The else branch here is not working. Whatever it's doing is creating corrupt picture.
if
(
nalu_len
<=
SLICE_SIZE
)
{
uint8_t
nalu_type
;
...
...
@@ -267,7 +259,7 @@ static switch_status_t nalu_slice(h264_codec_context_t *context, switch_frame_t
memcpy
(
frame
->
data
,
(
buffer
+
context
->
last_nalu_data_pos
),
nalu_len
);
frame
->
datalen
=
nalu_len
;
// *flag |= (nalu_type == 6 || nalu_type == 7 || nalu_type == 8 || (nalu_type == 0xe && context->last_nalu_type == 8)) ? 0 : SFF_MARKER;
if
((
context
->
cur_nalu_index
==
context
->
bit_stream_info
.
sLayerInfo
[
context
->
cur_layer
].
iNalCount
-
1
)
&&
(
context
->
cur_layer
==
context
->
bit_stream_info
.
iLayerNum
-
1
))
{
frame
->
m
=
SWITCH_TRUE
;
...
...
@@ -296,7 +288,7 @@ static switch_status_t nalu_slice(h264_codec_context_t *context, switch_frame_t
start_bit
=
0x80
;
context
->
last_nalu_data_pos
+=
4
;
context
->
last_nalu_type
=
*
(
buffer
+
context
->
last_nalu_data_pos
)
&
0x1f
;
context
->
last_nri
=
context
->
last_nalu_type
&
0x60
;
context
->
last_nri
=
*
(
buffer
+
context
->
last_nalu_data_pos
)
&
0x60
;
context
->
last_nalu_data_pos
++
;
context
->
nalu_eat
=
5
;
}
...
...
@@ -325,6 +317,9 @@ static switch_status_t nalu_slice(h264_codec_context_t *context, switch_frame_t
}
end:
#if 0
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%d mark=%d BYTES datalen:%d %02x %02x\n", nalu_len, frame->m, frame->datalen, *((uint8_t *)frame->data), *((uint8_t *)frame->data + 1));
#endif
return
status
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论