X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;ds=sidebyside;f=src%2FEngine.cpp;h=1b7cca2d3baeae39b20ca7b6167e611fdfbad80c;hb=70532232dd98f31467eff7baaaff6e68f803bb45;hp=4f671039bd60742e898cebf97c1bec7251280bc5;hpb=b8f65122758fbbecdb5574acfbca01fe8303c179;p=trackerpp.git diff --git a/src/Engine.cpp b/src/Engine.cpp index 4f67103..1b7cca2 100644 --- a/src/Engine.cpp +++ b/src/Engine.cpp @@ -14,14 +14,13 @@ static EngineWPtr g_instance; typedef std::shared_ptr> PersonsInfoPtr; -// class Engine EnginePtr Engine::create() { LOG_DEBUG(TAG, "create"); std::lock_guard lock(g_mutex); if (g_instance.lock()){ LOG_ERROR(TAG, "already exists"); - return EnginePtr(); // nullptr + return EnginePtr(); } EnginePtr instance (new Engine()); g_instance = instance; @@ -47,7 +46,6 @@ void Engine::destroy() observer_list.clear(); } - void Engine::setVideoSrc(VideoSrcType type, const std::string& url) { reader = VideoReaderFactory::createVideoReader(type, url); @@ -79,6 +77,7 @@ void Engine::start() void Engine::addObserver(EngineObserver *observer) { + LOG_DEBUG(TAG, "addObserver"); observer_list.insert(observer); } @@ -118,21 +117,14 @@ private: void Engine::onPersonsOut(const std::vector& p) { + LOG_DEBUG(TAG, "onPersonOut"); PersonsInfoPtr pp = std::make_shared>(p); eventThread.enqueue(new PersonOutEventWorkItem(this->observer_list, pp)); } void Engine::onPersonsIn(const std::vector& p) { + LOG_DEBUG(TAG, "onPersonIn"); PersonsInfoPtr pp = std::make_shared>(p); eventThread.enqueue(new PersonInEventWorkItem(this->observer_list, pp)); } - -void Engine::onStatusChanged() -{ - Person pm, p2; - std::vector ps; - ps.push_back(pm); - ps.push_back(p2); - onPersonsOut(ps); -}