Add shared ptr
[trackerpp.git] / main.cpp
1 #include<iostream>
2 #include "src/Engine.h"
3 #include <string>
4 #include "src/Logger.h"
5
6 #define TAG "Main"
7
8 using namespace suanzi;
9
10 class Callback : public EngineObserver
11 {
12     void onPersonIn(Person& p){
13         LOG_DEBUG(TAG, "OnPersonIn " << p.toString())
14
15     };
16
17     void onPersonOut(Person& p) {
18         LOG_DEBUG(TAG, "OnPersonIn " << p.toString())
19     };
20 };
21
22
23
24 int main(int argc, char* argv[])
25 {
26     initLogger("log4cpp.properties");
27     LOG_DEBUG(TAG, "==================================");
28
29     EnginePtr e = Engine::create();
30     e->addObserver(new Callback());
31     e->setVideoSrc(VideoSrcType::URL, "rtsp://192.168.1.75:554/stream1");
32     e->start();
33
34     e->destroy();
35     log4cpp::Category::shutdown();
36 }