Compy 0.2.0
A lightweight RTSP 1.0 server library for embedded systems
Loading...
Searching...
No Matches
rtp.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <compy/priv/compiler_attrs.h>
10
11#include <stdbool.h>
12#include <stddef.h>
13#include <stdint.h>
14
23typedef struct {
27 uint8_t version;
28
36 bool padding;
37
43
48 uint8_t csrc_count;
49
55 bool marker;
56
62 uint8_t payload_ty;
63
72
83 uint32_t timestamp;
84
90 uint32_t ssrc;
91
97 uint32_t *csrc;
98
107
113
119
123size_t Compy_RtpHeader_size(Compy_RtpHeader self) COMPY_PRIV_MUST_USE;
124
135 Compy_RtpHeader self, uint8_t buffer[restrict]) COMPY_PRIV_MUST_USE;
136
154 Compy_RtpHeader *restrict self, const uint8_t *data,
155 size_t len) COMPY_PRIV_MUST_USE;
uint8_t * Compy_RtpHeader_serialize(Compy_RtpHeader self, uint8_t buffer[restrict]) COMPY_PRIV_MUST_USE
Writes self to buffer.
Definition rtp.c:38
size_t Compy_RtpHeader_size(Compy_RtpHeader self) COMPY_PRIV_MUST_USE
Computes the size of the binary self.
Definition rtp.c:14
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.
Definition rtp.c:101
An RTP header.
Definition rtp.h:23
uint8_t * extension_payload
The pointer to extension header data.
Definition rtp.h:117
uint16_t extension_payload_len
Length of the extension in 32-bit units (host byte order).
Definition rtp.h:112
bool padding
(1 bit) Used to indicate if there are extra padding bytes at the end of the RTP packet.
Definition rtp.h:36
uint16_t extension_profile
(optional, presence indicated by Extension field) The first 32-bit word contains a profile-specific i...
Definition rtp.h:106
bool extension
(1 bit) Indicates presence of an extension header between the header and payload data.
Definition rtp.h:42
bool marker
(1 bit) Signaling used at the application level in a profile-specific manner.
Definition rtp.h:55
uint32_t ssrc
(32 bits) Synchronization source identifier uniquely identifies the source of a stream.
Definition rtp.h:90
uint8_t payload_ty
(7 bits) Indicates the format of the payload and thus determines its interpretation by the applicatio...
Definition rtp.h:62
uint8_t version
(2 bits) Indicates the version of the protocol.
Definition rtp.h:27
uint16_t sequence_number
(16 bits) The sequence number is incremented for each RTP data packet sent and is to be used by the r...
Definition rtp.h:71
uint32_t * csrc
(32 bits each, the number of entries is indicated by the CSRC count field) Contributing source IDs en...
Definition rtp.h:97
uint32_t timestamp
Used by the receiver to play back the received samples at appropriate time and interval.
Definition rtp.h:83
uint8_t csrc_count
(4 bits) Contains the number of CSRC identifiers (defined below) that follow the SSRC (also defined b...
Definition rtp.h:48