mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-27 04:20:13 +08:00
规范命名
This commit is contained in:
parent
de77460621
commit
d5a81d7105
@ -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(){
|
||||||
|
@ -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 推流url,支持rtsp/rtmp
|
* @param strUrl 推流url,支持rtsp/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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user