mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-03 17:27:33 +08:00
MediaPusher: 抽象精简代码
This commit is contained in:
@@ -27,14 +27,6 @@ public:
|
||||
void publish(const string &url) override ;
|
||||
void teardown() override;
|
||||
|
||||
void setOnPublished(const Event &cb) override {
|
||||
_on_published = cb;
|
||||
}
|
||||
|
||||
void setOnShutdown(const Event &cb) override{
|
||||
_on_shutdown = cb;
|
||||
}
|
||||
|
||||
protected:
|
||||
//for Tcpclient override
|
||||
void onRecv(const Buffer::Ptr &buf) override;
|
||||
@@ -48,7 +40,7 @@ protected:
|
||||
}
|
||||
|
||||
private:
|
||||
void onPublishResult(const SockException &ex, bool handshake_done);
|
||||
void onPublishResult_l(const SockException &ex, bool handshake_done);
|
||||
|
||||
template<typename FUN>
|
||||
inline void addOnResultCB(const FUN &fun) {
|
||||
@@ -81,16 +73,14 @@ private:
|
||||
deque<function<void(AMFValue &dec)> > _deque_on_status;
|
||||
unordered_map<int, function<void(AMFDecoder &dec)> > _map_on_result;
|
||||
|
||||
//事件监听
|
||||
Event _on_shutdown;
|
||||
Event _on_published;
|
||||
|
||||
//推流超时定时器
|
||||
std::shared_ptr<Timer> _publish_timer;
|
||||
std::weak_ptr<RtmpMediaSource> _publish_src;
|
||||
RtmpMediaSource::RingType::RingReader::Ptr _rtmp_reader;
|
||||
};
|
||||
|
||||
using RtmpPusherImp = PusherImp<RtmpPusher, PusherBase>;
|
||||
|
||||
} /* namespace mediakit */
|
||||
|
||||
#endif /* SRC_RTMP_RTMPPUSHER_H_ */
|
||||
|
||||
Reference in New Issue
Block a user