|
TB2026-YDS Firmware
|
Internal MPEG-1/2 Layer III header + VBR-tag (Xing/Info/VBRI) parsing. More...
#include <stdint.h>#include <stdbool.h>#include <stddef.h>Go to the source code of this file.
Data Structures | |
| struct | mp3_frame_hdr_t |
| Decoded fields of one MPEG Layer III frame header. More... | |
Functions | |
| bool | mp3_frame_parse (const uint8_t *p, size_t len, mp3_frame_hdr_t *out) |
Parse a 4-byte MPEG Layer III frame header at p. | |
| uint32_t | mp3_xing_duration_ms (const uint8_t *frame, size_t len, const mp3_frame_hdr_t *hdr) |
| Track duration from a Xing/Info/VBRI tag in the first frame, if present. | |
Internal MPEG-1/2 Layer III header + VBR-tag (Xing/Info/VBRI) parsing.
Not a public header: shared by the MP3 decoder backend (decoder_mp3.c, for the playing stream's duration) and the track-metadata reader (track_meta.c, for bitrate + duration). Pure byte math with no ESP-IDF or libhelix dependency, so the duration logic lives in one place and is host-testable on its own.
| bool mp3_frame_parse | ( | const uint8_t * | p, |
| size_t | len, | ||
| mp3_frame_hdr_t * | out ) |
Parse a 4-byte MPEG Layer III frame header at p.
| p | Candidate frame start (the 0xFF sync byte). |
| len | Bytes readable from p (must be >= 4). |
| out | Filled on success. |
p holds a valid Layer III header; false otherwise. | uint32_t mp3_xing_duration_ms | ( | const uint8_t * | frame, |
| size_t | len, | ||
| const mp3_frame_hdr_t * | hdr ) |
Track duration from a Xing/Info/VBRI tag in the first frame, if present.
| frame | First frame start (its 0xFF sync byte). |
| len | Bytes readable from frame. |
| hdr | Header already parsed by mp3_frame_parse() for frame. |