Agora  1.2.0
Agora project
recorder.h
Go to the documentation of this file.
1 
5 #ifndef AGORA_RECORDER_H_
6 #define AGORA_RECORDER_H_
7 
8 #include <memory>
9 
10 #include "concurrentqueue.h"
11 #include "config.h"
12 #include "recorder_thread.h"
13 
14 namespace Agora_recorder {
15 class Recorder {
16  public:
17  explicit Recorder(const Config* in_cfg, size_t core_start = 0u);
18  ~Recorder();
19 
20  void DoIt();
22  return message_queue_;
23  }
24 
25  //const std::string& GetTraceFileName() { return this->cfg_->TraceFile(); }
26 
27  private:
28  void Gc();
29 
30  // buffer length of each rx thread
31  static const int kSampleBufferFrameNum;
32  // dequeue bulk size, used to reduce the overhead of dequeue in main thread
33  static const int kDequeueBulkSize;
34 
35  const Config* cfg_;
37 
38  std::vector<std::unique_ptr<RecorderThread>> recorders_;
40 
41  /* Core assignment start variables */
42  const size_t main_dispatch_core_;
43  const size_t recorder_core_;
44 
46 }; /* class Recorder */
47 }; // namespace Agora_recorder
48 #endif /* AGORA_RECORDER_H_ */
Config::Running
void Running(bool value)
Definition: config.h:33
Config::UeAntNum
size_t UeAntNum() const
Definition: config.h:41
recorder.h
Record received frames from massive-mimo base station in HDF5 format.
Agora_recorder::Recorder::recorder_core_
const size_t recorder_core_
Definition: recorder.h:43
Agora_recorder::kQueueSize
static const int kQueueSize
Definition: recorder.cc:15
moodycamel::ConcurrentQueue::try_dequeue_bulk
size_t try_dequeue_bulk(It itemFirst, size_t max)
Definition: concurrentqueue.h:1210
Agora_recorder::Recorder::num_writter_threads_
size_t num_writter_threads_
Definition: recorder.h:45
Agora_recorder::Recorder
Definition: recorder.h:15
Agora_recorder::Recorder::rx_thread_buff_size_
size_t rx_thread_buff_size_
Definition: recorder.h:36
Agora_recorder::Recorder::~Recorder
~Recorder()
Definition: recorder.cc:36
Agora_recorder::Recorder::main_dispatch_core_
const size_t main_dispatch_core_
Definition: recorder.h:42
Agora_recorder::Recorder::kSampleBufferFrameNum
static const int kSampleBufferFrameNum
Definition: recorder.h:31
AGORA_LOG_ERROR
#define AGORA_LOG_ERROR(...)
Definition: logger.h:39
Agora_recorder
Definition: hdf5_lib.cc:17
Config::Frame
const FrameStats & Frame() const
Definition: config.h:340
Agora_recorder::Recorder::Recorder
Recorder(const Config *in_cfg, size_t core_start=0u)
Definition: recorder.cc:17
AGORA_LOG_TRACE
#define AGORA_LOG_TRACE(...)
Definition: logger.h:92
rx_tag_t
Definition: message.h:227
RxPacket::Use
void Use()
Definition: message.h:215
Agora_recorder::Recorder::DoIt
void DoIt()
Definition: recorder.cc:43
Agora_recorder::Recorder::kDequeueBulkSize
static const int kDequeueBulkSize
Definition: recorder.h:33
EventData
Definition: message.h:142
message.h
Self defined functions for message storage and passing.
Agora_recorder::Recorder::GetRecorderQueue
moodycamel::ConcurrentQueue< EventData > & GetRecorderQueue()
Definition: recorder.h:21
i
for i
Definition: generate_data.m:107
Agora_recorder::Recorder::cfg_
const Config * cfg_
Definition: recorder.h:35
u
Plot Rx waveform for u
Definition: inspect_single_frame.m:108
EventType::kPacketRX
@ kPacketRX
Agora_recorder::Recorder::Gc
void Gc()
Definition: recorder.cc:38
RxPacket::RawPacket
Packet * RawPacket()
Definition: message.h:213
moodycamel::ConcurrentQueue< EventData >
Config
Definition: config.h:26
AGORA_LOG_INFO
#define AGORA_LOG_INFO(...)
Definition: logger.h:62
recorder_thread.h
RxPacket
Definition: message.h:186
config.h
Declaration file for the configuration class which importants json configuration values into class va...
moodycamel::ConsumerToken
Definition: concurrentqueue.h:695
Agora_recorder::Recorder::recorders_
std::vector< std::unique_ptr< RecorderThread > > recorders_
Definition: recorder.h:38
Agora_recorder::Recorder::message_queue_
moodycamel::ConcurrentQueue< EventData > message_queue_
Definition: recorder.h:39
RxPacket::Free
void Free()
Definition: message.h:216
concurrentqueue.h
FrameStats::NumTotalSyms
size_t NumTotalSyms() const
Definition: framestats.cc:93
rx_tag_t::rx_packet_
RxPacket * rx_packet_
Definition: message.h:228