规范命名

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() {
}
void MediaPusher::publish(const string &strUrl) {
_parser = PusherBase::createPusher(_poller,_src.lock(),strUrl);
_parser->setOnShutdown(_shutdownCB);
_parser->setOnPublished(_publishCB);
_parser->mINI::operator=(*this);
_parser->publish(strUrl);
_delegate = PusherBase::createPusher(_poller,_src.lock(),strUrl);
_delegate->setOnShutdown(_shutdownCB);
_delegate->setOnPublished(_publishCB);
_delegate->mINI::operator=(*this);
_delegate->publish(strUrl);
}
EventPoller::Ptr MediaPusher::getPoller(){

View File

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