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
bd8a9a78
Commit
bd8a9a78
authored
Dec 13, 2019
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtp代理防止时间戳回环
parent
fbf0f635
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
8 行增加
和
3 行删除
+8
-3
src/Rtp/RtpProcess.cpp
+6
-3
src/Rtp/RtpProcess.h
+2
-0
没有找到文件。
src/Rtp/RtpProcess.cpp
查看文件 @
bd8a9a78
...
@@ -183,6 +183,9 @@ void RtpProcess::onPSDecode(int stream,
...
@@ -183,6 +183,9 @@ void RtpProcess::onPSDecode(int stream,
int64_t
dts
,
int64_t
dts
,
const
void
*
data
,
const
void
*
data
,
int
bytes
)
{
int
bytes
)
{
pts
/=
90
;
dts
/=
90
;
_stamps
[
codecid
].
revise
(
dts
,
pts
,
dts
,
pts
,
false
);
switch
(
codecid
)
{
switch
(
codecid
)
{
case
STREAM_VIDEO_H264
:
{
case
STREAM_VIDEO_H264
:
{
...
@@ -202,7 +205,7 @@ void RtpProcess::onPSDecode(int stream,
...
@@ -202,7 +205,7 @@ void RtpProcess::onPSDecode(int stream,
if
(
_save_file_video
){
if
(
_save_file_video
){
fwrite
((
uint8_t
*
)
data
,
bytes
,
1
,
_save_file_video
.
get
());
fwrite
((
uint8_t
*
)
data
,
bytes
,
1
,
_save_file_video
.
get
());
}
}
auto
frame
=
std
::
make_shared
<
H264FrameNoCacheAble
>
((
char
*
)
data
,
bytes
,
dts
/
90
,
pts
/
90
,
0
);
auto
frame
=
std
::
make_shared
<
H264FrameNoCacheAble
>
((
char
*
)
data
,
bytes
,
dts
,
pts
,
0
);
_merger
->
inputFrame
(
frame
,[
this
](
uint32_t
dts
,
uint32_t
pts
,
const
Buffer
::
Ptr
&
buffer
)
{
_merger
->
inputFrame
(
frame
,[
this
](
uint32_t
dts
,
uint32_t
pts
,
const
Buffer
::
Ptr
&
buffer
)
{
_muxer
->
inputFrame
(
std
::
make_shared
<
H264FrameNoCacheAble
>
(
buffer
->
data
(),
buffer
->
size
(),
dts
,
pts
,
4
));
_muxer
->
inputFrame
(
std
::
make_shared
<
H264FrameNoCacheAble
>
(
buffer
->
data
(),
buffer
->
size
(),
dts
,
pts
,
4
));
});
});
...
@@ -224,7 +227,7 @@ void RtpProcess::onPSDecode(int stream,
...
@@ -224,7 +227,7 @@ void RtpProcess::onPSDecode(int stream,
if
(
_save_file_video
){
if
(
_save_file_video
){
fwrite
((
uint8_t
*
)
data
,
bytes
,
1
,
_save_file_video
.
get
());
fwrite
((
uint8_t
*
)
data
,
bytes
,
1
,
_save_file_video
.
get
());
}
}
auto
frame
=
std
::
make_shared
<
H265FrameNoCacheAble
>
((
char
*
)
data
,
bytes
,
dts
/
90
,
pts
/
90
,
0
);
auto
frame
=
std
::
make_shared
<
H265FrameNoCacheAble
>
((
char
*
)
data
,
bytes
,
dts
,
pts
,
0
);
_merger
->
inputFrame
(
frame
,[
this
](
uint32_t
dts
,
uint32_t
pts
,
const
Buffer
::
Ptr
&
buffer
)
{
_merger
->
inputFrame
(
frame
,[
this
](
uint32_t
dts
,
uint32_t
pts
,
const
Buffer
::
Ptr
&
buffer
)
{
_muxer
->
inputFrame
(
std
::
make_shared
<
H265FrameNoCacheAble
>
(
buffer
->
data
(),
buffer
->
size
(),
dts
,
pts
,
4
));
_muxer
->
inputFrame
(
std
::
make_shared
<
H265FrameNoCacheAble
>
(
buffer
->
data
(),
buffer
->
size
(),
dts
,
pts
,
4
));
});
});
...
@@ -244,7 +247,7 @@ void RtpProcess::onPSDecode(int stream,
...
@@ -244,7 +247,7 @@ void RtpProcess::onPSDecode(int stream,
WarnL
<<
"audio track change to AAC from codecid:"
<<
_codecid_audio
;
WarnL
<<
"audio track change to AAC from codecid:"
<<
_codecid_audio
;
return
;
return
;
}
}
_muxer
->
inputFrame
(
std
::
make_shared
<
AACFrameNoCacheAble
>
((
char
*
)
data
,
bytes
,
dts
/
90
,
7
));
_muxer
->
inputFrame
(
std
::
make_shared
<
AACFrameNoCacheAble
>
((
char
*
)
data
,
bytes
,
dts
,
7
));
break
;
break
;
}
}
default
:
default
:
...
...
src/Rtp/RtpProcess.h
查看文件 @
bd8a9a78
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#include "RtpDecoder.h"
#include "RtpDecoder.h"
#include "PSDecoder.h"
#include "PSDecoder.h"
#include "Common/Device.h"
#include "Common/Device.h"
#include "Common/Stamp.h"
using
namespace
mediakit
;
using
namespace
mediakit
;
namespace
mediakit
{
namespace
mediakit
{
...
@@ -72,6 +73,7 @@ private:
...
@@ -72,6 +73,7 @@ private:
MultiMediaSourceMuxer
::
Ptr
_muxer
;
MultiMediaSourceMuxer
::
Ptr
_muxer
;
std
::
shared_ptr
<
FrameMerger
>
_merger
;
std
::
shared_ptr
<
FrameMerger
>
_merger
;
Ticker
_last_rtp_time
;
Ticker
_last_rtp_time
;
map
<
int
,
Stamp
>
_stamps
;
};
};
}
//namespace mediakit
}
//namespace mediakit
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论