RTC Toolkit  2.0.0
packetFormats.hpp
Go to the documentation of this file.
1 
12 #ifndef RTCTK_STANDALONETOOLS_RAWRECORDER_PACKETFORMATS_HPP
13 #define RTCTK_STANDALONETOOLS_RAWRECORDER_PACKETFORMATS_HPP
14 
15 
16 #include <boost/endian/arithmetic.hpp>
17 
18 struct MudpiHeader {
25  boost::endian::big_int32_t topic_id;
26 
28  boost::endian::big_uint16_t component_id;
29 
31  boost::endian::big_uint16_t application_tag;
32 
34  boost::endian::big_uint16_t reserved1;
35 
37  boost::endian::big_uint16_t version;
38 
40  boost::endian::big_uint32_t sample_id;
41 
43  boost::endian::big_float64_buf_t timestamp;
44 
46  boost::endian::big_uint16_t frame_id;
47 
49  boost::endian::big_uint16_t frame_count;
50 
52  boost::endian::big_uint16_t payload_size;
53 
55  boost::endian::big_uint16_t reserved2;
56 
57 };
58 
62 enum RtmsFrameInfo : uint8_t {
63  PACKET_MASK = 0b1110'0000,
64 
65  RTMS_FRAME_INFO_IS_LITTLE_ENDIAN = 1 << 3,
66 
67  RTMS_FRAME_INFO_IS_SIM_SOURCE = 1 << 4,
68 
69  RTMS_FRAME_INFO_RTMS_PACKET_TYPE_MASK = 0b1110'0000,
73 };
74 
81 
83  boost::endian::big_uint8_t extended_info_size;
84 
86  boost::endian::big_uint16_t protocol_version;
87 
89  boost::endian::big_uint32_t status;
90 
91 };
92 
98 };
99 
100 
107  boost::endian::big_uint16_t payload_size;
109  boost::endian::big_uint8_t leading_padding_size;
111  boost::endian::big_uint8_t trailling_padding_size;
116  boost::endian::big_uint32_t payload_tag;
117 };
118 
124 };
125 
129 union RtmsHeader {
134 };
135 
136 // ensure right struct sizes
137 static_assert(sizeof(MudpiHeader) == 32, "Invalid MudpiHeader struct size");
138 static_assert(sizeof(RtmsFrameInfo) == 1, "Invalid RtmsFrameInfo struct size");
139 static_assert(sizeof(RtmsCommonHeader) == 8, "Invalid RtmsCommonHeader struct size");
140 static_assert(sizeof(RtmsLeaderHeader) == 8, "Invalid RtmsLeaderHeader struct size");
141 static_assert(sizeof(RtmsPayloadHeader) == 16, "Invalid RtmsPayloadHeader struct size");
142 static_assert(sizeof(RtmsTrailerHeader) == 8, "Invalid RtmsTrailerHeader struct size");
143 
144 
145 #endif //RTCTK_STANDALONETOOLS_RAWRECORDER_PACKETFORMATS_HPP
MudpiHeader::frame_id
boost::endian::big_uint16_t frame_id
MUDPI frame id.
Definition: packetFormats.hpp:46
RtmsLeaderHeader
Header for the RTMS leader packet.
Definition: packetFormats.hpp:96
MudpiHeader::payload_size
boost::endian::big_uint16_t payload_size
MUDPI payload size.
Definition: packetFormats.hpp:52
RtmsCommonHeader::status
boost::endian::big_uint32_t status
RTMS status field.
Definition: packetFormats.hpp:89
MudpiHeader::timestamp
boost::endian::big_float64_buf_t timestamp
MUDPI timestamp.
Definition: packetFormats.hpp:43
MudpiHeader::application_tag
boost::endian::big_uint16_t application_tag
For application use.
Definition: packetFormats.hpp:31
RTMS_FRAME_INFO_RTMS_PAYLOAD_PACKET
@ RTMS_FRAME_INFO_RTMS_PAYLOAD_PACKET
Definition: packetFormats.hpp:70
RtmsPayloadHeader
Header for the RTMS paylaod packet.
Definition: packetFormats.hpp:104
PACKET_MASK
@ PACKET_MASK
Definition: packetFormats.hpp:63
RtmsPayloadHeader::payload_tag
boost::endian::big_uint32_t payload_tag
position of first byte in this payload packet in the complete payload transmission
Definition: packetFormats.hpp:116
RtmsLeaderHeader::common
RtmsCommonHeader common
Definition: packetFormats.hpp:97
RtmsHeader::leader
RtmsLeaderHeader leader
Definition: packetFormats.hpp:130
MudpiHeader::topic_id
boost::endian::big_int32_t topic_id
Unique identifier of data topic.
Definition: packetFormats.hpp:25
RtmsTrailerHeader
Header for the RTMS trailer packet.
Definition: packetFormats.hpp:122
MudpiHeader::reserved1
boost::endian::big_uint16_t reserved1
Reserved for future MUDPI use.
Definition: packetFormats.hpp:34
RtmsHeader::trailer
RtmsTrailerHeader trailer
Definition: packetFormats.hpp:132
RtmsPayloadHeader::leading_padding_size
boost::endian::big_uint8_t leading_padding_size
padding size before the actual payload
Definition: packetFormats.hpp:109
RtmsCommonHeader::frame_info
RtmsFrameInfo frame_info
RTMS frame info.
Definition: packetFormats.hpp:80
RtmsPayloadHeader::trailling_padding_size
boost::endian::big_uint8_t trailling_padding_size
padding size after the actual payload
Definition: packetFormats.hpp:111
MudpiHeader::reserved2
boost::endian::big_uint16_t reserved2
MUDPI reserved flags.
Definition: packetFormats.hpp:55
RtmsCommonHeader
Header common for all RTMS packet types.
Definition: packetFormats.hpp:78
RtmsHeader::payload
RtmsPayloadHeader payload
Definition: packetFormats.hpp:131
RtmsHeader::common
RtmsCommonHeader common
Definition: packetFormats.hpp:133
MudpiHeader::frame_count
boost::endian::big_uint16_t frame_count
MUDPI frame count.
Definition: packetFormats.hpp:49
RtmsPayloadHeader::common
RtmsCommonHeader common
Definition: packetFormats.hpp:105
MudpiHeader::version
boost::endian::big_uint16_t version
MUDPI version.
Definition: packetFormats.hpp:37
RtmsFrameInfo
RtmsFrameInfo
enum for the frame_info RTMS field
Definition: packetFormats.hpp:62
RtmsPayloadHeader::payload_size
boost::endian::big_uint16_t payload_size
Payload Size.
Definition: packetFormats.hpp:107
MudpiHeader::component_id
boost::endian::big_uint16_t component_id
Unique Id of sender.
Definition: packetFormats.hpp:28
MudpiHeader::sample_id
boost::endian::big_uint32_t sample_id
MUDPI sampleId.
Definition: packetFormats.hpp:40
RtmsCommonHeader::protocol_version
boost::endian::big_uint16_t protocol_version
RTMS protocol version.
Definition: packetFormats.hpp:86
RtmsTrailerHeader::common
RtmsCommonHeader common
Definition: packetFormats.hpp:123
RtmsHeader
RTMS header.
Definition: packetFormats.hpp:129
RTMS_FRAME_INFO_RTMS_LEADER_PACKET
@ RTMS_FRAME_INFO_RTMS_LEADER_PACKET
Definition: packetFormats.hpp:72
RTMS_FRAME_INFO_RTMS_TRAILER_PACKET
@ RTMS_FRAME_INFO_RTMS_TRAILER_PACKET
Definition: packetFormats.hpp:71
RtmsCommonHeader::extended_info_size
boost::endian::big_uint8_t extended_info_size
RTMS size of the extended info field.
Definition: packetFormats.hpp:83
MudpiHeader
Definition: packetFormats.hpp:18