规范命名

This commit is contained in:
xiongziliang 2019-12-04 10:59:13 +08:00
parent de77460621
commit d5a81d7105
2 changed files with 15 additions and 15 deletions

View File

@ -52,11 +52,11 @@ MediaPusher::MediaPusher(const string &schema,
MediaPusher::~MediaPusher() { MediaPusher::~MediaPusher() {
} }
void MediaPusher::publish(const string &strUrl) { void MediaPusher::publish(const string &strUrl) {
_parser = PusherBase::createPusher(_poller,_src.lock(),strUrl); _delegate = PusherBase::createPusher(_poller,_src.lock(),strUrl);
_parser->setOnShutdown(_shutdownCB); _delegate->setOnShutdown(_shutdownCB);
_parser->setOnPublished(_publishCB); _delegate->setOnPublished(_publishCB);
_parser->mINI::operator=(*this); _delegate->mINI::operator=(*this);
_parser->publish(strUrl); _delegate->publish(strUrl);
} }
EventPoller::Ptr MediaPusher::getPoller(){ EventPoller::Ptr MediaPusher::getPoller(){

View File

@ -75,7 +75,7 @@ public:
virtual void setOnShutdown(const Event &cb) = 0; virtual void setOnShutdown(const Event &cb) = 0;
}; };
template<typename Parent,typename Parser> template<typename Parent,typename Delegate>
class PusherImp : public Parent { class PusherImp : public Parent {
public: public:
typedef std::shared_ptr<PusherImp> Ptr; typedef std::shared_ptr<PusherImp> Ptr;
@ -90,8 +90,8 @@ public:
* @param strUrl urlrtsp/rtmp * @param strUrl urlrtsp/rtmp
*/ */
void publish(const string &strUrl) override{ void publish(const string &strUrl) override{
if (_parser) { if (_delegate) {
_parser->publish(strUrl); _delegate->publish(strUrl);
} }
} }
@ -99,8 +99,8 @@ public:
* *
*/ */
void teardown() override{ void teardown() override{
if (_parser) { if (_delegate) {
_parser->teardown(); _delegate->teardown();
} }
} }
@ -109,8 +109,8 @@ public:
* @param onPublished * @param onPublished
*/ */
void setOnPublished(const PusherBase::Event &cb) override{ void setOnPublished(const PusherBase::Event &cb) override{
if (_parser) { if (_delegate) {
_parser->setOnPublished(cb); _delegate->setOnPublished(cb);
} }
_publishCB = cb; _publishCB = cb;
} }
@ -120,15 +120,15 @@ public:
* @param onShutdown * @param onShutdown
*/ */
void setOnShutdown(const PusherBase::Event &cb) override{ void setOnShutdown(const PusherBase::Event &cb) override{
if (_parser) { if (_delegate) {
_parser->setOnShutdown(cb); _delegate->setOnShutdown(cb);
} }
_shutdownCB = cb; _shutdownCB = cb;
} }
protected: protected:
PusherBase::Event _shutdownCB; PusherBase::Event _shutdownCB;
PusherBase::Event _publishCB; PusherBase::Event _publishCB;
std::shared_ptr<Parser> _parser; std::shared_ptr<Delegate> _delegate;
}; };