zoneminder/src/zm_rtsp_server_thread.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.2 KiB
C
Raw Normal View History

#ifndef ZM_RTSP_SERVER_THREAD_H
#define ZM_RTSP_SERVER_THREAD_H
#include "zm_config.h"
#include "zm_ffmpeg.h"
#include "zm_thread.h"
2021-02-28 01:26:19 +08:00
#include "zm_rtsp_server_server_media_subsession.h"
#include "zm_rtsp_server_fifo_source.h"
#include <list>
#include <memory>
#if HAVE_RTSP_SERVER
#include <BasicUsageEnvironment.hh>
#include <RTSPServer.hh>
class Monitor;
class RTSPServerThread : public Thread {
private:
std::shared_ptr<Monitor> monitor_;
char terminate;
TaskScheduler* scheduler;
UsageEnvironment* env;
UserAuthenticationDatabase* authDB;
RTSPServer* rtspServer;
std::list<FramedSource *> sources;
public:
explicit RTSPServerThread(std::shared_ptr<Monitor> monitor);
~RTSPServerThread();
2021-02-28 01:26:19 +08:00
ServerMediaSession *addSession(std::string &streamname);
void addStream(std::string &streamname, AVStream *, AVStream *);
FramedSource *addFifo(ServerMediaSession *sms, std::string fifo);
int run();
void stop();
bool stopped() const;
private:
const std::string getRtpFormat(AVCodecID codec, bool muxTS);
int addSession(
const std::string & sessionName,
const std::list<ServerMediaSubsession*> & subSession
);
};
#endif // HAVE_RTSP_SERVER
#endif // ZM_RTSP_SERVER_THREAD_H