An RTP/JPEG XS data transport.
More...
#include <smolrtsp/droppable.h>
#include <smolrtsp/jpegxs.h>
#include <smolrtsp/rtp_transport.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <slice99.h>
#include <smolrtsp/priv/compiler_attrs.h>
Go to the source code of this file.
|
|
SmolRTSP_JpegXsTransportConfig | SmolRTSP_JpegXsTransportConfig_default (void) SMOLRTSP_PRIV_MUST_USE |
| | Returns the default SmolRTSP_JpegXsTransportConfig: codestream packetization mode, T=1, and SMOLRTSP_MAX_JPEGXS_PACKET_SIZE.
|
| |
| SmolRTSP_JpegXsTransport * | SmolRTSP_JpegXsTransport_new (SmolRTSP_RtpTransport *t) SMOLRTSP_PRIV_MUST_USE |
| | Creates a new RTP/JPEG XS transport with the default configuration.
|
| |
| SmolRTSP_JpegXsTransport * | SmolRTSP_JpegXsTransport_new_with_config (SmolRTSP_RtpTransport *t, SmolRTSP_JpegXsTransportConfig config) SMOLRTSP_PRIV_MUST_USE |
| | Creates a new RTP/JPEG XS transport with a custom configuration.
|
| |
| int | SmolRTSP_JpegXsTransport_send_codestream (SmolRTSP_JpegXsTransport *self, SmolRTSP_RtpTimestamp ts, SmolRTSP_JpegXsInterlace interlace, bool is_frame_end, U8Slice99 codestream) SMOLRTSP_PRIV_MUST_USE |
| | Sends a JPEG XS packetization unit in codestream mode (K=0).
|
| |
| int | SmolRTSP_JpegXsTransport_send_header_segment (SmolRTSP_JpegXsTransport *self, SmolRTSP_RtpTimestamp ts, SmolRTSP_JpegXsInterlace interlace, U8Slice99 header_segment) SMOLRTSP_PRIV_MUST_USE |
| | Sends the header-segment packetization unit in slice mode (K=1).
|
| |
| int | SmolRTSP_JpegXsTransport_send_slice (SmolRTSP_JpegXsTransport *self, SmolRTSP_RtpTimestamp ts, SmolRTSP_JpegXsInterlace interlace, uint16_t slice_index, bool is_frame_end, U8Slice99 slice) SMOLRTSP_PRIV_MUST_USE |
| | Sends a single slice as its own packetization unit in slice mode (K=1).
|
| |
| | declImplExtern99 (SmolRTSP_Droppable, SmolRTSP_JpegXsTransport) |
| | Implements SmolRTSP_Droppable_IFACE for SmolRTSP_JpegXsTransport.
|
| |
|
bool | SmolRTSP_JpegXsTransport_is_full (SmolRTSP_JpegXsTransport *self) |
| |
An RTP/JPEG XS data transport.
- See also
- RTP Payload Format for ISO/IEC 21122 (JPEG XS): https://datatracker.ietf.org/doc/html/rfc9134
◆ SMOLRTSP_MAX_JPEGXS_PACKET_SIZE
| #define SMOLRTSP_MAX_JPEGXS_PACKET_SIZE 1200 |
The default value for SmolRTSP_JpegXsTransportConfig.max_packet_size.
The limit includes the 4-byte JPEG XS payload header: the codestream chunk per RTP packet is at most max_packet_size - SMOLRTSP_JPEGXS_PAYLOAD_HEADER_SIZE bytes.
◆ declImplExtern99()
◆ SmolRTSP_JpegXsTransport_new()
Creates a new RTP/JPEG XS transport with the default configuration.
- Parameters
-
| [in] | t | The underlying RTP transport. |
- Precondition
t != NULL.
◆ SmolRTSP_JpegXsTransport_new_with_config()
Creates a new RTP/JPEG XS transport with a custom configuration.
- Parameters
-
| [in] | t | The underlying RTP transport. |
| [in] | config | The transmission configuration structure. |
- Precondition
t != NULL.
-
config.max_packet_size > SMOLRTSP_JPEGXS_PAYLOAD_HEADER_SIZE.
-
config.sequential is true when config.pack_mode is SMOLRTSP_JPEGXS_PACK_CODESTREAM (RFC 9134 §4.3).
◆ SmolRTSP_JpegXsTransport_send_codestream()
Sends a JPEG XS packetization unit in codestream mode (K=0).
One call corresponds to one packetization unit: an entire progressive frame, or a single field of an interlaced frame. The library splits codestream across as many RTP packets as needed and builds the RFC 9134 §4.3 payload header per packet. The L bit is set on the final packet of the unit; the RTP marker bit is set only when is_frame_end is true and on that same final packet. The internal frame counter is post-incremented after a successful send with is_frame_end true.
- Parameters
-
| [in] | self | The transport. |
| [in] | ts | The RTP timestamp shared by every packet of the unit. |
| [in] | interlace | The interlaced-information field. |
| [in] | is_frame_end | true iff this packetization unit ends the current frame – always true for a progressive frame, true only on SMOLRTSP_JPEGXS_INTERLACE_FIELD_2 for an interlaced frame. |
| [in] | codestream | The codestream bytes for this unit. |
- Precondition
self != NULL.
-
The configured pack mode is SMOLRTSP_JPEGXS_PACK_CODESTREAM.
- Returns
- 0 on success; -1 on I/O error (with
errno set).
◆ SmolRTSP_JpegXsTransport_send_header_segment()
Sends the header-segment packetization unit in slice mode (K=1).
The unit carries the VS box, CS box, and codestream-header segment; every packet emitted by this call has SEP set to SMOLRTSP_JPEGXS_SEP_HEADER_SEGMENT. The RTP marker bit is never set.
- Parameters
-
| [in] | self | The transport. |
| [in] | ts | The RTP timestamp shared by every packet of the unit. |
| [in] | interlace | The interlaced-information field. |
| [in] | header_segment | The header-segment bytes. |
- Precondition
self != NULL.
-
The configured pack mode is SMOLRTSP_JPEGXS_PACK_SLICE.
- Returns
- 0 on success; -1 on I/O error (with
errno set).
◆ SmolRTSP_JpegXsTransport_send_slice()
Sends a single slice as its own packetization unit in slice mode (K=1).
- Parameters
-
| [in] | self | The transport. |
| [in] | ts | The RTP timestamp shared by every packet of the slice. |
| [in] | interlace | The interlaced-information field. |
| [in] | slice_index | The slice index in [0, 0x7FE]. (0x7FF is reserved for the header segment.) Placed in the SEP field. |
| [in] | is_frame_end | true iff this slice ends the current frame – the RTP marker bit fires on the slice's final packet. For interlaced frames this should be true only on the last slice of SMOLRTSP_JPEGXS_INTERLACE_FIELD_2. |
| [in] | slice | The slice bytes. |
- Precondition
self != NULL.
-
The configured pack mode is SMOLRTSP_JPEGXS_PACK_SLICE.
-
slice_index < SMOLRTSP_JPEGXS_SEP_HEADER_SEGMENT.
- Returns
- 0 on success; -1 on I/O error (with
errno set).