|
SmolRTSP 0.2.0
A small, portable, extensible RTSP 1.0 implementation in C99
|
JPEG / Motion JPEG RTP payload-header types and serialization. More...
#include <stdbool.h>#include <stdint.h>#include <smolrtsp/priv/compiler_attrs.h>

Go to the source code of this file.
Data Structures | |
| struct | SmolRTSP_JpegPayloadHeader |
| An RFC 2435 main JPEG header (§3.1). More... | |
| struct | SmolRTSP_JpegQtHeader |
| An RFC 2435 Quantization Table header (§3.1.8). More... | |
| struct | SmolRTSP_JpegRestartHeader |
| An RFC 2435 Restart Marker header (§3.1.7). More... | |
Macros | |
| #define | SMOLRTSP_JPEG_MAIN_HEADER_SIZE 8 |
| The size in bytes of an RFC 2435 main JPEG header (§3.1). | |
| #define | SMOLRTSP_JPEG_QT_HEADER_SIZE 4 |
| The size in bytes of an RFC 2435 Quantization Table header (§3.1.8). | |
| #define | SMOLRTSP_JPEG_QT_SIZE 64 |
| The size in bytes of one 8-bit-precision baseline quantization table. | |
| #define | SMOLRTSP_JPEG_RESTART_HEADER_SIZE 4 |
| The size in bytes of an RFC 2435 Restart Marker header (§3.1.7). | |
| #define | SMOLRTSP_JPEG_TYPE_RESTART 64 |
| The RFC 2435 Type offset that flags the presence of restart markers. | |
| #define | SMOLRTSP_MAX_JPEG_PACKET_SIZE 1200 |
| Default value for SmolRTSP_JpegTransportConfig.max_packet_size: a conservative MTU that leaves room for RTP / UDP / IP headers and one 140-byte first-packet JPEG header (main + QT header + two 64-byte tables). | |
| #define | SMOLRTSP_JPEG_Q_DYNAMIC 128 |
| The smallest Q-value that signals an embedded quantization table per RFC 2435 §4.1. | |
| #define | SMOLRTSP_JPEG_TYPE_SPECIFIC_DEFAULT 0 |
| The Type-specific field is unused in the baseline RFC 2435 profile. | |
Functions | |
| void | SmolRTSP_JpegPayloadHeader_serialize (SmolRTSP_JpegPayloadHeader self, uint8_t buffer[restrict]) |
Serializes self into buffer in network byte order. | |
| void | SmolRTSP_JpegQtHeader_serialize (SmolRTSP_JpegQtHeader self, uint8_t buffer[restrict]) |
Serializes self into buffer in network byte order. | |
| void | SmolRTSP_JpegRestartHeader_serialize (SmolRTSP_JpegRestartHeader self, uint8_t buffer[restrict]) |
Serializes self into buffer in network byte order. | |
JPEG / Motion JPEG RTP payload-header types and serialization.
| #define SMOLRTSP_JPEG_MAIN_HEADER_SIZE 8 |
The size in bytes of an RFC 2435 main JPEG header (§3.1).
Carries Type-Specific, Fragment Offset, Type, Q, Width and Height fields. Present on every JPEG-over-RTP packet of a frame.
| #define SMOLRTSP_JPEG_Q_DYNAMIC 128 |
The smallest Q-value that signals an embedded quantization table per RFC 2435 §4.1.
Q in [0, 127] references a pre-shared table; Q in [128, 255] is paired with a SmolRTSP_JpegQtHeader and the table bytes themselves.
| #define SMOLRTSP_JPEG_QT_HEADER_SIZE 4 |
The size in bytes of an RFC 2435 Quantization Table header (§3.1.8).
Carries MBZ, Precision and Length fields, prefixing the QT data block itself. Only emitted on the first RTP packet of a frame when an embedded quantization table is sent (Q >= 128).
| #define SMOLRTSP_JPEG_RESTART_HEADER_SIZE 4 |
The size in bytes of an RFC 2435 Restart Marker header (§3.1.7).
Carries the Restart Interval, F, L and Restart Count fields. Present immediately after the main JPEG header on every RTP packet of a frame whose Type is in [64, 127] (i.e. the source JPEG uses restart markers).
| #define SMOLRTSP_JPEG_TYPE_RESTART 64 |
The RFC 2435 Type offset that flags the presence of restart markers.
A base Type in [0, 63] (subsampling + interlace) gains this offset, moving it into [64, 127], when the source JPEG carries a DRI marker. The receiver then expects a SmolRTSP_JpegRestartHeader after the main header and knows to honour the inline RSTn markers in the scan data.
| void SmolRTSP_JpegPayloadHeader_serialize | ( | SmolRTSP_JpegPayloadHeader | self, |
| uint8_t | buffer[restrict] | ||
| ) |
Serializes self into buffer in network byte order.
| [in] | self | The header to write. |
| [out] | buffer | The memory area capable of storing SMOLRTSP_JPEG_MAIN_HEADER_SIZE bytes. |
| void SmolRTSP_JpegQtHeader_serialize | ( | SmolRTSP_JpegQtHeader | self, |
| uint8_t | buffer[restrict] | ||
| ) |
Serializes self into buffer in network byte order.
| [in] | self | The header to write. |
| [out] | buffer | The memory area capable of storing SMOLRTSP_JPEG_QT_HEADER_SIZE bytes. |
| void SmolRTSP_JpegRestartHeader_serialize | ( | SmolRTSP_JpegRestartHeader | self, |
| uint8_t | buffer[restrict] | ||
| ) |
Serializes self into buffer in network byte order.
| [in] | self | The header to write. |
| [out] | buffer | The memory area capable of storing SMOLRTSP_JPEG_RESTART_HEADER_SIZE bytes. |