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

RFC 3550-compliant RTP implementation. More...

#include <compy/priv/compiler_attrs.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Include dependency graph for rtp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Compy_RtpHeader
 An RTP header. More...
 

Functions

size_t Compy_RtpHeader_size (Compy_RtpHeader self) COMPY_PRIV_MUST_USE
 Computes the size of the binary self.
 
uint8_t * Compy_RtpHeader_serialize (Compy_RtpHeader self, uint8_t buffer[restrict]) COMPY_PRIV_MUST_USE
 Writes self to buffer.
 
int Compy_RtpHeader_deserialize (Compy_RtpHeader *restrict self, const uint8_t *data, size_t len) COMPY_PRIV_MUST_USE
 Parses an RTP header from a binary buffer.
 

Detailed Description

RFC 3550-compliant RTP implementation.

Function Documentation

◆ Compy_RtpHeader_deserialize()

int Compy_RtpHeader_deserialize ( Compy_RtpHeader *restrict  self,
const uint8_t *  data,
size_t  len 
)

Parses an RTP header from a binary buffer.

Fields in self will be in network byte order, matching the convention used by Compy_RtpHeader_serialize.

Parameters
[out]selfThe parsed RTP header.
[in]dataThe buffer to parse from.
[in]lenThe length of data in bytes.
Precondition
self != NULL
data != NULL
Returns
The total header size in bytes on success, or -1 if len is too small or the version field is not 2.

◆ Compy_RtpHeader_serialize()

uint8_t * Compy_RtpHeader_serialize ( Compy_RtpHeader  self,
uint8_t  buffer[restrict] 
)

Writes self to buffer.

Parameters
[in]selfThe RTP header to write.
[out]bufferThe pointer to write to. Must be at least of size Compy_RtpHeader_size(self).
Returns
The pointer to a passed buffer.