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
dad0c5e3
Commit
dad0c5e3
authored
Nov 09, 2021
by
ziyue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MediaPusher: 抽象精简代码
parent
b96a2291
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
58 行增加
和
70 行删除
+58
-70
src/Pusher/PusherBase.cpp
+5
-5
src/Pusher/PusherBase.h
+27
-12
src/Rtmp/RtmpPusher.cpp
+10
-14
src/Rtmp/RtmpPusher.h
+3
-13
src/Rtsp/RtspPusher.cpp
+10
-14
src/Rtsp/RtspPusher.h
+3
-12
没有找到文件。
src/Pusher/PusherBase.cpp
查看文件 @
dad0c5e3
...
@@ -30,22 +30,22 @@ PusherBase::Ptr PusherBase::createPusher(const EventPoller::Ptr &poller,
...
@@ -30,22 +30,22 @@ PusherBase::Ptr PusherBase::createPusher(const EventPoller::Ptr &poller,
string
prefix
=
FindField
(
strUrl
.
data
(),
NULL
,
"://"
);
string
prefix
=
FindField
(
strUrl
.
data
(),
NULL
,
"://"
);
if
(
strcasecmp
(
"rtsps"
,
prefix
.
data
())
==
0
)
{
if
(
strcasecmp
(
"rtsps"
,
prefix
.
data
())
==
0
)
{
return
PusherBase
::
Ptr
(
new
TcpClientWithSSL
<
RtspPusher
>
(
poller
,
dynamic_pointer_cast
<
RtspMediaSource
>
(
src
)),
releasePusher
);
return
PusherBase
::
Ptr
(
new
TcpClientWithSSL
<
RtspPusher
Imp
>
(
poller
,
dynamic_pointer_cast
<
RtspMediaSource
>
(
src
)),
releasePusher
);
}
}
if
(
strcasecmp
(
"rtsp"
,
prefix
.
data
())
==
0
)
{
if
(
strcasecmp
(
"rtsp"
,
prefix
.
data
())
==
0
)
{
return
PusherBase
::
Ptr
(
new
RtspPusher
(
poller
,
dynamic_pointer_cast
<
RtspMediaSource
>
(
src
)),
releasePusher
);
return
PusherBase
::
Ptr
(
new
RtspPusher
Imp
(
poller
,
dynamic_pointer_cast
<
RtspMediaSource
>
(
src
)),
releasePusher
);
}
}
if
(
strcasecmp
(
"rtmps"
,
prefix
.
data
())
==
0
)
{
if
(
strcasecmp
(
"rtmps"
,
prefix
.
data
())
==
0
)
{
return
PusherBase
::
Ptr
(
new
TcpClientWithSSL
<
RtmpPusher
>
(
poller
,
dynamic_pointer_cast
<
RtmpMediaSource
>
(
src
)),
releasePusher
);
return
PusherBase
::
Ptr
(
new
TcpClientWithSSL
<
RtmpPusher
Imp
>
(
poller
,
dynamic_pointer_cast
<
RtmpMediaSource
>
(
src
)),
releasePusher
);
}
}
if
(
strcasecmp
(
"rtmp"
,
prefix
.
data
())
==
0
)
{
if
(
strcasecmp
(
"rtmp"
,
prefix
.
data
())
==
0
)
{
return
PusherBase
::
Ptr
(
new
RtmpPusher
(
poller
,
dynamic_pointer_cast
<
RtmpMediaSource
>
(
src
)),
releasePusher
);
return
PusherBase
::
Ptr
(
new
RtmpPusher
Imp
(
poller
,
dynamic_pointer_cast
<
RtmpMediaSource
>
(
src
)),
releasePusher
);
}
}
return
PusherBase
::
Ptr
(
new
RtspPusher
(
poller
,
dynamic_pointer_cast
<
RtspMediaSource
>
(
src
)),
releasePusher
);
return
PusherBase
::
Ptr
(
new
RtspPusher
Imp
(
poller
,
dynamic_pointer_cast
<
RtspMediaSource
>
(
src
)),
releasePusher
);
}
}
PusherBase
::
PusherBase
()
{
PusherBase
::
PusherBase
()
{
...
...
src/Pusher/PusherBase.h
查看文件 @
dad0c5e3
...
@@ -38,12 +38,12 @@ public:
...
@@ -38,12 +38,12 @@ public:
* 开始推流
* 开始推流
* @param strUrl 视频url,支持rtsp/rtmp
* @param strUrl 视频url,支持rtsp/rtmp
*/
*/
virtual
void
publish
(
const
string
&
strUrl
)
=
0
;
virtual
void
publish
(
const
string
&
strUrl
)
{}
;
/**
/**
* 中断推流
* 中断推流
*/
*/
virtual
void
teardown
()
=
0
;
virtual
void
teardown
()
{}
;
/**
/**
* 摄像推流结果回调
* 摄像推流结果回调
...
@@ -54,6 +54,10 @@ public:
...
@@ -54,6 +54,10 @@ public:
* 设置断开回调
* 设置断开回调
*/
*/
virtual
void
setOnShutdown
(
const
Event
&
cb
)
=
0
;
virtual
void
setOnShutdown
(
const
Event
&
cb
)
=
0
;
protected
:
virtual
void
onShutdown
(
const
SockException
&
ex
)
=
0
;
virtual
void
onPublishResult
(
const
SockException
&
ex
)
=
0
;
};
};
template
<
typename
Parent
,
typename
Delegate
>
template
<
typename
Parent
,
typename
Delegate
>
...
@@ -67,21 +71,21 @@ public:
...
@@ -67,21 +71,21 @@ public:
/**
/**
* 开始推流
* 开始推流
* @param
strU
rl 推流url,支持rtsp/rtmp
* @param
u
rl 推流url,支持rtsp/rtmp
*/
*/
void
publish
(
const
string
&
strUrl
)
override
{
void
publish
(
const
string
&
url
)
override
{
if
(
_delegate
)
{
return
_delegate
?
_delegate
->
publish
(
url
)
:
Parent
::
publish
(
url
);
_delegate
->
publish
(
strUrl
);
}
}
}
/**
/**
* 中断推流
* 中断推流
*/
*/
void
teardown
()
override
{
void
teardown
()
override
{
if
(
_delegate
)
{
return
_delegate
?
_delegate
->
teardown
()
:
Parent
::
teardown
();
_delegate
->
teardown
();
}
}
std
::
shared_ptr
<
SockInfo
>
getSockInfo
()
const
{
return
dynamic_pointer_cast
<
SockInfo
>
(
_delegate
);
}
}
/**
/**
...
@@ -104,8 +108,19 @@ public:
...
@@ -104,8 +108,19 @@ public:
_on_shutdown
=
cb
;
_on_shutdown
=
cb
;
}
}
std
::
shared_ptr
<
SockInfo
>
getSockInfo
()
const
{
protected
:
return
dynamic_pointer_cast
<
SockInfo
>
(
_delegate
);
void
onShutdown
(
const
SockException
&
ex
)
override
{
if
(
_on_shutdown
)
{
_on_shutdown
(
ex
);
_on_shutdown
=
nullptr
;
}
}
void
onPublishResult
(
const
SockException
&
ex
)
override
{
if
(
_on_publish
)
{
_on_publish
(
ex
);
_on_publish
=
nullptr
;
}
}
}
protected
:
protected
:
...
...
src/Rtmp/RtmpPusher.cpp
查看文件 @
dad0c5e3
...
@@ -46,7 +46,7 @@ void RtmpPusher::teardown() {
...
@@ -46,7 +46,7 @@ void RtmpPusher::teardown() {
}
}
}
}
void
RtmpPusher
::
onPublishResult
(
const
SockException
&
ex
,
bool
handshake_done
)
{
void
RtmpPusher
::
onPublishResult
_l
(
const
SockException
&
ex
,
bool
handshake_done
)
{
DebugL
<<
ex
.
what
();
DebugL
<<
ex
.
what
();
if
(
ex
.
getErrCode
()
==
Err_shutdown
)
{
if
(
ex
.
getErrCode
()
==
Err_shutdown
)
{
//主动shutdown的,不触发回调
//主动shutdown的,不触发回调
...
@@ -55,14 +55,10 @@ void RtmpPusher::onPublishResult(const SockException &ex, bool handshake_done) {
...
@@ -55,14 +55,10 @@ void RtmpPusher::onPublishResult(const SockException &ex, bool handshake_done) {
if
(
!
handshake_done
)
{
if
(
!
handshake_done
)
{
//播放结果回调
//播放结果回调
_publish_timer
.
reset
();
_publish_timer
.
reset
();
if
(
_on_published
)
{
onPublishResult
(
ex
);
_on_published
(
ex
);
}
}
else
{
}
else
{
//播放成功后异常断开回调
//播放成功后异常断开回调
if
(
_on_shutdown
)
{
onShutdown
(
ex
);
_on_shutdown
(
ex
);
}
}
}
if
(
ex
)
{
if
(
ex
)
{
...
@@ -78,7 +74,7 @@ void RtmpPusher::publish(const string &url) {
...
@@ -78,7 +74,7 @@ void RtmpPusher::publish(const string &url) {
_tc_url
=
string
(
"rtmp://"
)
+
host_url
+
"/"
+
_app
;
_tc_url
=
string
(
"rtmp://"
)
+
host_url
+
"/"
+
_app
;
if
(
!
_app
.
size
()
||
!
_stream_id
.
size
())
{
if
(
!
_app
.
size
()
||
!
_stream_id
.
size
())
{
onPublishResult
(
SockException
(
Err_other
,
"rtmp url非法"
),
false
);
onPublishResult
_l
(
SockException
(
Err_other
,
"rtmp url非法"
),
false
);
return
;
return
;
}
}
DebugL
<<
host_url
<<
" "
<<
_app
<<
" "
<<
_stream_id
;
DebugL
<<
host_url
<<
" "
<<
_app
<<
" "
<<
_stream_id
;
...
@@ -99,7 +95,7 @@ void RtmpPusher::publish(const string &url) {
...
@@ -99,7 +95,7 @@ void RtmpPusher::publish(const string &url) {
if
(
!
strongSelf
)
{
if
(
!
strongSelf
)
{
return
false
;
return
false
;
}
}
strongSelf
->
onPublishResult
(
SockException
(
Err_timeout
,
"publish rtmp timeout"
),
false
);
strongSelf
->
onPublishResult
_l
(
SockException
(
Err_timeout
,
"publish rtmp timeout"
),
false
);
return
false
;
return
false
;
},
getPoller
()));
},
getPoller
()));
...
@@ -112,12 +108,12 @@ void RtmpPusher::publish(const string &url) {
...
@@ -112,12 +108,12 @@ void RtmpPusher::publish(const string &url) {
void
RtmpPusher
::
onErr
(
const
SockException
&
ex
){
void
RtmpPusher
::
onErr
(
const
SockException
&
ex
){
//定时器_pPublishTimer为空后表明握手结束了
//定时器_pPublishTimer为空后表明握手结束了
onPublishResult
(
ex
,
!
_publish_timer
);
onPublishResult
_l
(
ex
,
!
_publish_timer
);
}
}
void
RtmpPusher
::
onConnect
(
const
SockException
&
err
){
void
RtmpPusher
::
onConnect
(
const
SockException
&
err
){
if
(
err
)
{
if
(
err
)
{
onPublishResult
(
err
,
false
);
onPublishResult
_l
(
err
,
false
);
return
;
return
;
}
}
weak_ptr
<
RtmpPusher
>
weak_self
=
dynamic_pointer_cast
<
RtmpPusher
>
(
shared_from_this
());
weak_ptr
<
RtmpPusher
>
weak_self
=
dynamic_pointer_cast
<
RtmpPusher
>
(
shared_from_this
());
...
@@ -138,7 +134,7 @@ void RtmpPusher::onRecv(const Buffer::Ptr &buf){
...
@@ -138,7 +134,7 @@ void RtmpPusher::onRecv(const Buffer::Ptr &buf){
}
catch
(
exception
&
e
)
{
}
catch
(
exception
&
e
)
{
SockException
ex
(
Err_other
,
e
.
what
());
SockException
ex
(
Err_other
,
e
.
what
());
//定时器_pPublishTimer为空后表明握手结束了
//定时器_pPublishTimer为空后表明握手结束了
onPublishResult
(
ex
,
!
_publish_timer
);
onPublishResult
_l
(
ex
,
!
_publish_timer
);
}
}
}
}
...
@@ -226,10 +222,10 @@ inline void RtmpPusher::send_metaData(){
...
@@ -226,10 +222,10 @@ inline void RtmpPusher::send_metaData(){
_rtmp_reader
->
setDetachCB
([
weak_self
]()
{
_rtmp_reader
->
setDetachCB
([
weak_self
]()
{
auto
strong_self
=
weak_self
.
lock
();
auto
strong_self
=
weak_self
.
lock
();
if
(
strong_self
)
{
if
(
strong_self
)
{
strong_self
->
onPublishResult
(
SockException
(
Err_other
,
"媒体源被释放"
),
!
strong_self
->
_publish_timer
);
strong_self
->
onPublishResult
_l
(
SockException
(
Err_other
,
"媒体源被释放"
),
!
strong_self
->
_publish_timer
);
}
}
});
});
onPublishResult
(
SockException
(
Err_success
,
"success"
),
false
);
onPublishResult
_l
(
SockException
(
Err_success
,
"success"
),
false
);
//提升发送性能
//提升发送性能
setSocketFlags
();
setSocketFlags
();
}
}
...
...
src/Rtmp/RtmpPusher.h
查看文件 @
dad0c5e3
...
@@ -27,14 +27,6 @@ public:
...
@@ -27,14 +27,6 @@ public:
void
publish
(
const
string
&
url
)
override
;
void
publish
(
const
string
&
url
)
override
;
void
teardown
()
override
;
void
teardown
()
override
;
void
setOnPublished
(
const
Event
&
cb
)
override
{
_on_published
=
cb
;
}
void
setOnShutdown
(
const
Event
&
cb
)
override
{
_on_shutdown
=
cb
;
}
protected
:
protected
:
//for Tcpclient override
//for Tcpclient override
void
onRecv
(
const
Buffer
::
Ptr
&
buf
)
override
;
void
onRecv
(
const
Buffer
::
Ptr
&
buf
)
override
;
...
@@ -48,7 +40,7 @@ protected:
...
@@ -48,7 +40,7 @@ protected:
}
}
private
:
private
:
void
onPublishResult
(
const
SockException
&
ex
,
bool
handshake_done
);
void
onPublishResult
_l
(
const
SockException
&
ex
,
bool
handshake_done
);
template
<
typename
FUN
>
template
<
typename
FUN
>
inline
void
addOnResultCB
(
const
FUN
&
fun
)
{
inline
void
addOnResultCB
(
const
FUN
&
fun
)
{
...
@@ -81,16 +73,14 @@ private:
...
@@ -81,16 +73,14 @@ private:
deque
<
function
<
void
(
AMFValue
&
dec
)
>
>
_deque_on_status
;
deque
<
function
<
void
(
AMFValue
&
dec
)
>
>
_deque_on_status
;
unordered_map
<
int
,
function
<
void
(
AMFDecoder
&
dec
)
>
>
_map_on_result
;
unordered_map
<
int
,
function
<
void
(
AMFDecoder
&
dec
)
>
>
_map_on_result
;
//事件监听
Event
_on_shutdown
;
Event
_on_published
;
//推流超时定时器
//推流超时定时器
std
::
shared_ptr
<
Timer
>
_publish_timer
;
std
::
shared_ptr
<
Timer
>
_publish_timer
;
std
::
weak_ptr
<
RtmpMediaSource
>
_publish_src
;
std
::
weak_ptr
<
RtmpMediaSource
>
_publish_src
;
RtmpMediaSource
::
RingType
::
RingReader
::
Ptr
_rtmp_reader
;
RtmpMediaSource
::
RingType
::
RingReader
::
Ptr
_rtmp_reader
;
};
};
using
RtmpPusherImp
=
PusherImp
<
RtmpPusher
,
PusherBase
>
;
}
/* namespace mediakit */
}
/* namespace mediakit */
#endif
/* SRC_RTMP_RTMPPUSHER_H_ */
#endif
/* SRC_RTMP_RTMPPUSHER_H_ */
src/Rtsp/RtspPusher.cpp
查看文件 @
dad0c5e3
...
@@ -57,7 +57,7 @@ void RtspPusher::teardown() {
...
@@ -57,7 +57,7 @@ void RtspPusher::teardown() {
void
RtspPusher
::
publish
(
const
string
&
url_str
)
{
void
RtspPusher
::
publish
(
const
string
&
url_str
)
{
RtspUrl
url
;
RtspUrl
url
;
if
(
!
url
.
parse
(
url_str
))
{
if
(
!
url
.
parse
(
url_str
))
{
onPublishResult
(
SockException
(
Err_other
,
StrPrinter
<<
"illegal rtsp url:"
<<
url_str
),
false
);
onPublishResult
_l
(
SockException
(
Err_other
,
StrPrinter
<<
"illegal rtsp url:"
<<
url_str
),
false
);
return
;
return
;
}
}
...
@@ -83,7 +83,7 @@ void RtspPusher::publish(const string &url_str) {
...
@@ -83,7 +83,7 @@ void RtspPusher::publish(const string &url_str) {
if
(
!
strong_self
)
{
if
(
!
strong_self
)
{
return
false
;
return
false
;
}
}
strong_self
->
onPublishResult
(
SockException
(
Err_timeout
,
"publish rtsp timeout"
),
false
);
strong_self
->
onPublishResult
_l
(
SockException
(
Err_timeout
,
"publish rtsp timeout"
),
false
);
return
false
;
return
false
;
},
getPoller
()));
},
getPoller
()));
...
@@ -94,7 +94,7 @@ void RtspPusher::publish(const string &url_str) {
...
@@ -94,7 +94,7 @@ void RtspPusher::publish(const string &url_str) {
startConnect
(
url
.
_host
,
url
.
_port
,
publish_timeout_sec
);
startConnect
(
url
.
_host
,
url
.
_port
,
publish_timeout_sec
);
}
}
void
RtspPusher
::
onPublishResult
(
const
SockException
&
ex
,
bool
handshake_done
)
{
void
RtspPusher
::
onPublishResult
_l
(
const
SockException
&
ex
,
bool
handshake_done
)
{
DebugL
<<
ex
.
what
();
DebugL
<<
ex
.
what
();
if
(
ex
.
getErrCode
()
==
Err_shutdown
)
{
if
(
ex
.
getErrCode
()
==
Err_shutdown
)
{
//主动shutdown的,不触发回调
//主动shutdown的,不触发回调
...
@@ -103,14 +103,10 @@ void RtspPusher::onPublishResult(const SockException &ex, bool handshake_done) {
...
@@ -103,14 +103,10 @@ void RtspPusher::onPublishResult(const SockException &ex, bool handshake_done) {
if
(
!
handshake_done
)
{
if
(
!
handshake_done
)
{
//播放结果回调
//播放结果回调
_publish_timer
.
reset
();
_publish_timer
.
reset
();
if
(
_on_published
)
{
onPublishResult
(
ex
);
_on_published
(
ex
);
}
}
else
{
}
else
{
//播放成功后异常断开回调
//播放成功后异常断开回调
if
(
_on_shutdown
)
{
onShutdown
(
ex
);
_on_shutdown
(
ex
);
}
}
}
if
(
ex
)
{
if
(
ex
)
{
...
@@ -120,12 +116,12 @@ void RtspPusher::onPublishResult(const SockException &ex, bool handshake_done) {
...
@@ -120,12 +116,12 @@ void RtspPusher::onPublishResult(const SockException &ex, bool handshake_done) {
void
RtspPusher
::
onErr
(
const
SockException
&
ex
)
{
void
RtspPusher
::
onErr
(
const
SockException
&
ex
)
{
//定时器_pPublishTimer为空后表明握手结束了
//定时器_pPublishTimer为空后表明握手结束了
onPublishResult
(
ex
,
!
_publish_timer
);
onPublishResult
_l
(
ex
,
!
_publish_timer
);
}
}
void
RtspPusher
::
onConnect
(
const
SockException
&
err
)
{
void
RtspPusher
::
onConnect
(
const
SockException
&
err
)
{
if
(
err
)
{
if
(
err
)
{
onPublishResult
(
err
,
false
);
onPublishResult
_l
(
err
,
false
);
return
;
return
;
}
}
sendAnnounce
();
sendAnnounce
();
...
@@ -137,7 +133,7 @@ void RtspPusher::onRecv(const Buffer::Ptr &buf){
...
@@ -137,7 +133,7 @@ void RtspPusher::onRecv(const Buffer::Ptr &buf){
}
catch
(
exception
&
e
)
{
}
catch
(
exception
&
e
)
{
SockException
ex
(
Err_other
,
e
.
what
());
SockException
ex
(
Err_other
,
e
.
what
());
//定时器_pPublishTimer为空后表明握手结束了
//定时器_pPublishTimer为空后表明握手结束了
onPublishResult
(
ex
,
!
_publish_timer
);
onPublishResult
_l
(
ex
,
!
_publish_timer
);
}
}
}
}
...
@@ -465,7 +461,7 @@ void RtspPusher::sendRecord() {
...
@@ -465,7 +461,7 @@ void RtspPusher::sendRecord() {
_rtsp_reader
->
setDetachCB
([
weak_self
]()
{
_rtsp_reader
->
setDetachCB
([
weak_self
]()
{
auto
strong_self
=
weak_self
.
lock
();
auto
strong_self
=
weak_self
.
lock
();
if
(
strong_self
)
{
if
(
strong_self
)
{
strong_self
->
onPublishResult
(
SockException
(
Err_other
,
"媒体源被释放"
),
!
strong_self
->
_publish_timer
);
strong_self
->
onPublishResult
_l
(
SockException
(
Err_other
,
"媒体源被释放"
),
!
strong_self
->
_publish_timer
);
}
}
});
});
if
(
_rtp_type
!=
Rtsp
::
RTP_TCP
)
{
if
(
_rtp_type
!=
Rtsp
::
RTP_TCP
)
{
...
@@ -479,7 +475,7 @@ void RtspPusher::sendRecord() {
...
@@ -479,7 +475,7 @@ void RtspPusher::sendRecord() {
return
true
;
return
true
;
},
getPoller
()));
},
getPoller
()));
}
}
onPublishResult
(
SockException
(
Err_success
,
"success"
),
false
);
onPublishResult
_l
(
SockException
(
Err_success
,
"success"
),
false
);
//提升发送性能
//提升发送性能
setSocketFlags
();
setSocketFlags
();
};
};
...
...
src/Rtsp/RtspPusher.h
查看文件 @
dad0c5e3
...
@@ -36,14 +36,6 @@ public:
...
@@ -36,14 +36,6 @@ public:
void
publish
(
const
string
&
url
)
override
;
void
publish
(
const
string
&
url
)
override
;
void
teardown
()
override
;
void
teardown
()
override
;
void
setOnPublished
(
const
Event
&
cb
)
override
{
_on_published
=
cb
;
}
void
setOnShutdown
(
const
Event
&
cb
)
override
{
_on_shutdown
=
cb
;
}
protected
:
protected
:
//for Tcpclient override
//for Tcpclient override
void
onRecv
(
const
Buffer
::
Ptr
&
buf
)
override
;
void
onRecv
(
const
Buffer
::
Ptr
&
buf
)
override
;
...
@@ -57,7 +49,7 @@ protected:
...
@@ -57,7 +49,7 @@ protected:
virtual
void
onRtcpPacket
(
int
track_idx
,
SdpTrack
::
Ptr
&
track
,
uint8_t
*
data
,
size_t
len
);
virtual
void
onRtcpPacket
(
int
track_idx
,
SdpTrack
::
Ptr
&
track
,
uint8_t
*
data
,
size_t
len
);
private
:
private
:
void
onPublishResult
(
const
SockException
&
ex
,
bool
handshake_done
);
void
onPublishResult
_l
(
const
SockException
&
ex
,
bool
handshake_done
);
void
sendAnnounce
();
void
sendAnnounce
();
void
sendSetup
(
unsigned
int
track_idx
);
void
sendSetup
(
unsigned
int
track_idx
);
...
@@ -102,9 +94,6 @@ private:
...
@@ -102,9 +94,6 @@ private:
std
::
shared_ptr
<
Timer
>
_beat_timer
;
std
::
shared_ptr
<
Timer
>
_beat_timer
;
std
::
weak_ptr
<
RtspMediaSource
>
_push_src
;
std
::
weak_ptr
<
RtspMediaSource
>
_push_src
;
RtspMediaSource
::
RingType
::
RingReader
::
Ptr
_rtsp_reader
;
RtspMediaSource
::
RingType
::
RingReader
::
Ptr
_rtsp_reader
;
//事件监听
Event
_on_shutdown
;
Event
_on_published
;
function
<
void
(
const
Parser
&
)
>
_on_res_func
;
function
<
void
(
const
Parser
&
)
>
_on_res_func
;
////////// rtcp ////////////////
////////// rtcp ////////////////
//rtcp发送时间,trackid idx 为数组下标
//rtcp发送时间,trackid idx 为数组下标
...
@@ -113,5 +102,7 @@ private:
...
@@ -113,5 +102,7 @@ private:
vector
<
RtcpContext
::
Ptr
>
_rtcp_context
;
vector
<
RtcpContext
::
Ptr
>
_rtcp_context
;
};
};
using
RtspPusherImp
=
PusherImp
<
RtspPusher
,
PusherBase
>
;
}
/* namespace mediakit */
}
/* namespace mediakit */
#endif //ZLMEDIAKIT_RTSPPUSHER_H
#endif //ZLMEDIAKIT_RTSPPUSHER_H
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论