hc
2023-02-13 e440ec23c5a540cdd3f7464e8779219be6fd3d95
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
// Copyright 2019 Fuzhou Rockchip Electronics Co., Ltd. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
 
#ifndef SHM_CONTROL_NN_H_
#define SHM_CONTROL_NN_H_
 
#include <mutex>
#include <shmc/shm_queue.h>
#include <stdint.h>
 
namespace {
constexpr const char *kShmNNKey       = "0x10007";
constexpr size_t      kNNQueueBufSize = 1024 * 1024 * 1;
} // namespace
 
using namespace shmc;
 
namespace rockchip {
namespace aiserver {
 
class ShmNNController {
  public:
    ShmNNController();
   ~ShmNNController();
 
    void initialize();
    void send(std::string &buf);
 
  private:
    std::mutex            opMutex;
    ShmQueue<shmc::SVIPC> shmNNQueue;
    int32_t               shmWriteInited;
};
 
} // namespace aiserver
} // namespace rockchip
 
 
#endif // SHM_CONTROL_NN_H_