

#ifndef _APPSETTING_H_
#define _APPSETTING_H_

#include <string>
// 子进程
struct ChildProcessState
{
    const char* name;
    int rtpPort;
    int rtpPortyb;
    int websocketPort;
    int infoPort;
    int appPort;
    int rtmpPort;
    int status;

    int rtpPortSend;
    int rtpPortSendyb;
};

class AppSetting
{
    private:
        static AppSetting* _instance;

        AppSetting(){};
    public:
        ~AppSetting(){}
        static AppSetting* Instance();
        bool Load(const std::string& file);

    public:
        /**
         * 加载的配置
         */
        std::string redisIp;                       // redis
        int redisPort;

        std::string f3Ip;                          // f3
        int f3Port;
        int f3timeout;                              // f3超时
        std::string f3id;                           // f3 id
        std::string kafkaHost;
        
        bool enableKafka;
        bool enableSocket;

        std::string rtpIpSend;                         // 终端

        ChildProcessState childProcessState[3]={0};
        bool holdTalkWeb = false;
        std::string holdTalkWebPath;
        int logLevel = 0;
        int logMaxTime = 0;     // second
        int logMaxSize = 0;     // mb
        int logHoldTime = 0;     // hour
        std::string logDir = "";
        std::string streamDir;
        
        int readbufferMax = 0;     

        int playVersion = 1;

        int EpollThreadCount = 2;
        bool ZeroCopyEnabled = false;

        // 测试文件-APP
        bool TestFileClientWriteEnable = false;
    public:
        /**
         * 全局的配置 非加载
         */ 

        // 下发的端口号
        int rtpPortSend;
        // 下发的端口号粤标
        int rtpPortSendyb;
        // 当前进程的转发类型 0：实时视频；1：对讲；2：回放
        int typeIndex;

    public:
};

#endif