ifw-ccf 6.0.0
 
Loading...
Searching...
No Matches
rtmsCcfReceiver.hpp
Go to the documentation of this file.
1
8
9#ifndef RTMS_CCF_RECEIVER_HPP_
10#define RTMS_CCF_RECEIVER_HPP_
11
13
14#include <ifw/rtmslib/rtmsReceiver.hpp>
15
16
18
24 class RtmsCcfReceiver : public ifw::rtmstools::RtmsReceiver {
25 public:
26
27 // Time to wait for next packet in ms.
29 ifw::ccf::common::FrameQueue* m_frame_queue{nullptr}; // TODO: -> shared ptr?
30 ifw::ccf::common::DataFrame* m_cur_input_frame{nullptr}; // TODO: -> shared ptr?
31
32 std::list<ifw::ccf::common::DataFrame*> m_ready_frames;
34
36 ifw::fnd::datatype::DataType m_data_type;
37 uint16_t m_queue_size{0};
38 uint16_t m_receiver_index{0};
39 int64_t m_lost_frames{0};
42
43 RtmsCcfReceiver(std::string address,
44 int port,
45 std::string net_if,
46 int width,
47 int height,
48 int bpp,
49 ifw::fnd::datatype::DataType data_type,
50 int queue_size = 10);
51
52 virtual ~RtmsCcfReceiver();
53
55 virtual void HandleLeaderPacket();
56
58 virtual void HandlePayloadPacket(mudpiif::mudpiPacketJumbo& packet);
59
61 virtual void HandleTrailerPacket();
62
64 virtual void HandleLostPackets();
65
67 virtual void HandleWrongFrameId();
68
70 void GetFrame(const double timeout,
72 bool& frame_received);
73
74 int64_t GetLostFramesCount() const;
75
76 };
77}
78
79#endif // RTMS_CCF_RECEIVER_HPP_
Frame class used to store the data and metadata for one frames received from the camera.
Definition dataFrame.hpp:20
The FrameQueue class implements a queue, to manage a set of CCF DataFrame instances as a ring buffer.
Definition frameQueue.hpp:17
uint16_t m_queue_size
Definition rtmsCcfReceiver.hpp:37
int m_packet_timeout
Definition rtmsCcfReceiver.hpp:28
std::list< ifw::ccf::common::DataFrame * > m_ready_frames
Definition rtmsCcfReceiver.hpp:32
virtual void HandleWrongFrameId()
Handle the case where a wrong frame ID is received.
Definition rtmsCcfReceiver.cpp:132
virtual void HandleLostPackets()
Handle the case where packets are lost.
Definition rtmsCcfReceiver.cpp:121
std::mutex m_ready_frames_mutex
Definition rtmsCcfReceiver.hpp:33
int64_t m_lost_frames
Definition rtmsCcfReceiver.hpp:39
void GetFrame(const double timeout, ifw::ccf::common::DataFrame &data_frame, bool &frame_received)
Receive one RTMS frame.
Definition rtmsCcfReceiver.cpp:143
virtual ~RtmsCcfReceiver()
Definition rtmsCcfReceiver.cpp:34
int64_t m_frame_payload_packet_count
Definition rtmsCcfReceiver.hpp:41
virtual void HandleLeaderPacket()
Invoked to handle a MUDPI/RTMS Leader Packet.
Definition rtmsCcfReceiver.cpp:40
ifw::ccf::common::DataFrame * m_cur_input_frame
Definition rtmsCcfReceiver.hpp:30
ifw::ccf::common::FrameQueue * m_frame_queue
Definition rtmsCcfReceiver.hpp:29
uint16_t m_receiver_index
Definition rtmsCcfReceiver.hpp:38
virtual void HandleTrailerPacket()
Invoked to handle a MUDPI/RTMS Trailer Packet.
Definition rtmsCcfReceiver.cpp:101
int64_t m_frame_bytes_received
Definition rtmsCcfReceiver.hpp:40
virtual void HandlePayloadPacket(mudpiif::mudpiPacketJumbo &packet)
Invoked to handle a MUDPI/RTMS Payload Packet.
Definition rtmsCcfReceiver.cpp:68
RtmsCcfReceiver(std::string address, int port, std::string net_if, int width, int height, int bpp, ifw::fnd::datatype::DataType data_type, int queue_size=10)
Definition rtmsCcfReceiver.cpp:20
int64_t GetLostFramesCount() const
Definition rtmsCcfReceiver.cpp:167
int m_client_frame_index
Definition rtmsCcfReceiver.hpp:35
ifw::fnd::datatype::DataType m_data_type
Definition rtmsCcfReceiver.hpp:36
Definition rtmsCcfReceiver.hpp:17