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

Manage an RTP stream. More...

#include <rtp_depayloader.h>

Inheritance diagram for mediax::rtp::RtpDepayloader:
Inheritance graph
Collaboration diagram for mediax::rtp::RtpDepayloader:
Collaboration graph

Public Member Functions

 RtpDepayloader ()
 Construct a new Rtp Depayloader object.
 
virtual ~RtpDepayloader ()=default
 Destroy the Rtp Stream object.
 
 RtpDepayloader (RtpDepayloader const &)=delete
 Construct a new Rtp Payloader object.
 
RtpDepayloaderoperator= (RtpDepayloader const &)=delete
 Construct a new Rtp Payloader object.
 
virtual void SetStreamInfo (const ::mediax::rtp::StreamInformation &stream_information)=0
 Configure at RTP input stream and dont wait for the SAP/SDP announcement.
 
void RegisterCallback (const ::mediax::rtp::RtpCallback &callback)
 Register a callback for our session_name.
 
virtual bool Open ()
 Open the RTP stream.
 
virtual void Start ()
 Start the stream.
 
virtual void Stop ()
 Stop the stream, can be quickly re-started.
 
virtual void Close ()
 Close the RTP stream.
 
virtual bool Receive (mediax::rtp::RtpFrameData *data, int32_t timeout=0)=0
 Recieve a frame or timeout.
 
void SetSessionName (std::string_view name)
 Set the Session Name attribute.
 
std::string GetSessionName ()
 Get the Session Name attribute.
 
::mediax::rtp::ColourspaceType GetColourSpace ()
 Get the Colour Space object of the incoming stream.
 
void SetHeight (uint32_t height)
 Set the Height attribute.
 
uint32_t GetHeight () const
 Get the Height object of the incoming stream.
 
void SetWidth (uint32_t width)
 Set the Width attribute.
 
uint32_t GetWidth () const
 Get the Width object of the incoming stream.
 
void SetFramerate (uint32_t framerate)
 Set the Frame Rate object.
 
uint32_t GetFrameRate () const
 Get the Frame Rate of the incoming stream.
 
std::string GetIpAddress () const
 Get the Ip Address of the incoming stream.
 
void SetIpAddress (std::string_view ip_address)
 Set the Ip Address attribute.
 
void SetPort (uint32_t port)
 Set the Port object.
 
uint32_t GetPort () const
 Get the Port of the incoming stream.
 
void SetColourSpace (::mediax::rtp::ColourspaceType colourspace)
 Set the Colour Space object.
 
bool SettingsValid () const
 Check if the settings are valid. All stream information was set.
 
::mediax::rtp::ColourspaceType GetColourSpace () const
 Get the Colour Space object.
 
bool IsMulticast (std::string_view ip_address) const
 Check if the IP address is a multicast address.
 
bool CallbackRegistered () const
 Check is a callback is registered.
 
void UnregisterCallback ()
 Unregister the callback.
 
virtual void Callback (::mediax::rtp::RtpFrameData frame) const =0
 Call the registered callback.
 
::mediax::rtp::RtpPortTypeGetStream ()
 Get the Port Type object.
 
::mediax::rtp::RtpCallback GetCallback () const
 Get the Callback 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.
 
::mediax::rtp::StreamState GetState () const
 Get the State object.
 

Private Attributes

::mediax::rtp::StreamState state_ = ::mediax::rtp::StreamState::kClosed
 Stream state.
 
::mediax::rtp::RtpCallback callback_
 The callback to notify when a frame is received.
 
std::vector< uint8_t > buffer_in_
 UDP data buffer.
 
bool callback_registered_ = false
 Indicate if callback has been registered.
 
::mediax::rtp::RtpPortType ingress_ = {}
 Ingress port.
 
uint32_t settings_mask_ = 0
 Settings valid mask.
 

Detailed Description

Manage an RTP stream.

Member Function Documentation

◆ Callback()

◆ CallbackRegistered()

bool mediax::rtp::RtpDepayloader::CallbackRegistered ( ) const

Check is a callback is registered.

Returns
true if one is registered
false if one is not registered

◆ Close()

◆ GetBuffer()

std::vector< uint8_t > & mediax::rtp::RtpDepayloader::GetBuffer ( )
inline

Get the Buffer object.

Returns
std::vector<uint8_t>&

◆ GetBufferSize()

uint32_t mediax::rtp::RtpDepayloader::GetBufferSize ( ) const
inline

Get the Buffer Size object.

Returns
uint32_t

◆ GetCallback()

::mediax::rtp::RtpCallback mediax::rtp::RtpDepayloader::GetCallback ( ) const
inline

Get the Callback object.

Returns
mediax::rtp::RtpCallback

◆ GetColourSpace() [1/2]

mediax::rtp::ColourspaceType mediax::rtp::RtpDepayloader::GetColourSpace ( )

Get the Colour Space object of the incoming stream.

Note
This may be invalid id no SAP/SDP announcement has been received yet.
Returns
ColourspaceType

◆ GetColourSpace() [2/2]

mediax::rtp::ColourspaceType mediax::rtp::RtpDepayloader::GetColourSpace ( ) const

Get the Colour Space object.

Returns
mediax::rtp::ColourspaceType

◆ GetFrameRate()

uint32_t mediax::rtp::RtpDepayloader::GetFrameRate ( ) const

Get the Frame Rate of the incoming stream.

Note
This may be invalid id no SAP/SDP announcement has been received yet.
Returns
uint32_t

◆ GetHeight()

uint32_t mediax::rtp::RtpDepayloader::GetHeight ( ) const

Get the Height object of the incoming stream.

Note
This may be invalid id no SAP/SDP announcement has been received yet.
Returns
uint32_t

◆ GetIpAddress()

std::string mediax::rtp::RtpDepayloader::GetIpAddress ( ) const

Get the Ip Address of the incoming stream.

Note
This may be invalid id no SAP/SDP announcement has been received yet.
Returns
std::string

◆ GetPort()

uint32_t mediax::rtp::RtpDepayloader::GetPort ( ) const

Get the Port of the incoming stream.

Note
This may be invalid id no SAP/SDP announcement has been received yet.
Returns
uint32_t

◆ GetSessionName()

std::string mediax::rtp::RtpDepayloader::GetSessionName ( )

Get the Session Name attribute.

Returns
std::string The SAP/SDP session name

◆ GetState()

::mediax::rtp::StreamState mediax::rtp::RtpDepayloader::GetState ( ) const
inline

Get the State object.

Returns
mediax::rtp::StreamState

◆ GetStream()

mediax::rtp::RtpPortType & mediax::rtp::RtpDepayloader::GetStream ( )

Get the Port Type object.

Returns
mediax::rtp::RtpPortType&

◆ GetWidth()

uint32_t mediax::rtp::RtpDepayloader::GetWidth ( ) const

Get the Width object of the incoming stream.

Note
This may be invalid id no SAP/SDP announcement has been received yet.
Returns
uint32_t

◆ IsMulticast()

bool mediax::rtp::RtpDepayloader::IsMulticast ( std::string_view  ip_address) const

Check if the IP address is a multicast address.

Parameters
ip_address
Returns
true
false

◆ Open()

◆ operator=()

RtpDepayloader & mediax::rtp::RtpDepayloader::operator= ( RtpDepayloader const &  )
delete

Construct a new Rtp Payloader object.

Returns
RtpPayloader&

◆ Receive()

virtual bool mediax::rtp::RtpDepayloader::Receive ( mediax::rtp::RtpFrameData data,
int32_t  timeout = 0 
)
pure virtual

Recieve a frame or timeout.

Parameters
datathe fame buffer in CPU memory.
timeoutzero will wait forever or a timeout in milliseconds
Returns
true when frame available
false when no frame was received in the timeout

Implemented in mediax::rtp::av1::gst::RtpAv1GstDepayloader, mediax::rtp::h264::vaapi::RtpH264VaapiDepayloader, mediax::rtp::h265::gst::vaapi::RtpH265GstVaapiDepayloader, mediax::rtp::jpeg::gst::RtpJpegGstDepayloader, and mediax::rtp::jpeg::gst::vaapi::RtpJpegGstVaapiDepayloader.

◆ RegisterCallback()

void mediax::rtp::RtpDepayloader::RegisterCallback ( const ::mediax::rtp::RtpCallback callback)

Register a callback for our session_name.

Parameters
callbackThe callback to notify when a frame is received

◆ SetBufferSize()

void mediax::rtp::RtpDepayloader::SetBufferSize ( uint32_t  size)
inline

Set the Buffer Size object.

Parameters
size

◆ SetColourSpace()

void mediax::rtp::RtpDepayloader::SetColourSpace ( ::mediax::rtp::ColourspaceType  colourspace)

Set the Colour Space object.

Parameters
colourspace

◆ SetIpAddress()

void mediax::rtp::RtpDepayloader::SetIpAddress ( std::string_view  ip_address)

Set the Ip Address attribute.

Parameters
ip_addressThe IPV4 address of the video stream

◆ SetSessionName()

void mediax::rtp::RtpDepayloader::SetSessionName ( std::string_view  name)

Set the Session Name attribute.

Parameters
nameThe SAP/SDP session name

◆ SetStreamInfo()

◆ SettingsValid()

bool mediax::rtp::RtpDepayloader::SettingsValid ( ) const

Check if the settings are valid. All stream information was set.

Returns
true
false

◆ Start()

◆ Stop()


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