2020-12-10 01:19:35 +08:00
|
|
|
#include "zm.h"
|
|
|
|
#if HAVE_RTSP_SERVER
|
|
|
|
|
|
|
|
#ifndef ZM_RTSP_SERVER_THREAD_H
|
|
|
|
#define ZM_RTSP_SERVER_THREAD_H
|
|
|
|
|
|
|
|
#include "zm_thread.h"
|
|
|
|
#include <signal.h>
|
|
|
|
|
|
|
|
#include "zm_monitor.h"
|
|
|
|
|
|
|
|
#include <BasicUsageEnvironment.hh>
|
|
|
|
#include <RTSPServer.hh>
|
|
|
|
|
|
|
|
class RTSPServerThread : public Thread {
|
|
|
|
private:
|
|
|
|
Monitor *monitor;
|
2021-01-07 00:24:52 +08:00
|
|
|
char terminate;
|
2020-12-10 01:19:35 +08:00
|
|
|
|
|
|
|
TaskScheduler* scheduler;
|
|
|
|
UsageEnvironment* env;
|
|
|
|
UserAuthenticationDatabase* authDB;
|
|
|
|
|
|
|
|
RTSPServer* rtspServer;
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit RTSPServerThread(Monitor *);
|
|
|
|
~RTSPServerThread();
|
2021-01-07 00:24:52 +08:00
|
|
|
void addStream();
|
2020-12-10 01:19:35 +08:00
|
|
|
int run();
|
2021-01-07 00:24:52 +08:00
|
|
|
void stop();
|
|
|
|
bool stopped() const;
|
|
|
|
private:
|
|
|
|
std::string getRtpFormat(int format, bool muxTS);
|
|
|
|
int addSession(
|
|
|
|
const std::string & sessionName,
|
|
|
|
const std::list<ServerMediaSubsession*> & subSession
|
|
|
|
);
|
2020-12-10 01:19:35 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|