Compy 0.2.0
A lightweight RTSP 1.0 server library for embedded systems
Loading...
Searching...
No Matches
nal_transport.h File Reference

An RTP/NAL data transport. More...

#include <compy/droppable.h>
#include <compy/nal.h>
#include <compy/rtp_transport.h>
#include <stddef.h>
#include <stdint.h>
#include <compy/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  Compy_NalTransportConfig
 The configuration structure for Compy_NalTransport. More...
 

Macros

#define COMPY_MAX_H264_NALU_SIZE   1200
 The default value for Compy_NalTransportConfig.max_h264_nalu_size.
 
#define COMPY_MAX_H265_NALU_SIZE   4096
 The default value for Compy_NalTransportConfig.max_h265_nalu_size.
 

Typedefs

typedef struct Compy_NalTransport Compy_NalTransport
 An RTP/NAL data transport.
 

Functions

Compy_NalTransportConfig Compy_NalTransportConfig_default (void) COMPY_PRIV_MUST_USE
 Returns the default Compy_NalTransportConfig.
 
Compy_NalTransportCompy_NalTransport_new (Compy_RtpTransport *t) COMPY_PRIV_MUST_USE
 Creates a new RTP/NAL transport with the default configuration.
 
Compy_NalTransportCompy_NalTransport_new_with_config (Compy_RtpTransport *t, Compy_NalTransportConfig config) COMPY_PRIV_MUST_USE
 Creates a new RTP/NAL transport with a custom configuration.
 
int Compy_NalTransport_send_packet (Compy_NalTransport *self, Compy_RtpTimestamp ts, Compy_NalUnit nalu) COMPY_PRIV_MUST_USE
 Sends an RTP/NAL packet.
 
 declImplExtern99 (Compy_Droppable, Compy_NalTransport)
 Implements Compy_Droppable_IFACE for Compy_NalTransport.
 
bool Compy_NalTransport_is_full (Compy_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

◆ Compy_NalTransport_new()

Compy_NalTransport * Compy_NalTransport_new ( Compy_RtpTransport t)

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

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

◆ Compy_NalTransport_new_with_config()

Compy_NalTransport * Compy_NalTransport_new_with_config ( Compy_RtpTransport t,
Compy_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

◆ Compy_NalTransport_send_packet()

int Compy_NalTransport_send_packet ( Compy_NalTransport self,
Compy_RtpTimestamp  ts,
Compy_NalUnit  nalu 
)

Sends an RTP/NAL packet.

If nalu is larger than the limit values from Compy_NalTransportConfig (configured via Compy_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.

◆ Compy_NalTransportConfig_default()

Compy_NalTransportConfig Compy_NalTransportConfig_default ( void  )

Returns the default Compy_NalTransportConfig.

The default values are:

◆ declImplExtern99()

declImplExtern99 ( Compy_Droppable  ,
Compy_NalTransport   
)

Implements Compy_Droppable_IFACE for Compy_NalTransport.

See Interface99 for the macro usage.