SmolRTSP 0.2.0
A small, portable, extensible RTSP 1.0 implementation in C99
Loading...
Searching...
No Matches
nal_transport.h File Reference

An RTP/NAL data transport. More...

#include <smolrtsp/droppable.h>
#include <smolrtsp/nal.h>
#include <smolrtsp/rtp_transport.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <smolrtsp/priv/compiler_attrs.h>
Include dependency graph for nal_transport.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SmolRTSP_NalTransportConfig
 The configuration structure for SmolRTSP_NalTransport. More...
 

Typedefs

typedef struct SmolRTSP_NalTransport SmolRTSP_NalTransport
 An RTP/NAL data transport.
 

Functions

SmolRTSP_NalTransportConfig SmolRTSP_NalTransportConfig_default (void) SMOLRTSP_PRIV_MUST_USE
 Returns the default SmolRTSP_NalTransportConfig.
 
SmolRTSP_NalTransportSmolRTSP_NalTransport_new (SmolRTSP_RtpTransport *t) SMOLRTSP_PRIV_MUST_USE
 Creates a new RTP/NAL transport with the default configuration.
 
SmolRTSP_NalTransportSmolRTSP_NalTransport_new_with_config (SmolRTSP_RtpTransport *t, SmolRTSP_NalTransportConfig config) SMOLRTSP_PRIV_MUST_USE
 Creates a new RTP/NAL transport with a custom configuration.
 
int SmolRTSP_NalTransport_send_packet (SmolRTSP_NalTransport *self, SmolRTSP_RtpTimestamp ts, bool is_au_end, SmolRTSP_NalUnit nalu) SMOLRTSP_PRIV_MUST_USE
 Sends an RTP/NAL packet.
 
 declImplExtern99 (SmolRTSP_Droppable, SmolRTSP_NalTransport)
 Implements SmolRTSP_Droppable_IFACE for SmolRTSP_NalTransport.
 
bool SmolRTSP_NalTransport_is_full (SmolRTSP_NalTransport *self)
 

Detailed Description

An RTP/NAL data transport.

See also
RTP Payload Format for H.264 Video: https://datatracker.ietf.org/doc/html/rfc6184
RTP Payload Format for High Efficiency Video Coding (HEVC): https://datatracker.ietf.org/doc/html/rfc7798

Function Documentation

◆ declImplExtern99()

declImplExtern99 ( SmolRTSP_Droppable  ,
SmolRTSP_NalTransport   
)

Implements SmolRTSP_Droppable_IFACE for SmolRTSP_NalTransport.

See Interface99 for the macro usage.

◆ SmolRTSP_NalTransport_new()

SmolRTSP_NalTransport * SmolRTSP_NalTransport_new ( SmolRTSP_RtpTransport t)

Creates a new RTP/NAL transport with the default configuration.

Parameters
[in]tThe underlying RTP transport.
Precondition
t != NULL

◆ SmolRTSP_NalTransport_new_with_config()

SmolRTSP_NalTransport * SmolRTSP_NalTransport_new_with_config ( SmolRTSP_RtpTransport t,
SmolRTSP_NalTransportConfig  config 
)

Creates a new RTP/NAL transport with a custom configuration.

Parameters
[in]tThe underlying RTP transport.
[in]configThe transmission configuration structure.
Precondition
t != NULL

◆ SmolRTSP_NalTransport_send_packet()

int SmolRTSP_NalTransport_send_packet ( SmolRTSP_NalTransport self,
SmolRTSP_RtpTimestamp  ts,
bool  is_au_end,
SmolRTSP_NalUnit  nalu 
)

Sends an RTP/NAL packet.

If nalu is larger than the limit values from SmolRTSP_NalTransportConfig (configured via SmolRTSP_NalTransport_new), nalu will be fragmented.

Parameters
[out]selfThe RTP/NAL transport for sending this packet.
[in]tsThe RTP timestamp for this packet.
[in]is_au_endtrue if nalu is the last NAL unit of its access unit (frame). The RTP marker bit is set on the final RTP packet emitted for this NAL only when this is true. Callers that do not split a frame into multiple NALs (single coded slice per frame) should pass true. RFC 6184 §5.1 / RFC 7798 §4.4.1.
[in]naluThe NAL unit of this RTP packet.
Precondition
self != NULL
Returns
-1 if an I/O error occurred and sets errno appropriately, 0 on success.

◆ SmolRTSP_NalTransportConfig_default()

SmolRTSP_NalTransportConfig SmolRTSP_NalTransportConfig_default ( void  )

Returns the default SmolRTSP_NalTransportConfig.

The default values are:

  • max_h264_nalu_size is #SMOLRTSP_MAX_H264_NALU_SIZE.
  • max_h265_nalu_size is #SMOLRTSP_MAX_H265_NALU_SIZE.
  • max_h266_nalu_size is #SMOLRTSP_MAX_H266_NALU_SIZE.