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
c7225dff
Commit
c7225dff
authored
Aug 01, 2020
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整理rtsp客户端代码
parent
5d436d0a
全部展开
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
23 行增加
和
21 行删除
+23
-21
src/Rtsp/RtspPlayer.cpp
+0
-0
src/Rtsp/RtspPlayer.h
+23
-21
没有找到文件。
src/Rtsp/RtspPlayer.cpp
查看文件 @
c7225dff
差异被折叠。
点击展开。
src/Rtsp/RtspPlayer.h
查看文件 @
c7225dff
...
@@ -36,16 +36,18 @@ class RtspPlayer: public PlayerBase,public TcpClient, public RtspSplitter, publi
...
@@ -36,16 +36,18 @@ class RtspPlayer: public PlayerBase,public TcpClient, public RtspSplitter, publi
public
:
public
:
typedef
std
::
shared_ptr
<
RtspPlayer
>
Ptr
;
typedef
std
::
shared_ptr
<
RtspPlayer
>
Ptr
;
RtspPlayer
(
const
EventPoller
::
Ptr
&
poller
)
;
RtspPlayer
(
const
EventPoller
::
Ptr
&
poller
);
virtual
~
RtspPlayer
(
void
);
~
RtspPlayer
()
override
;
void
play
(
const
string
&
strUrl
)
override
;
void
play
(
const
string
&
strUrl
)
override
;
void
pause
(
bool
bPause
)
override
;
void
pause
(
bool
pause_flag
)
override
;
void
teardown
()
override
;
void
teardown
()
override
;
float
getPacketLossRate
(
TrackType
type
)
const
override
;
float
getPacketLossRate
(
TrackType
type
)
const
override
;
protected
:
protected
:
//派生类回调函数
//派生类回调函数
virtual
bool
onCheckSDP
(
const
string
&
s
trS
dp
)
=
0
;
virtual
bool
onCheckSDP
(
const
string
&
sdp
)
=
0
;
virtual
void
onRecvRTP
(
const
RtpPacket
::
Ptr
&
pRtppt
,
const
SdpTrack
::
Ptr
&
track
)
=
0
;
virtual
void
onRecvRTP
(
const
RtpPacket
::
Ptr
&
rtp
,
const
SdpTrack
::
Ptr
&
track
)
=
0
;
uint32_t
getProgressMilliSecond
()
const
;
uint32_t
getProgressMilliSecond
()
const
;
void
seekToMilliSecond
(
uint32_t
ms
);
void
seekToMilliSecond
(
uint32_t
ms
);
...
@@ -64,47 +66,48 @@ protected:
...
@@ -64,47 +66,48 @@ protected:
/**
/**
* rtp数据包排序后输出
* rtp数据包排序后输出
* @param rtp
pt
rtp数据包
* @param rtp rtp数据包
* @param trackidx track索引
* @param track
_
idx track索引
*/
*/
void
onRtpSorted
(
const
RtpPacket
::
Ptr
&
rtppt
,
int
trackidx
)
override
;
void
onRtpSorted
(
const
RtpPacket
::
Ptr
&
rtp
,
int
track_idx
)
override
;
/**
/**
* 收到RTCP包回调
* 收到RTCP包回调
* @param
iTrackidx
* @param
track_idx track索引
* @param track
* @param track
sdp相关信息
* @param
pucData
* @param
data rtcp内容
* @param
uiLen
* @param
len rtcp内容长度
*/
*/
virtual
void
onRtcpPacket
(
int
iTrackidx
,
SdpTrack
::
Ptr
&
track
,
unsigned
char
*
pucData
,
unsigned
int
uiL
en
);
virtual
void
onRtcpPacket
(
int
track_idx
,
SdpTrack
::
Ptr
&
track
,
unsigned
char
*
data
,
unsigned
int
l
en
);
/////////////TcpClient override/////////////
/////////////TcpClient override/////////////
void
onConnect
(
const
SockException
&
err
)
override
;
void
onConnect
(
const
SockException
&
err
)
override
;
void
onRecv
(
const
Buffer
::
Ptr
&
pB
uf
)
override
;
void
onRecv
(
const
Buffer
::
Ptr
&
b
uf
)
override
;
void
onErr
(
const
SockException
&
ex
)
override
;
void
onErr
(
const
SockException
&
ex
)
override
;
private
:
private
:
void
onRecvRTP_l
(
const
RtpPacket
::
Ptr
&
pRtppt
,
const
SdpTrack
::
Ptr
&
track
);
void
onRecvRTP_l
(
const
RtpPacket
::
Ptr
&
rtp
,
const
SdpTrack
::
Ptr
&
track
);
void
onPlayResult_l
(
const
SockException
&
ex
,
bool
handshakeCompleted
);
void
onPlayResult_l
(
const
SockException
&
ex
,
bool
handshakeCompleted
);
int
getTrackIndexByInterleaved
(
int
interleaved
)
const
;
int
getTrackIndexByInterleaved
(
int
interleaved
)
const
;
int
getTrackIndexByTrackType
(
TrackType
track
T
ype
)
const
;
int
getTrackIndexByTrackType
(
TrackType
track
_t
ype
)
const
;
void
handleResSETUP
(
const
Parser
&
parser
,
unsigned
int
uiTrackInde
x
);
void
handleResSETUP
(
const
Parser
&
parser
,
unsigned
int
track_id
x
);
void
handleResDESCRIBE
(
const
Parser
&
parser
);
void
handleResDESCRIBE
(
const
Parser
&
parser
);
bool
handleAuthenticationFailure
(
const
string
&
wwwAuthenticateParamsStr
);
bool
handleAuthenticationFailure
(
const
string
&
wwwAuthenticateParamsStr
);
void
handleResPAUSE
(
const
Parser
&
parser
,
int
type
);
void
handleResPAUSE
(
const
Parser
&
parser
,
int
type
);
bool
handleResponse
(
const
string
&
cmd
,
const
Parser
&
parser
);
bool
handleResponse
(
const
string
&
cmd
,
const
Parser
&
parser
);
void
sendOptions
();
void
sendOptions
();
void
sendSetup
(
unsigned
int
uiTrackInde
x
);
void
sendSetup
(
unsigned
int
track_id
x
);
void
sendPause
(
int
type
,
uint32_t
ms
);
void
sendPause
(
int
type
,
uint32_t
ms
);
void
sendDescribe
();
void
sendDescribe
();
void
sendKeepAlive
();
void
sendKeepAlive
();
void
sendRtspRequest
(
const
string
&
cmd
,
const
string
&
url
,
const
StrCaseMap
&
header
=
StrCaseMap
());
void
sendRtspRequest
(
const
string
&
cmd
,
const
string
&
url
,
const
StrCaseMap
&
header
=
StrCaseMap
());
void
sendRtspRequest
(
const
string
&
cmd
,
const
string
&
url
,
const
std
::
initializer_list
<
string
>
&
header
);
void
sendRtspRequest
(
const
string
&
cmd
,
const
string
&
url
,
const
std
::
initializer_list
<
string
>
&
header
);
void
sendReceiverReport
(
bool
over
Tcp
,
int
iTrackInde
x
);
void
sendReceiverReport
(
bool
over
_tcp
,
int
track_id
x
);
void
createUdpSockIfNecessary
(
int
track_idx
);
void
createUdpSockIfNecessary
(
int
track_idx
);
private
:
private
:
string
_play_url
;
string
_play_url
;
vector
<
SdpTrack
::
Ptr
>
_sdp_track
;
vector
<
SdpTrack
::
Ptr
>
_sdp_track
;
...
@@ -148,5 +151,4 @@ private:
...
@@ -148,5 +151,4 @@ private:
};
};
}
/* namespace mediakit */
}
/* namespace mediakit */
#endif
/* SRC_RTSPPLAYER_RTSPPLAYER_H_TXT_ */
#endif
/* SRC_RTSPPLAYER_RTSPPLAYER_H_TXT_ */
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论