|
libclosedcaption 1.0.3
ISDB-Tb/SBTVD (Brazilian DTV) closed caption extraction from MPEG-TS
|
Reading the caption data_group (ARIB STD-B24, Volume 3, 9.2).
More...


Go to the source code of this file.
Data Structures | |
| struct | CaptionData_t |
Macros | |
| #define | CAPTION_MANAGEMENT_DGI_A 0x00 |
| #define | CAPTION_MANAGEMENT_DGI_B 0x20 |
Typedefs | |
| typedef struct CaptionData_t | CaptionData_t |
Functions | |
| bool | caption_data_check_crc16 (const uint8_t *data, const uint16_t *datalen, const uint16_t *crc16) |
| bool | caption_data_load (const PacketPES_t *pes, CaptionData_t *caption) |
Reading the caption data_group (ARIB STD-B24, Volume 3, 9.2).
Each caption PES carries a data_group:
* data_group_id(6) data_group_version(2) data_group_link_number(8) * last_data_group_link_number(8) data_group_size(16) * data_group_data_byte[data_group_size] CRC_16(16) *
The data_group_id tells the content: 0x00/0x20 is the "caption management
data" (groups A and B) and the others are the "caption statement data" of each language (see caption-management.h).
Definition in file caption-data.h.
| #define CAPTION_MANAGEMENT_DGI_A 0x00 |
data_group_id of the "caption management data", group A.
Definition at line 25 of file caption-data.h.
| #define CAPTION_MANAGEMENT_DGI_B 0x20 |
data_group_id of the "caption management data", group B.
Definition at line 26 of file caption-data.h.
| typedef struct CaptionData_t CaptionData_t |
data_group loaded by caption_data_load().
| bool caption_data_check_crc16 | ( | const uint8_t * | data, |
| const uint16_t * | datalen, | ||
| const uint16_t * | crc16 | ||
| ) |
Checks the CRC-16 of a data_group.
The CRC is the CRC-16/CCITT (polynomial x^16 + x^12 + x^5 + 1, initial value 0), calculated over the whole data_group, from the data_group_id to the last data byte (ARIB STD-B24, Volume 3, 9.2).
| data | Start of the data_group (the data_group_id byte). |
| datalen | Number of bytes of data covered by the CRC (5 of header + data_group_size). |
| crc16 | CRC read from the packet. |
| bool caption_data_load | ( | const PacketPES_t * | pes, |
| CaptionData_t * | caption | ||
| ) |
Loads the data_group of a PES and checks the CRC.
Stuffing bytes after the data_group are ignored.
| pes | PES loaded by packet_pes_load(). |
| caption | Receives the data_group. The pointers point inside the PES buffer. |
data_group is valid and the CRC matches.