-
Notifications
You must be signed in to change notification settings - Fork 3
/
RtspServer.h
54 lines (40 loc) · 975 Bytes
/
RtspServer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once
#include <gst/gst.h>
#include <gst/rtsp-server/rtsp-server.h>
#include <string>
#include <thread>
class ILogger;
namespace osrv
{
struct ServerConfigs;
namespace rtsp
{
G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE(ReplayBin, replay_bin, REPLAY, BIN, GstBin);
G_DECLARE_FINAL_TYPE(OnvifFactory, onvif_factory, ONVIF, FACTORY, GstRTSPOnvifMediaFactory);
G_END_DECLS
struct AudioInfo
{
const std::string codec;
const unsigned int bitrate;
const unsigned int samplerate;
};
class Server
{
public:
Server(ILogger* /*logger*/, ServerConfigs& /*server_configs*/, const AudioInfo& ainfo);
~Server();
void run();
private:
ILogger* logger_;
GMainLoop* loop_;
GstRTSPServer* server_;
GstRTSPMountPoints* mounts_;
GstRTSPMediaFactory* factoryHighStream_;
GstRTSPMediaFactory* factoryLowStream_;
GstRTSPMediaFactory* replayFactory_;
ServerConfigs* server_configs_ = nullptr;
std::thread* worker_thread_ = nullptr;
};
} // namespace rtsp
} // namespace osrv