libclosedcaption 1.0.3
ISDB-Tb/SBTVD (Brazilian DTV) closed caption extraction from MPEG-TS
Loading...
Searching...
No Matches
caption-management.h File Reference

Reading the "caption management data" and the "caption statement data" (ARIB STD-B24, Volume 3, 9.3). More...

#include "packet-pes.h"
#include "caption-data.h"
#include "caption-common.h"
Include dependency graph for caption-management.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  CaptionManagement_t
 
struct  CaptionManagement_t::statement
 

Macros

TMD: time mode (ARIB STD-B24, Table 9-4, binary values 00 to 11)
#define MANAGEMENT_TMD_FREE   0x00
 
#define MANAGEMENT_TMD_REALTIME   0x01
 
#define MANAGEMENT_TMD_OFFSET   0x02
 
#define MANAGEMENT_TMD_RESERVED   0x03
 
TCS: character encoding (ARIB STD-B24, Table 9-8)
#define MANAGEMENT_TCS_8BIT   0x00
 
#define MANAGEMENT_TCS_UCS   0x01
 
Roll-up mode (ARIB STD-B24, Table 9-9)
#define MANAGEMENT_ROLL_NONE   0x00
 
#define MANAGEMENT_ROLL_UP   0x01
 
data_unit_parameter: type of each data unit (ARIB STD-B24, Table 9-12)
#define _CAPTION_HANDLER_STATEMENT_BODY   0x20
 
#define _CAPTION_HANDLER_GEOMETRIC   0x28
 
#define _CAPTION_HANDLER_SYNTHESIZED_SOUND   0x2c
 
#define _CAPTION_HANDLER_1BYTE_DRCS   0x30
 
#define _CAPTION_HANDLER_2BYTE_DRCS   0x31
 
#define _CAPTION_HANDLER_COLOR_MAP   0x34
 
#define _CAPTION_HANDLER_BITMAP   0x35
 

Typedefs

typedef struct CaptionManagement_t CaptionManagement_t
 

Enumerations

enum  CaptionManagementType_t {
  CAPTION_HANDLER_TYPE_UNKNOWN = 0 , CAPTION_HANDLER_TYPE_STATEMENT_BODY = 1 , CAPTION_HANDLER_TYPE_GEOMETRIC = 2 , CAPTION_HANDLER_TYPE_SYNTHESIZED_SOUND = 3 ,
  CAPTION_HANDLER_TYPE_1BYTE_DRCS = 4 , CAPTION_HANDLER_TYPE_2BYTE_DRCS = 5 , CAPTION_HANDLER_TYPE_COLOR_MAP = 6 , CAPTION_HANDLER_TYPE_BITMAP = 7 ,
  CAPTION_HANDLER_TYPE_MANAGEMENT = 8 , CAPTION_HANDLER_TYPE_MAX = 9
}
 

Functions

bool caption_management_load (const CaptionData_t *caption, CaptionManagement_t *management)
 
bool caption_management_load_unit (const CaptionData_t *caption, unsigned index, CaptionManagement_t *mgmt)
 
CaptionManagementType_t caption_management_get_type (const CaptionManagement_t *management)
 

Detailed Description

Reading the "caption management data" and the "caption statement data" (ARIB STD-B24, Volume 3, 9.3).

Author
Jorge Pereira jpere.nosp@m.iran.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
Date
Thu Aug 12 13:49:21 BRT 2010

The data_group content (see caption-data.h) depends on the data_group_id:

  • caption management data (data_group_id 0x00 or 0x20): time mode (TMD), available languages, display format, character encoding (TCS) and roll-up mode;
  • caption statement data (other values): time mode and the data units with the caption text (statement body), DRCS, bitmaps, etc.

caption_management_load() reads both formats into the same struct, CaptionManagement_t, and caption_management_get_type() tells what was read.

Definition in file caption-management.h.

Macro Definition Documentation

◆ MANAGEMENT_TMD_FREE

#define MANAGEMENT_TMD_FREE   0x00

Free display, no time sync.

Definition at line 32 of file caption-management.h.

◆ MANAGEMENT_TMD_REALTIME

#define MANAGEMENT_TMD_REALTIME   0x01

Real time: the statement data carries the STM.

Definition at line 33 of file caption-management.h.

◆ MANAGEMENT_TMD_OFFSET

#define MANAGEMENT_TMD_OFFSET   0x02

Offset time: management carries the OTM, statement carries the STM.

Definition at line 34 of file caption-management.h.

◆ MANAGEMENT_TMD_RESERVED

#define MANAGEMENT_TMD_RESERVED   0x03

Reserved.

Definition at line 35 of file caption-management.h.

◆ MANAGEMENT_TCS_8BIT

#define MANAGEMENT_TCS_8BIT   0x00

8-bit code (ISO-8859-15 in Brazil).

Definition at line 42 of file caption-management.h.

◆ MANAGEMENT_TCS_UCS

#define MANAGEMENT_TCS_UCS   0x01

UCS (Unicode). Not supported.

Definition at line 43 of file caption-management.h.

◆ MANAGEMENT_ROLL_NONE

#define MANAGEMENT_ROLL_NONE   0x00

No roll-up.

Definition at line 50 of file caption-management.h.

◆ MANAGEMENT_ROLL_UP

#define MANAGEMENT_ROLL_UP   0x01

With roll-up.

Definition at line 51 of file caption-management.h.

◆ _CAPTION_HANDLER_STATEMENT_BODY

#define _CAPTION_HANDLER_STATEMENT_BODY   0x20

Caption text.

Definition at line 58 of file caption-management.h.

◆ _CAPTION_HANDLER_GEOMETRIC

#define _CAPTION_HANDLER_GEOMETRIC   0x28

Geometric graphics.

Definition at line 59 of file caption-management.h.

◆ _CAPTION_HANDLER_SYNTHESIZED_SOUND

#define _CAPTION_HANDLER_SYNTHESIZED_SOUND   0x2c

Synthesized sound.

Definition at line 60 of file caption-management.h.

◆ _CAPTION_HANDLER_1BYTE_DRCS

#define _CAPTION_HANDLER_1BYTE_DRCS   0x30

1-byte DRCS (characters drawn by the broadcaster).

Definition at line 61 of file caption-management.h.

◆ _CAPTION_HANDLER_2BYTE_DRCS

#define _CAPTION_HANDLER_2BYTE_DRCS   0x31

2-byte DRCS.

Definition at line 62 of file caption-management.h.

◆ _CAPTION_HANDLER_COLOR_MAP

#define _CAPTION_HANDLER_COLOR_MAP   0x34

Color map.

Definition at line 63 of file caption-management.h.

◆ _CAPTION_HANDLER_BITMAP

#define _CAPTION_HANDLER_BITMAP   0x35

Bitmap.

Definition at line 64 of file caption-management.h.

Typedef Documentation

◆ CaptionManagement_t

Content of the "caption management data" or the "caption statement data" (ARIB STD-B24, Volume 3, 9.3.1 and 9.3.2).

Enumeration Type Documentation

◆ CaptionManagementType_t

Type of content read by caption_management_load().

Enumerator
CAPTION_HANDLER_TYPE_UNKNOWN 

Data unit of unknown type.

CAPTION_HANDLER_TYPE_STATEMENT_BODY 

Caption text: process it with caption_closed_run().

CAPTION_HANDLER_TYPE_GEOMETRIC 

Geometric graphics.

CAPTION_HANDLER_TYPE_SYNTHESIZED_SOUND 

Synthesized sound.

CAPTION_HANDLER_TYPE_1BYTE_DRCS 

1-byte DRCS.

CAPTION_HANDLER_TYPE_2BYTE_DRCS 

2-byte DRCS.

CAPTION_HANDLER_TYPE_COLOR_MAP 

Color map.

CAPTION_HANDLER_TYPE_BITMAP 

Bitmap.

CAPTION_HANDLER_TYPE_MANAGEMENT 

Caption management data, or statement without data units.

CAPTION_HANDLER_TYPE_MAX 

Number of types.

Definition at line 70 of file caption-management.h.

Function Documentation

◆ caption_management_load()

bool caption_management_load ( const CaptionData_t *  caption,
CaptionManagement_t *  management 
)

Reads the caption management data or the caption statement data of a data_group.

The format is chosen by the data_group_id: 0x00 and 0x20 are read as management, the others as statement. All the sizes are checked against the data_group_size.

Parameters
captiondata_group loaded by caption_data_load().
managementReceives the content. The pointers point inside the PES buffer.
Returns
TRUE if the content was read; FALSE if it is truncated or empty.

◆ caption_management_load_unit()

bool caption_management_load_unit ( const CaptionData_t *  caption,
unsigned  index,
CaptionManagement_t *  mgmt 
)

Same as caption_management_load(), but picks the data unit number index (0 is the first one) of a caption statement data, instead of the preferred one. Use it to walk through all the data units (text, DRCS, bitmap...) of the same data group.

Parameters
captionData group read by caption_data_load().
indexPosition of the data unit in the data unit loop.
mgmtReceives the content, with the chosen data unit in statement.
Returns
TRUE on success, FALSE if the data is invalid, it is a caption management data or there is no data unit at index.

◆ caption_management_get_type()

CaptionManagementType_t caption_management_get_type ( const CaptionManagement_t *  management)

Tells the type of content read by caption_management_load().

Parameters
managementContent read by caption_management_load().
Returns
CAPTION_HANDLER_TYPE_STATEMENT_BODY when there is caption text for caption_closed_run(); CAPTION_HANDLER_TYPE_MANAGEMENT for the caption management data; or the data unit type.