00001 #ifndef __H_STREAMER__ 00002 #define __H_STREAMER__ 00003 00004 #include <string> 00005 #include <map> 00006 00007 #include "video.h" 00008 #include "audio.h" 00009 #include "rtsp.h" 00010 00011 using namespace std; 00012 00013 class Streamer { 00014 public: 00015 Streamer(const map<string, string> &args); 00016 ~Streamer(); 00017 void Main(void); 00018 bool opt_present(string name) { 00019 if(args.find(name) != args.end()) 00020 return true; 00021 return false; 00022 } 00023 static Streamer *instance(void) { 00024 return _streamer; 00025 } 00026 protected: 00027 static Streamer *_streamer; 00028 static int f_handler(void *ptr, RTSP_Server *rtsp_server, RTSP_Server::event event); 00029 int handler(RTSP_Server *rtsp_server, RTSP_Server::event event); 00030 00031 map<string, string> args; 00032 RTSP_Server *rtsp_server; 00033 Session *session; 00034 00035 Audio *audio; 00036 Video *video; 00037 bool running; 00038 }; 00039 00040 #endif // __H_STREAMER__