SmolRTSP 0.2.0
A small, portable, extensible RTSP 1.0 implementation in C99
Loading...
Searching...
No Matches
jpeg.h
Go to the documentation of this file.
1
9#pragma once
10
11#include <stdbool.h>
12#include <stdint.h>
13
14#include <smolrtsp/priv/compiler_attrs.h>
15
22#define SMOLRTSP_JPEG_MAIN_HEADER_SIZE 8
23
31#define SMOLRTSP_JPEG_QT_HEADER_SIZE 4
32
36#define SMOLRTSP_JPEG_QT_SIZE 64
37
43#define SMOLRTSP_MAX_JPEG_PACKET_SIZE 1200
44
51#define SMOLRTSP_JPEG_Q_DYNAMIC 128
52
56#define SMOLRTSP_JPEG_TYPE_SPECIFIC_DEFAULT 0
57
71typedef struct {
81 uint8_t type;
86 uint8_t q;
88 uint8_t width_blocks;
92
101 SmolRTSP_JpegPayloadHeader self, uint8_t buffer[restrict]);
102
114typedef struct {
116 uint8_t mbz;
122 uint8_t precision;
127 uint16_t length;
129
138 SmolRTSP_JpegQtHeader self, uint8_t buffer[restrict]);
void SmolRTSP_JpegQtHeader_serialize(SmolRTSP_JpegQtHeader self, uint8_t buffer[restrict])
Serializes self into buffer in network byte order.
void SmolRTSP_JpegPayloadHeader_serialize(SmolRTSP_JpegPayloadHeader self, uint8_t buffer[restrict])
Serializes self into buffer in network byte order.
An RFC 2435 main JPEG header (§3.1).
Definition jpeg.h:71
uint8_t type
RTP/JPEG Type field (byte 4): subsampling + interlace flags.
Definition jpeg.h:81
uint8_t type_specific
Type-specific field (byte 0).
Definition jpeg.h:73
uint32_t fragment_offset
Fragment offset within the JPEG frame, in bytes (bytes 1..3, 24-bit big-endian).
Definition jpeg.h:79
uint8_t width_blocks
Picture width in 8-pixel units (byte 6).
Definition jpeg.h:88
uint8_t height_blocks
Picture height in 8-pixel units (byte 7).
Definition jpeg.h:90
uint8_t q
Quality factor (byte 5).
Definition jpeg.h:86
An RFC 2435 Quantization Table header (§3.1.8).
Definition jpeg.h:114
uint8_t mbz
MBZ (must be zero) field, byte 0.
Definition jpeg.h:116
uint16_t length
Total length in bytes of the quantization-table data that follows this header (bytes 2....
Definition jpeg.h:127
uint8_t precision
Per-table precision bitmap, byte 1.
Definition jpeg.h:122