SmolRTSP
0.1.3
A small, portable, extensible RTSP 1.0 implementation in C99
|
Utilitary stuff. More...
#include <smolrtsp/option.h>
#include <smolrtsp/types/error.h>
#include <stdint.h>
#include <slice99.h>
Go to the source code of this file.
Data Structures | |
struct | SmolRTSP_PortPair |
An RTP/RTCP port pair specified as a range, e.g., client_port=3456-3457 . More... | |
struct | SmolRTSP_ChannelPair |
An RTP/RTCP channel pair specified as a range, e.g., interleaved=4-5 . More... | |
struct | SmolRTSP_TransportConfig |
The RTSP transport configuration. More... | |
Macros | |
#define | SMOLRTSP_CRLF (CharSlice99_from_str("\r\n")) |
Carriage-return + new-line represented as a data slice. | |
#define | SMOLRTSP_DEFAULT_PORT 554 |
The default RTSP port. | |
Enumerations | |
enum | SmolRTSP_LowerTransport { SmolRTSP_LowerTransport_TCP , SmolRTSP_LowerTransport_UDP } |
An RTSP lower transport. More... | |
Functions | |
const char * | SmolRTSP_LowerTransport_str (SmolRTSP_LowerTransport self) |
Converts self to a string representation ("TCP" for SmolRTSP_LowerTransport_TCP and "UDP" for SmolRTSP_LowerTransport_UDP). | |
SMOLRTSP_DEF_OPTION (SmolRTSP_PortPair) | |
Defines SmolRTSP_PortPairOption . More... | |
SMOLRTSP_DEF_OPTION (SmolRTSP_ChannelPair) | |
Defines SmolRTSP_ChannelPairOption . More... | |
int | smolrtsp_parse_transport (SmolRTSP_TransportConfig *restrict config, CharSlice99 header_value) SMOLRTSP_PRIV_MUST_USE |
Parses the Transport header. More... | |
uint32_t | smolrtsp_interleaved_header (uint8_t channel_id, uint16_t payload_len) SMOLRTSP_PRIV_MUST_USE |
Returns a four-octet interleaved binary data header. More... | |
void | smolrtsp_parse_interleaved_header (const uint8_t data[restrict static 4], uint8_t *restrict channel_id, uint16_t *restrict payload_len) |
Parses an four-octet interleaved binary data header data . More... | |
Utilitary stuff.
SMOLRTSP_DEF_OPTION | ( | SmolRTSP_ChannelPair | ) |
Defines SmolRTSP_ChannelPairOption
.
See Datatype99 for the macro usage.
SMOLRTSP_DEF_OPTION | ( | SmolRTSP_PortPair | ) |
Defines SmolRTSP_PortPairOption
.
See Datatype99 for the macro usage.
uint32_t smolrtsp_interleaved_header | ( | uint8_t | channel_id, |
uint16_t | payload_len | ||
) |
Returns a four-octet interleaved binary data header.
[in] | channel_id | The one-byte channel identifier. |
[in] | payload_len | The length of the encapsulated binary data (network byte order). |
void smolrtsp_parse_interleaved_header | ( | const uint8_t | data[restrict static 4], |
uint8_t *restrict | channel_id, | ||
uint16_t *restrict | payload_len | ||
) |
Parses an four-octet interleaved binary data header data
.
[in] | data | The header to parse. |
[out] | channel_id | The one-byte channel identifier. |
[out] | payload_len | The length of the encapsulated binary data (host byte order). |
channel_id != NULL
payload_len != NULL
int smolrtsp_parse_transport | ( | SmolRTSP_TransportConfig *restrict | config, |
CharSlice99 | header_value | ||
) |
Parses the Transport
header.
[out] | config | The result of parsing. It remains unchanged on failure. |
[in] | header_value | The value of the Transport header. |
config != NULL