MediaServerCtx.hpp
1 //
2 // Created by xiong on 2023/8/21.
3 //
4 
5 #ifndef EMX_MediaServerCtx_HPP
6 #define EMX_MediaServerCtx_HPP
7 
8 #include "media/common/MediaRingBuffer.hpp"
9 #include <mutex>
10 
11 namespace Emx {
15  class MediaFactory;
16 
18  public:
19  static MediaServerCtx *GetInst() { return &m_inst; }
20 
21  static bool CheckRangeLegal(const char *name, int param, Json::Value &json);
22 
23  static bool CheckItemLegal(const char *name, int param, Json::Value &json);
24 
25  ErrCodeE SetParam(const char *name, const Json::Value &json);
26 
27  ErrCodeE GetParam(const char *name, Json::Value &json);
28 
29  ErrCodeE GetParamDefault(const char *name, Json::Value &json);
30 
31  ErrCodeE GetRange(const char *name, Json::Value &json);
32 
33  ErrCodeE GetCfg(const char *name, Json::Value &json);
34 
35  ErrCodeE SetScene(const char *scene);
36 
37  const char *GetScene() { return m_scene; }
38 
39  public:
43  char buffer[4 * 1024];
46  // MediaRingBufferWriter ringAi;
47  // std::mutex lockAi;
48  private:
49  MediaServerCtx() {}
50 
51  static MediaServerCtx m_inst;
52  char m_scene[EMX_MAX_PATH_SIZE];
53  };
54 
56 }// namespace Emx
57 
58 #endif//EMX_MediaServerCtx_HPP
实现多路复用循环的主体,所有基于EuvLoop的事件都应绑定到一个EuvLoop上
Definition: EuvLoop.hpp:18
Definition: MediaFactory.hpp:18
媒体环形共享缓冲区写类(注意:所有操作都是非线程安全的)
Definition: MediaRingBuffer.hpp:17
Definition: MediaServerCtx.hpp:17
EuvLoop loop
Definition: MediaServerCtx.hpp:41
static MediaServerCtx * GetInst()
Definition: MediaServerCtx.hpp:19
char buffer[4 *1024]
Definition: MediaServerCtx.hpp:43
ErrCodeE GetCfg(const char *name, Json::Value &json)
MsgTopicPublisherAsync pub
Definition: MediaServerCtx.hpp:42
MediaRingBufferWriter ring
Definition: MediaServerCtx.hpp:44
ErrCodeE GetParam(const char *name, Json::Value &json)
const char * GetScene()
Definition: MediaServerCtx.hpp:37
ErrCodeE SetParam(const char *name, const Json::Value &json)
ErrCodeE GetRange(const char *name, Json::Value &json)
ErrCodeE GetParamDefault(const char *name, Json::Value &json)
static bool CheckItemLegal(const char *name, int param, Json::Value &json)
bool mediaUtcOutput
是否输出媒体utc时间戳
Definition: MediaServerCtx.hpp:45
MediaFactory * factory
Definition: MediaServerCtx.hpp:40
static bool CheckRangeLegal(const char *name, int param, Json::Value &json)
ErrCodeE SetScene(const char *scene)
用于Topic的异步发布
Definition: MsgTopic.hpp:68
ErrCodeE
错误码定义
Definition: EmxTypeDef.hpp:29
Definition: EmxGpio.hpp:10