Agora  1.2.0
Agora project
video_receiver.h
Go to the documentation of this file.
1 
5 #ifndef VIDEO_RECEIVER_H_
6 #define VIDEO_RECEIVER_H_
7 
8 #include <array>
9 
10 #include "mac_data_receiver.h"
11 #include "udp_server.h"
12 
18  public:
19  // Video stream specific variables
20  static constexpr size_t kVideoStreamRxPort = 1350u;
21  // Typical rx size for a UDP data packet coming from VLC udp streamer
22  static constexpr size_t kVideoStreamRxSize = (1316u);
23  static constexpr size_t kVideoStreamSocketRxBufSize =
24  (kVideoStreamRxSize * 1000u);
25  // Oversize the potential receive size
26  static constexpr size_t kVideoStreamMaxRxSize = 2048u;
27  static constexpr size_t kVideoStreamLocalRxBufSize =
29 
30  explicit VideoReceiver(uint16_t port);
31  ~VideoReceiver() override = default;
32 
33  size_t Load(unsigned char *destination, size_t requested_bytes) final;
34 
35  private:
37  std::array<std::byte, VideoReceiver::kVideoStreamLocalRxBufSize>
39 
42 };
43 
44 #endif // VIDEO_RECEIVER_H_
mac_data_receiver.h
Declaration file for the MacDataReceiver interface class.
kRxAddress
static const std::string kRxAddress
Definition: video_receiver.cc:15
VideoReceiver::data_start_offset_
size_t data_start_offset_
Definition: video_receiver.h:41
VideoReceiver::kVideoStreamSocketRxBufSize
static constexpr size_t kVideoStreamSocketRxBufSize
Definition: video_receiver.h:23
VideoReceiver::local_rx_buffer_
std::array< std::byte, VideoReceiver::kVideoStreamLocalRxBufSize > local_rx_buffer_
Definition: video_receiver.h:38
UDPServer
Basic UDP server class based on OS sockets that supports receiving messages.
Definition: udp_server.h:13
udp_server.h
Provides the UDPServer functions from the UDPComm class. Receiver only support.
video_receiver.h
Declaration file for the VideoReceiver class.
VideoReceiver::kVideoStreamRxSize
static constexpr size_t kVideoStreamRxSize
Definition: video_receiver.h:22
VideoReceiver::~VideoReceiver
~VideoReceiver() override=default
VideoReceiver::kVideoStreamLocalRxBufSize
static constexpr size_t kVideoStreamLocalRxBufSize
Definition: video_receiver.h:27
VideoReceiver::udp_video_receiver_
UDPServer udp_video_receiver_
Definition: video_receiver.h:36
u
Plot Rx waveform for u
Definition: inspect_single_frame.m:108
VideoReceiver::kVideoStreamRxPort
static constexpr size_t kVideoStreamRxPort
Definition: video_receiver.h:20
VideoReceiver
The Video Receiver class creates a UDP server to receive a video stream tested with VLC streaming app...
Definition: video_receiver.h:17
MacDataReceiver
The MacDataReceiver interface class.
Definition: mac_data_receiver.h:13
AGORA_LOG_INFO
#define AGORA_LOG_INFO(...)
Definition: logger.h:62
AGORA_LOG_FRAME
#define AGORA_LOG_FRAME(...)
Definition: logger.h:72
kMaxRxAttempts
static constexpr size_t kMaxRxAttempts
Definition: video_receiver.cc:13
UDPServer::Recv
ssize_t Recv(std::byte *buf, size_t len) const
Try to receive up to len bytes in buf by default this will not block.
Definition: udp_server.h:55
VideoReceiver::kVideoStreamMaxRxSize
static constexpr size_t kVideoStreamMaxRxSize
Definition: video_receiver.h:26
VideoReceiver::VideoReceiver
VideoReceiver(uint16_t port)
Definition: video_receiver.cc:17
VideoReceiver::data_available_
size_t data_available_
Definition: video_receiver.h:40
VideoReceiver::Load
size_t Load(unsigned char *destination, size_t requested_bytes) final
Definition: video_receiver.cc:23