MediaX v1.0.0rc7 [7e6cb74]
Video streaming for military vehicles
Loading...
Searching...
No Matches
mediax::RtpSapTransmit< T > Class Template Reference

A RTP SAP transmitter helper class. More...

#include <rtp_sap_wrapper.h>

Collaboration diagram for mediax::RtpSapTransmit< T >:
Collaboration graph

Public Member Functions

 RtpSapTransmit (std::string_view hostname, uint16_t port, std::string_view session_name, uint16_t height, uint16_t width, uint16_t framerate, std::string_view encoding)
 Construct a new Rtp Sap Transmit object.
 
std::vector< uint8_t > & GetBuffer ()
 Get the frame buffer, resized and ready to use.
 
std::vector< uint8_t > & GetBuffer (uint32_t width, uint32_t height, ::mediax::rtp::ColourspaceType encoding)
 Get the frame buffer, resized and ready to use.
 
std::vector< uint8_t > & GetBufferTestPattern (uint32_t pattern=0)
 Get the frame buffer containing a pre-defined test pattern.
 
std::vector< uint8_t > & GetBufferTestPattern (uint32_t height, uint32_t width, ::mediax::rtp::ColourspaceType encoding, uint32_t pattern=0)
 This function can be called directly with explicit arguments.
 
 ~RtpSapTransmit ()
 Destroy the Rtp Sap Transmit object.
 
void Transmit (uint8_t *data, size_t size)
 The frame transmit function, this will transmit the frame over RTP at the required frequency.
 

Private Attributes

rtp_payloader_
 The RTP payloader.
 
sap::SapAnnouncersap_announcer_ = ::mediax::sap::SapAnnouncer::GetInstance()
 The SAP announcer.
 
::mediax::rtp::StreamInformation stream_info_
 The stream information.
 
std::vector< uint8_t > data_buffer_
 The vectored data buffer.
 
std::chrono::system_clock::time_point last_transmit_timestamp_
 Last transmit timestamp.
 

Detailed Description

template<typename T>
class mediax::RtpSapTransmit< T >

A RTP SAP transmitter helper class.

Constructor & Destructor Documentation

◆ RtpSapTransmit()

template<typename T >
mediax::RtpSapTransmit< T >::RtpSapTransmit ( std::string_view  hostname,
uint16_t  port,
std::string_view  session_name,
uint16_t  height,
uint16_t  width,
uint16_t  framerate,
std::string_view  encoding 
)
inline

Construct a new Rtp Sap Transmit object.

Parameters
hostnameThe IPV4 multicast address
portThe IPV4 multicast port
session_nameThe name of the stream
heightThe height of the stream
widthThe width of the stream
framerateThe framerate of the stream
encodingThe encoding of the stream, the valid options are:
  • "YUV422" for RTP uncompressed only
  • "RGB24" for RTP uncompressed only
  • "MONO8" for RTP uncompressed only
  • "MONO16" for RTP uncompressed only
  • "JPEG" for RTP JPEG modes only
  • "H264" for RTP H.264 modes only
  • "H265" for RTP H.265 modes only
  • "AV1" for RTP AV1 modes only

Member Function Documentation

◆ GetBuffer() [1/2]

template<typename T >
std::vector< uint8_t > & mediax::RtpSapTransmit< T >::GetBuffer ( )
inline

Get the frame buffer, resized and ready to use.

Returns
vector<uint8_t>&

◆ GetBuffer() [2/2]

template<typename T >
std::vector< uint8_t > & mediax::RtpSapTransmit< T >::GetBuffer ( uint32_t  width,
uint32_t  height,
::mediax::rtp::ColourspaceType  encoding 
)
inline

Get the frame buffer, resized and ready to use.

Returns
vector<uint8_t>&

◆ GetBufferTestPattern() [1/2]

template<typename T >
std::vector< uint8_t > & mediax::RtpSapTransmit< T >::GetBufferTestPattern ( uint32_t  height,
uint32_t  width,
::mediax::rtp::ColourspaceType  encoding,
uint32_t  pattern = 0 
)
inline

This function can be called directly with explicit arguments.

Parameters
heightThe pattern width
widthThe pattern height
encodingThe return buffer encoding
patternThe pattern to generate

◆ GetBufferTestPattern() [2/2]

template<typename T >
std::vector< uint8_t > & mediax::RtpSapTransmit< T >::GetBufferTestPattern ( uint32_t  pattern = 0)
inline

Get the frame buffer containing a pre-defined test pattern.

List of test patterns supported

  • 0=EBU Colour Bars
  • 1=Colour Bars
  • 2=Grey Scale Bars
  • 3=Checkered
  • 4=Red
  • 5=Green
  • 6=Blue
  • 7=Black
  • 8=White
  • 9=White Noise
  • 10=Bouncing Ball
Parameters
patternThe test pattern generate from the list above, see rtp_utils.h
Returns
std::vector<uint8_t>&

◆ Transmit()

template<typename T >
void mediax::RtpSapTransmit< T >::Transmit ( uint8_t *  data,
size_t  size 
)
inline

The frame transmit function, this will transmit the frame over RTP at the required frequency.

Parameters
dataThe RGB frame data
sizeThe size of the RGB frame data

The documentation for this class was generated from the following file: