SmolRTSP  0.1.3
A small, portable, extensible RTSP 1.0 implementation in C99
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 <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...
 

Macros

#define SMOLRTSP_MAX_H264_NALU_SIZE   1200
 The default value for SmolRTSP_NalTransportConfig.max_h264_nalu_size.
 
#define SMOLRTSP_MAX_H265_NALU_SIZE   1200
 The default value for SmolRTSP_NalTransportConfig.max_h265_nalu_size.
 

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. More...
 
SmolRTSP_NalTransportSmolRTSP_NalTransport_new (SmolRTSP_RtpTransport *t) SMOLRTSP_PRIV_MUST_USE
 Creates a new RTP/NAL transport with the default configuration. More...
 
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. More...
 
int SmolRTSP_NalTransport_send_packet (SmolRTSP_NalTransport *self, SmolRTSP_RtpTimestamp ts, SmolRTSP_NalUnit nalu) SMOLRTSP_PRIV_MUST_USE
 Sends an RTP/NAL packet. More...
 
 declImplExtern99 (SmolRTSP_Droppable, SmolRTSP_NalTransport)
 Implements SmolRTSP_Droppable_IFACE for SmolRTSP_NalTransport. More...
 
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,
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]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: