hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
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
#ifndef _RKAIQ_PROTOCOL_H__
#define _RKAIQ_PROTOCOL_H__
 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
#include <mutex>
 
#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<std::thread> offlineRawThread;
 
  private:
    static std::mutex mutex_;
    static bool is_recv_running;
    static std::unique_ptr<std::thread> forward_thread;
};
 
#endif