Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
ZLMediaKit
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
张翔宇
ZLMediaKit
Commits
26dd99d1
Commit
26dd99d1
authored
Nov 19, 2018
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善rtsp画面秒开机制
parent
cc1a7843
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
21 行增加
和
22 行删除
+21
-22
src/RtspMuxer/H264RtpCodec.cpp
+9
-10
src/RtspMuxer/H264RtpCodec.h
+1
-1
src/RtspMuxer/H265RtpCodec.cpp
+10
-10
src/RtspMuxer/H265RtpCodec.h
+1
-1
没有找到文件。
src/RtspMuxer/H264RtpCodec.cpp
查看文件 @
26dd99d1
...
...
@@ -206,27 +206,25 @@ void H264RtpEncoder::inputFrame(const Frame::Ptr &frame) {
iSize
=
iLen
-
nOffset
;
mark
=
true
;
s_e_r_type
=
s_e_r_End
+
naluType
;
}
else
if
(
bFirst
)
{
s_e_r_type
=
s_e_r_Start
+
naluType
;
}
else
{
if
(
bFirst
==
true
)
{
s_e_r_type
=
s_e_r_Start
+
naluType
;
bFirst
=
false
;
}
else
{
s_e_r_type
=
s_e_r_Mid
+
naluType
;
}
s_e_r_type
=
s_e_r_Mid
+
naluType
;
}
memcpy
(
_aucSectionBuf
,
&
f_nri_type
,
1
);
memcpy
(
_aucSectionBuf
+
1
,
&
s_e_r_type
,
1
);
memcpy
(
_aucSectionBuf
+
2
,
(
unsigned
char
*
)
pcData
+
nOffset
,
iSize
);
nOffset
+=
iSize
;
makeH264Rtp
(
naluType
,
_aucSectionBuf
,
iSize
+
2
,
mark
,
uiStamp
);
makeH264Rtp
(
naluType
,
_aucSectionBuf
,
iSize
+
2
,
mark
,
bFirst
,
uiStamp
);
bFirst
=
false
;
}
}
else
{
makeH264Rtp
(
naluType
,
pcData
,
iLen
,
true
,
uiStamp
);
makeH264Rtp
(
naluType
,
pcData
,
iLen
,
true
,
true
,
uiStamp
);
}
}
void
H264RtpEncoder
::
makeH264Rtp
(
int
nal_type
,
const
void
*
data
,
unsigned
int
len
,
bool
mark
,
uint32_t
uiStamp
)
{
RtpCodec
::
inputRtp
(
makeRtp
(
getTrackType
(),
data
,
len
,
mark
,
uiStamp
),
nal_type
==
H264Frame
::
NAL_SPS
);
void
H264RtpEncoder
::
makeH264Rtp
(
int
nal_type
,
const
void
*
data
,
unsigned
int
len
,
bool
mark
,
bool
first_packet
,
uint32_t
uiStamp
)
{
RtpCodec
::
inputRtp
(
makeRtp
(
getTrackType
(),
data
,
len
,
mark
,
uiStamp
),
first_packet
&&
nal_type
==
H264Frame
::
NAL_IDR
);
}
}
//
namespace
mediakit
\ No newline at end of file
src/RtspMuxer/H264RtpCodec.h
查看文件 @
26dd99d1
...
...
@@ -93,7 +93,7 @@ public:
*/
void
inputFrame
(
const
Frame
::
Ptr
&
frame
)
override
;
private
:
void
makeH264Rtp
(
int
nal_type
,
const
void
*
pData
,
unsigned
int
uiLen
,
bool
bMark
,
uint32_t
uiStamp
);
void
makeH264Rtp
(
int
nal_type
,
const
void
*
pData
,
unsigned
int
uiLen
,
bool
bMark
,
bool
first_packet
,
uint32_t
uiStamp
);
private
:
unsigned
char
_aucSectionBuf
[
1600
];
};
...
...
src/RtspMuxer/H265RtpCodec.cpp
查看文件 @
26dd99d1
...
...
@@ -188,29 +188,28 @@ void H265RtpEncoder::inputFrame(const Frame::Ptr &frame) {
maxSize
=
iLen
-
nOffset
;
mark
=
true
;
s_e_type
=
1
<<
6
|
naluType
;
}
else
{
if
(
bFirst
==
true
)
{
}
else
if
(
bFirst
)
{
s_e_type
=
1
<<
7
|
naluType
;
bFirst
=
false
;
}
else
{
s_e_type
=
naluType
;
}
}
else
{
s_e_type
=
naluType
;
}
//FU type
_aucSectionBuf
[
0
]
=
49
<<
1
;
_aucSectionBuf
[
1
]
=
1
;
_aucSectionBuf
[
2
]
=
s_e_type
;
memcpy
(
_aucSectionBuf
+
3
,
pcData
+
nOffset
,
maxSize
);
nOffset
+=
maxSize
;
makeH265Rtp
(
naluType
,
_aucSectionBuf
,
maxSize
+
3
,
mark
,
uiStamp
);
makeH265Rtp
(
naluType
,
_aucSectionBuf
,
maxSize
+
3
,
mark
,
bFirst
,
uiStamp
);
bFirst
=
false
;
}
}
else
{
makeH265Rtp
(
naluType
,
pcData
,
iLen
,
true
,
uiStamp
);
makeH265Rtp
(
naluType
,
pcData
,
iLen
,
true
,
true
,
uiStamp
);
}
}
void
H265RtpEncoder
::
makeH265Rtp
(
int
nal_type
,
const
void
*
data
,
unsigned
int
len
,
bool
mark
,
uint32_t
uiStamp
)
{
RtpCodec
::
inputRtp
(
makeRtp
(
getTrackType
(),
data
,
len
,
mark
,
uiStamp
),
nal_type
==
H265Frame
::
NAL_VPS
);
void
H265RtpEncoder
::
makeH265Rtp
(
int
nal_type
,
const
void
*
data
,
unsigned
int
len
,
bool
mark
,
bool
first_packet
,
uint32_t
uiStamp
)
{
RtpCodec
::
inputRtp
(
makeRtp
(
getTrackType
(),
data
,
len
,
mark
,
uiStamp
),
first_packet
&&
H265Frame
::
isKeyFrame
(
nal_type
)
);
}
}
//
namespace
mediakit
\ No newline at end of file
src/RtspMuxer/H265RtpCodec.h
查看文件 @
26dd99d1
...
...
@@ -94,7 +94,7 @@ public:
*/
void
inputFrame
(
const
Frame
::
Ptr
&
frame
)
override
;
private
:
void
makeH265Rtp
(
int
nal_type
,
const
void
*
pData
,
unsigned
int
uiLen
,
bool
bMark
,
uint32_t
uiStamp
);
void
makeH265Rtp
(
int
nal_type
,
const
void
*
pData
,
unsigned
int
uiLen
,
bool
bMark
,
bool
first_packet
,
uint32_t
uiStamp
);
private
:
unsigned
char
_aucSectionBuf
[
1600
];
};
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论