支持客户端自定义设置EventPoller对象,提高线程安全性

This commit is contained in:
xiongziliang
2019-04-01 10:16:15 +08:00
parent 6e2002e451
commit 9247cb9571
20 changed files with 70 additions and 57 deletions

View File

@@ -43,7 +43,7 @@ using namespace mediakit::Client;
namespace mediakit {
RtspPlayer::RtspPlayer(void){
RtspPlayer::RtspPlayer(const EventPoller::Ptr &poller) : TcpClient(poller){
RtpReceiver::setPoolSize(64);
}
RtspPlayer::~RtspPlayer(void) {

View File

@@ -52,7 +52,7 @@ class RtspPlayer: public PlayerBase,public TcpClient, public RtspSplitter, publi
public:
typedef std::shared_ptr<RtspPlayer> Ptr;
RtspPlayer();
RtspPlayer(const EventPoller::Ptr &poller) ;
virtual ~RtspPlayer(void);
void play(const string &strUrl) override;
void pause(bool bPause) override;

View File

@@ -44,7 +44,7 @@ namespace mediakit {
class RtspPlayerImp: public PlayerImp<RtspPlayer,RtspDemuxer> {
public:
typedef std::shared_ptr<RtspPlayerImp> Ptr;
RtspPlayerImp(){};
RtspPlayerImp(const EventPoller::Ptr &poller) : PlayerImp<RtspPlayer,RtspDemuxer>(poller){}
virtual ~RtspPlayerImp(){
DebugL<<endl;
};

View File

@@ -13,7 +13,7 @@ namespace mediakit {
static int kSockFlags = SOCKET_DEFAULE_FLAGS | FLAG_MORE;
RtspPusher::RtspPusher(const RtspMediaSource::Ptr &src) {
RtspPusher::RtspPusher(const EventPoller::Ptr &poller,const RtspMediaSource::Ptr &src) : TcpClient(poller){
_pMediaSrc = src;
}

View File

@@ -25,7 +25,7 @@ namespace mediakit {
class RtspPusher : public TcpClient, public RtspSplitter, public PusherBase {
public:
typedef std::shared_ptr<RtspPusher> Ptr;
RtspPusher(const RtspMediaSource::Ptr &src);
RtspPusher(const EventPoller::Ptr &poller,const RtspMediaSource::Ptr &src);
virtual ~RtspPusher();
void publish(const string &strUrl) override;