![]() |
MediaX v1.0.0rc7 [7e6cb74]
Video streaming for military vehicles
|
Manage an RTP stream. More...
#include <rtp_uncompressed_depayloader.h>
Public Member Functions | |
RtpUncompressedDepayloader () | |
The supported colour spaces. | |
~RtpUncompressedDepayloader (void) final=default | |
Destroy the Rtp Stream object. | |
RtpUncompressedDepayloader (RtpUncompressedDepayloader &&other)=delete | |
Construct a new Rtpvraw Depayloader object (Deleted) | |
void | SetStreamInfo (const ::mediax::rtp::StreamInformation &stream_information) final |
Configure at RTP input stream and dont wait for the SAP/SDP announcement. | |
bool | Open () final |
Open the RTP stream. | |
void | Start () final |
Start the stream recieve thread, can be quickly re-started without having to re-open the UDP port. | |
void | Stop () final |
Stop the stream recieve thread, can be quickly re-started without having to re-open the UDP port. | |
void | Close () final |
Close the RTP stream. | |
bool | Receive (::mediax::rtp::RtpFrameData *data, int32_t timeout=0) final |
Recieve a frame or timeout. | |
void | Callback (::mediax::rtp::RtpFrameData frame) const final |
The callback function for the RTP stream. | |
![]() | |
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. | |
RtpDepayloader & | operator= (RtpDepayloader const &)=delete |
Construct a new Rtp Payloader object. | |
void | RegisterCallback (const ::mediax::rtp::RtpCallback &callback) |
Register a callback for our session_name. | |
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. | |
::mediax::rtp::RtpPortType & | GetStream () |
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 Member Functions | |
void | UpdateHeader (::mediax::rtp::RtpHeaderData *packet, int line, int last, int32_t timestamp, int32_t source) const |
Populate the RTP header. | |
bool | WaitForFrame (uint8_t **cpu, int32_t timeout) |
Wait for a frame or timeout. | |
bool | ReadRtpHeader (RtpUncompressedDepayloader *stream, ::mediax::rtp::RtpPacket *packet) |
Read in a RTP packet and decode header. | |
bool | ReceiveLines (::mediax::rtp::RtpPacket *packet, bool *last_scan_line, int *last_packet) |
Receive video lines. | |
Static Private Member Functions | |
static void | TransmitThread (RtpUncompressedDepayloader *stream) |
Transmit RTP data to the network using a separate thread. | |
static void | ReceiveThread (RtpUncompressedDepayloader *stream) |
Recieve RTP data to the network using a separate thread. | |
static int32_t | GenerateTimestamp90kHz () |
Get a 90Htz timestamp. | |
Private Attributes | |
std::atomic< bool > | new_rx_frame_ = false |
The incremental sequence numer for transmitting RTP packets, atomic. | |
bool | rx_thread_running_ = true |
Flag indicating the thread is running. | |
::mediax::rtp::TxData | arg_tx |
Transmit arguments used by the thread. | |
pthread_mutex_t | mutex_ |
thread mutex | |
std::array< uint8_t, ::mediax::rtp::kMaxUdpData > | udpdata |
UDP data buffer. | |
std::thread | rx_thread_ |
Arguments sent to thread. | |
uint32_t | sequence_number_ = 0 |
The current sequence number. | |
Manage an RTP stream.
mediax::rtp::uncompressed::RtpUncompressedDepayloader::RtpUncompressedDepayloader | ( | ) |
The supported colour spaces.
Construct a new Rtp Stream object
height | in pixels of the RTP stream |
width | in pixels of the RTP stream |
|
delete |
Construct a new Rtpvraw Depayloader object (Deleted)
other |
|
finalvirtual |
|
finalvirtual |
Close the RTP stream.
Reimplemented from mediax::rtp::RtpDepayloader.
|
staticprivate |
Get a 90Htz timestamp.
|
finalvirtual |
|
private |
Read in a RTP packet and decode header.
|
final |
Recieve a frame or timeout.
data | the fame buffer in CPU memory. |
timeout | zero will wait forever or a timeout in milliseconds |
|
private |
Receive video lines.
|
staticprivate |
Recieve RTP data to the network using a separate thread.
stream | this object |
|
finalvirtual |
Configure at RTP input stream and dont wait for the SAP/SDP announcement.
stream_information | The stream information |
Implements mediax::rtp::RtpDepayloader.
|
finalvirtual |
Start the stream recieve thread, can be quickly re-started without having to re-open the UDP port.
This can cause bandwidth issues if multiple UDP multicast streams are open. If bandwidth is an issue then its better to close the stream before switching to a new stream
Reimplemented from mediax::rtp::RtpDepayloader.
|
finalvirtual |
Stop the stream recieve thread, can be quickly re-started without having to re-open the UDP port.
Reimplemented from mediax::rtp::RtpDepayloader.
|
staticprivate |
Transmit RTP data to the network using a separate thread.
stream | this object |
|
private |
Populate the RTP header.
packet | the RTP header |
line | the line number |
last | true if last line |
timestamp | the timestamp |
source | the source id |
|
private |
Wait for a frame or timeout.
cpu | |
timeout |