MediaX v1.0.0rc7 [7e6cb74]
Video streaming for military vehicles
Loading...
Searching...
No Matches
mediax::rtp::uncompressed::RtpUncompressedPayloader Class Reference

Manage an RTP stream. More...

#include <rtp_uncompressed_payloader.h>

Inheritance diagram for mediax::rtp::uncompressed::RtpUncompressedPayloader:
Inheritance graph
Collaboration diagram for mediax::rtp::uncompressed::RtpUncompressedPayloader:
Collaboration graph

Public Member Functions

 RtpUncompressedPayloader ()
 The supported colour spaces.
 
 ~RtpUncompressedPayloader () final
 Destroy the Rtp Stream object.
 
void SetStreamInfo (const ::mediax::rtp::StreamInformation &stream_information) final
 Configure an RTP output stream.
 
bool Open () final
 Open the RTP stream.
 
void Close () final
 Close the RTP stream.
 
int Transmit (uint8_t *rgbframe, bool blocking=true) final
 Transmit an RGB buffer.
 
std::mutex & GetMutex ()
 Get the Mutex object.
 
- Public Member Functions inherited from mediax::rtp::RtpPayloader
 RtpPayloader ()=default
 Construct a new Rtp Payloader object.
 
virtual ~RtpPayloader ()=default
 Destroy the Rtp Payloader object.
 
 RtpPayloader (RtpPayloader const &)=delete
 Construct a new Rtp Payloader object.
 
RtpPayloaderoperator= (RtpPayloader const &)=delete
 Construct a new Rtp Payloader object.
 
virtual void Stop ()
 Stop a stream so it can be quickly restarted. Do not close.
 
virtual void Start ()
 Restart a stopped stream.
 
mediax::rtp::ColourspaceType GetColourSpace () const
 Get the Colour Space object of the incoming stream.
 
void SetColourSpace (mediax::rtp::ColourspaceType colourspace)
 Set the Colour Space object.
 
uint32_t GetHeight () const
 Get the Height object of the incoming stream.
 
void SetHeight (uint32_t height)
 Set the Height object.
 
uint32_t GetWidth () const
 Get the Width object of the incoming stream.
 
void SetWidth (uint32_t width)
 Set the Width object.
 
uint32_t GetFrameRate () const
 Get the Frame Rate of the incoming stream.
 
void SetFrameRate (uint32_t framerate)
 Set the Frame Rate object.
 
std::string GetIpAddress () const
 Get the Ip Address of the incoming stream.
 
void SetIpAddress (std::string_view ip_address)
 Set the Ip Address object.
 
uint32_t GetPort () const
 Get the Port of the incoming stream.
 
void SetPort (uint32_t port)
 Set the Port object.
 
std::vector< uint8_t > & GetBuffer ()
 Get the Buffer object.
 
uint32_t GetBufferSize () const
 Get the Buffer Size object.
 
void SetBufferSize (uint32_t size)
 Set the Buffer Size object.
 

Static Public Member Functions

static void SendFrame (RtpUncompressedPayloader *stream)
 Send a frame.
 

Private Member Functions

void UpdateHeader (rtp::RtpHeader *packet, int line, int bytes_per_pixel, int last, int32_t timestamp, int32_t source)
 Populate the RTP header.
 

Static Private Member Functions

static void TransmitThread (RtpUncompressedPayloader *stream)
 Transmit RTP data to the network using a separate thread.
 
static int32_t GenerateTimestamp90kHz ()
 Get a 90Htz timestamp.
 

Private Attributes

rtp::TxData arg_tx
 Transmit arguments used by the thread.
 
struct addrinfo * server_out_
 The server address information.
 
struct sockaddr_in server_addr_out_
 The socket for the outgoing stream.
 
socklen_t server_len_out_
 The length of the server address.
 
std::thread tx_thread_
 Arguments sent to thread.
 
std::mutex mutex_
 The mutex for the transmit thread.
 

Static Private Attributes

static uint32_t sequence_number_ = 0
 The incremental sequence numer for transmitting RTP packets.
 
static std::vector< uint8_t > buffer_in_
 The buffer for the incoming RTP data.
 

Additional Inherited Members

- Protected Member Functions inherited from mediax::rtp::RtpPayloader
::mediax::rtp::RtpPortTypeGetEgressPort ()
 Get the Egress Port object.
 

Detailed Description

Manage an RTP stream.

Constructor & Destructor Documentation

◆ RtpUncompressedPayloader()

mediax::rtp::uncompressed::RtpUncompressedPayloader::RtpUncompressedPayloader ( )
default

The supported colour spaces.

Construct a new Rtp Stream object

Parameters
heightin pixels of the RTP stream
widthin pixels of the RTP stream

Member Function Documentation

◆ Close()

void mediax::rtp::uncompressed::RtpUncompressedPayloader::Close ( )
finalvirtual

Close the RTP stream.

Implements mediax::rtp::RtpPayloader.

◆ GenerateTimestamp90kHz()

int32_t mediax::rtp::uncompressed::RtpUncompressedPayloader::GenerateTimestamp90kHz ( )
staticprivate

Get a 90Htz timestamp.

Returns
int32_t The current time stamp

◆ GetMutex()

std::mutex & mediax::rtp::uncompressed::RtpUncompressedPayloader::GetMutex ( )
inline

Get the Mutex object.

Returns
std::mutex&

◆ Open()

bool mediax::rtp::uncompressed::RtpUncompressedPayloader::Open ( )
finalvirtual

Open the RTP stream.

Returns
true
false

Implements mediax::rtp::RtpPayloader.

◆ SendFrame()

void mediax::rtp::uncompressed::RtpUncompressedPayloader::SendFrame ( RtpUncompressedPayloader stream)
static

Send a frame.

Parameters
streamThe RtpUncompressedPayloader object

Note DEF-STAN 00-082 starts line numbers at 1, gstreamer starts at 0 for raw video

◆ SetStreamInfo()

void mediax::rtp::uncompressed::RtpUncompressedPayloader::SetStreamInfo ( const ::mediax::rtp::StreamInformation stream_information)
finalvirtual

Configure an RTP output stream.

Parameters
stream_informationThe stream information

Implements mediax::rtp::RtpPayloader.

◆ Transmit()

int mediax::rtp::uncompressed::RtpUncompressedPayloader::Transmit ( uint8_t *  rgbframe,
bool  blocking = true 
)
finalvirtual

Transmit an RGB buffer.

Parameters
rgbframepointer to the frame data
blockingdefaults to true, will wait till frame has been transmitted
Returns
int

Implements mediax::rtp::RtpPayloader.

◆ TransmitThread()

void mediax::rtp::uncompressed::RtpUncompressedPayloader::TransmitThread ( RtpUncompressedPayloader stream)
staticprivate

Transmit RTP data to the network using a separate thread.

Parameters
streamThe RtpUncompressedPayloader object

◆ UpdateHeader()

void mediax::rtp::uncompressed::RtpUncompressedPayloader::UpdateHeader ( rtp::RtpHeader packet,
int  line,
int  bytes_per_pixel,
int  last,
int32_t  timestamp,
int32_t  source 
)
private

Populate the RTP header.

Parameters
packetthe RTP header
linethe line number
bytes_per_pixelthe bytes per pixel
lasttrue if last line
timestampthe timestamp
sourcethe source id

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