56#ifndef DEBUG_CLOSEDCAPTION
57# define Dump_CaptionClosed_t(cc)
58# define Dump_CaptionManagement_t(m)
64# define Dump_CaptionClosed_t(cc) __Dump_CaptionClosed_t(__FILE__, __LINE__, __func__, cc)
69# define Dump_CaptionManagement_t(m) __Dump_CaptionManagement_t(__FILE__, __LINE__, __func__, m)
72static inline const char *
73__Dump_basename (
const char *path)
75 const char *file = strrchr (path,
'/');
77 return (file != NULL) ? (file + 1) : path;
81__Dump_CaptionManagement_t (
const char *file,
86#define get_data(x) ((m->statement.unit_size > (x)) ? m->statement.unit_data[x] : 0x00)
88 uint32_t iso_639_lang = (l[0] << 16 | l[1] << 8 | l[2]);
90 printf (
"<Dump_CaptionManagement_t() from %s:%u in %s()>\n"
91 " struct CaptionManagement_t {\n"
94 " reserved = %d (0x%02x),\n"
95 " num_lang = %d (0x%02x),\n"
98 " ISO_639_lang_code = '%s' (0x%06x),\n"
101 " rollup_mode = 0x%02x\n"
102 " struct statement {\n"
103 " unit_sep = %d (0x%02x)\n"
104 " unit_param = %d (0x%02x)\n"
105 " unit_size = %u (0x%06x),\n"
106 " unit_data = { [0]='0x%02x', [1]='0x%02x', [2]='0x%02x', [3]='0x%02x', ... },\n"
109 "<Dump_CaptionManagement_t>\n",
110 __Dump_basename (file), line, func,
111 m->TMD, (
unsigned long long)m->TMD_otm, m->reserved, m->reserved, m->num_lang, m->num_lang, m->DMF,
112 m->DC, m->ISO_639_lang_code, iso_639_lang, m->format, m->TCS, m->rollup_mode,
113 m->statement.unit_sep, m->statement.unit_sep,
114 m->statement.unit_param, m->statement.unit_param,
115 m->statement.unit_size, m->statement.unit_size,
116 get_data(0), get_data(1), get_data(2), get_data(3)
122__Dump_CaptionClosed_t (
const char *file,
127 printf (
"<Dump_CaptionClosed_t() from %s:%u in %s()>\n"
128 " struct CaptionClosed_t {\n"
129 " CLS { need_clear = %s },\n"
131 " format = %d (0x%02x)\n"
132 " char_size = %d (0x%02x)\n"
133 " char_number_in_oneline = %d (0x%02x)\n"
134 " char_line_number = %d (0x%02x)\n"
136 " struct SDF { width='%d' (0x%04x), height='%d' (0x%04x) };\n"
137 " struct SDP { width='%d' (0x%04x), height='%d' (0x%04x) };\n"
138 " struct SSM { width='%d' (0x%04x), height='%d' (0x%04x) };\n"
139 " struct APS { first='%d' (0x%02x), second='%d' (0x%02x) };\n"
140 " CC_Rcs_t RCS = %d,\n"
141 " SHS = %d (0x%02x),\n"
142 " SVS = %d (0x%02x),\n"
143 " CC_Color_t::foreground = { r=0x%02x, g=0x%02x, b=0x%02x, a=0x%02x },\n"
144 " CC_Color_t::background = { r=0x%02x, g=0x%02x, b=0x%02x, a=0x%02x },\n"
145 " CC_Color_t::half_background = { r=0x%02x, g=0x%02x, b=0x%02x, a=0x%02x },\n"
146 " CC_Color_t::half_foreground = { r=0x%02x, g=0x%02x, b=0x%02x, a=0x%02x },\n"
148 __Dump_basename (file), line, func,
150 cc->format, cc->format,
151 cc->char_size, cc->char_size,
152 cc->char_number_in_oneline, cc->char_number_in_oneline,
153 cc->char_line_number, cc->char_line_number,
154 cc->SDF.width, cc->SDF.width, cc->SDF.height, cc->SDF.height,
155 cc->SDP.width, cc->SDP.width, cc->SDP.height, cc->SDP.height,
156 cc->SSM.width, cc->SSM.width, cc->SSM.height, cc->SSM.height,
157 cc->APS.first, cc->APS.first, cc->APS.second, cc->APS.second,
158 cc->RCS, cc->SHS, cc->SHS, cc->SVS, cc->SVS,
159 cc->foreground.r, cc->foreground.g, cc->foreground.b, cc->foreground.a,
160 cc->background.r, cc->background.g, cc->background.b, cc->background.a,
161 cc->half_background.r, cc->half_background.g, cc->half_background.b, cc->half_background.a,
162 cc->half_foreground.r, cc->half_foreground.g, cc->half_foreground.b, cc->half_foreground.a);
166 printf (
" struct pts {\n"
167 " h=%d, m=%d, s=%d, u=%d, ts=%u // [90 kHz-Timestamp: %d:%02d:%02d.%04d]\n"
173 printf (
" struct pts {\n indisponível\n };\n");
176 printf (
"</Dump_CaptionClosed_t()>\n");
C0, C1 and CSI control commands of the caption text.
Interpreting the caption (closed caption) text and its state: colors, character size,...
Standard headers and helper macros used all over the library.
Reading the caption data_group (ARIB STD-B24, Volume 3, 9.2).
Registering the callbacks (hooks) that get the text and the caption commands while caption_closed_run...
Reading the "caption management data" and the "caption statement data" (ARIB STD-B24,...
Turns the caption PES packets into lines of text.
1-byte DRCS (characters drawn by the broadcaster) data unit.
2-byte DRCS (characters drawn by the broadcaster) data unit.
Bitmap data unit (a PNG image with position and flashing colors).
Color map data unit. Not implemented.
Geometric graphics data unit, split into commands.
Synthesized sound data unit.
Library version (semver, same as the VERSION file).
Reading the header of a caption PES packet.
char ISO_639_lang_code[3+1]
MPEG-TS demuxer: PAT/PMT tables, per PID stats and reassembly of the PES packets of one PID.
Reading MPEG-TS files, packet by packet.