mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-24 01:42:22 +08:00
支持客户端自定义设置EventPoller对象,提高线程安全性
This commit is contained in:
@@ -36,7 +36,7 @@ using namespace mediakit::Client;
|
||||
namespace mediakit {
|
||||
|
||||
unordered_map<string, RtmpPlayer::rtmpCMDHandle> RtmpPlayer::g_mapCmd;
|
||||
RtmpPlayer::RtmpPlayer() {
|
||||
RtmpPlayer::RtmpPlayer(const EventPoller::Ptr &poller) : TcpClient(poller) {
|
||||
static onceToken token([]() {
|
||||
g_mapCmd.emplace("_error",&RtmpPlayer::onCmd_result);
|
||||
g_mapCmd.emplace("_result",&RtmpPlayer::onCmd_result);
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace mediakit {
|
||||
class RtmpPlayer:public PlayerBase, public TcpClient, public RtmpProtocol{
|
||||
public:
|
||||
typedef std::shared_ptr<RtmpPlayer> Ptr;
|
||||
RtmpPlayer();
|
||||
RtmpPlayer(const EventPoller::Ptr &poller);
|
||||
virtual ~RtmpPlayer();
|
||||
|
||||
void play(const string &strUrl) override;
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace mediakit {
|
||||
class RtmpPlayerImp: public PlayerImp<RtmpPlayer,RtmpDemuxer> {
|
||||
public:
|
||||
typedef std::shared_ptr<RtmpPlayerImp> Ptr;
|
||||
RtmpPlayerImp(){};
|
||||
RtmpPlayerImp(const EventPoller::Ptr &poller) : PlayerImp<RtmpPlayer,RtmpDemuxer>(poller){};
|
||||
virtual ~RtmpPlayerImp(){
|
||||
DebugL<<endl;
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace mediakit {
|
||||
|
||||
static int kSockFlags = SOCKET_DEFAULE_FLAGS | FLAG_MORE;
|
||||
|
||||
RtmpPusher::RtmpPusher(const RtmpMediaSource::Ptr &src){
|
||||
RtmpPusher::RtmpPusher(const EventPoller::Ptr &poller,const RtmpMediaSource::Ptr &src) : TcpClient(poller){
|
||||
_pMediaSrc=src;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace mediakit {
|
||||
class RtmpPusher: public RtmpProtocol , public TcpClient , public PusherBase{
|
||||
public:
|
||||
typedef std::shared_ptr<RtmpPusher> Ptr;
|
||||
RtmpPusher(const RtmpMediaSource::Ptr &src);
|
||||
RtmpPusher(const EventPoller::Ptr &poller,const RtmpMediaSource::Ptr &src);
|
||||
virtual ~RtmpPusher();
|
||||
|
||||
void publish(const string &strUrl) override ;
|
||||
|
||||
Reference in New Issue
Block a user