#ifndef _RKAIQ_PROTOCOL_H__ #define _RKAIQ_PROTOCOL_H__ #include #include #include #include #include "logger/log.h" #include "rkaiq_cmdid.h" #include "rkaiq_media.h" #include "rkaiq_online_protocol.h" #include "rkaiq_raw_protocol.h" int StopProcess(const char* process, const char* str); int WaitProcessExit(const char* process, int sec); class RKAiqProtocol { public: RKAiqProtocol() = default; virtual ~RKAiqProtocol() = default; static int DoChangeAppMode(appRunStatus mode); static void HandlerTCPMessage(int sockfd, char* buffer, int size); static void HandlerCheckDevice(int sockfd, char* buffer, int size); static void HandlerReceiveFile(int sockfd, char* buffer, int size); static void HandlerOfflineRawProcess(int sockfd, char* buffer, int size); static int MessageForward(int sockfd, char* buffer, int size); static int doMessageForward(int sockfd); static int offlineRawProcess(); static void KillApp(); static int StartApp(); static int StartRTSP(); static int StopRTSP(); static void Exit(); static std::unique_ptr offlineRawThread; private: static std::mutex mutex_; static bool is_recv_running; static std::unique_ptr forward_thread; }; #endif