|
libclosedcaption 1.0.3
ISDB-Tb/SBTVD (Brazilian DTV) closed caption extraction from MPEG-TS
|
Registering the callbacks (hooks) that get the text and the caption commands while caption_closed_run() runs. More...


Go to the source code of this file.
Typedefs | |
| typedef void(* | CaptionHookingControls_t) (CaptionClosed_t *cc, const uint8_t cmd) |
| typedef void(* | CaptionHookingString_t) (CaptionClosed_t *cc, const char *string, const uint8_t len) |
Functions | |
| void | caption_hooking_set_controls (CaptionHookingControls_t callback) |
| void | caption_hooking_set_string (CaptionHookingString_t callback) |
Registering the callbacks (hooks) that get the text and the caption commands while caption_closed_run() runs.
During caption_closed_run(), each text character is converted to UTF-8 and handed to the text hook, and each recognized C0/C1 control command is handed to the controls hook.
Example:
Definition in file caption-hooking.h.
| typedef void(* CaptionHookingControls_t) (CaptionClosed_t *cc, const uint8_t cmd) |
Hook called for each recognized control command.
| cc | Caption state, already updated by the command. |
| cmd | Command code: C0 (CaptionClosed_CtrlCodes_C0), C1 (CaptionClosed_CtrlCodes_C1) or, for the CSI, the code of the subcommand (CaptionClosed_CtrlCodes_C1_CSI). |
Definition at line 50 of file caption-hooking.h.
| typedef void(* CaptionHookingString_t) (CaptionClosed_t *cc, const char *string, const uint8_t len) |
Hook called for each text character.
| cc | Caption state (colors, size, position) at the time of the character. |
| string | UTF-8 character. Not '\0' terminated. |
| len | Number of bytes in string (1 to 3). |
Definition at line 60 of file caption-hooking.h.
| void caption_hooking_set_controls | ( | CaptionHookingControls_t | callback | ) |
Registers the control commands hook (C0/C1).
| callback | The hook, or NULL to turn it off. |
| void caption_hooking_set_string | ( | CaptionHookingString_t | callback | ) |
Registers the text hook.
| callback | The hook, or NULL to turn it off. |