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

Reading the header of a caption PES packet. More...

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

Go to the source code of this file.

Data Structures

struct  PES_pts_t
 
struct  PacketPES_s
 
struct  PacketPES_s::header
 
union  PacketPES_s::header::flags
 
struct  PacketPES_s::payload
 

Macros

#define PACKET_PES_PREFIX   0x000001
 
#define PACKET_PES_PRIVATE_STREAM   0xbd
 
PTS_DTS_flags field values
#define PTS_is_NONE   0x00
 
#define PTS_is_FORBIDEN   0x01
 
#define PTS_is_ONLY_PTS   0x02
 
#define PTS_is_BOTH   0x03
 

Typedefs

typedef struct PacketPES_s PacketPES_t
 

Functions

bool packet_pes_load (const uint8_t *pack_raw, const size_t raw_len, PacketPES_t *out)
 
void packet_pes_set_pts (uint32_t *ts, PES_pts_t *pts)
 

Detailed Description

Reading the header of a caption PES packet.

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

ISDB-T captions are carried in PES packets with stream_id 0xBD (private_stream_1), in the "PES data packet" format of ARIB STD-B24, Volume 3, Chapter 5:

* [PES header][data_identifier][private_stream_id][PES_data_packet_header_length][...][data_group]
* 

packet_pes_load() reads the header, the PTS and finds the data_group, which is then processed by caption_data_load().

Definition in file packet-pes.h.

Macro Definition Documentation

◆ PACKET_PES_PREFIX

#define PACKET_PES_PREFIX   0x000001

(24 bits) packet_start_code_prefix.

Definition at line 23 of file packet-pes.h.

◆ PACKET_PES_PRIVATE_STREAM

#define PACKET_PES_PRIVATE_STREAM   0xbd

stream_id of private_stream_1, used by captions.

Definition at line 24 of file packet-pes.h.

◆ PTS_is_NONE

#define PTS_is_NONE   0x00

No PTS and no DTS.

Definition at line 30 of file packet-pes.h.

◆ PTS_is_FORBIDEN

#define PTS_is_FORBIDEN   0x01

Value forbidden by the spec.

Definition at line 31 of file packet-pes.h.

◆ PTS_is_ONLY_PTS

#define PTS_is_ONLY_PTS   0x02

PTS only (Presentation Time Stamp).

Definition at line 32 of file packet-pes.h.

◆ PTS_is_BOTH

#define PTS_is_BOTH   0x03

PTS and DTS (Presentation/Decode Time Stamp).

Definition at line 33 of file packet-pes.h.

Typedef Documentation

◆ PacketPES_t

typedef struct PacketPES_s PacketPES_t

PES packet. See PacketPES_s.

Definition at line 48 of file packet-pes.h.

Function Documentation

◆ packet_pes_load()

bool packet_pes_load ( const uint8_t *  pack_raw,
const size_t  raw_len,
PacketPES_t *  out 
)

Loads the header of a PES packet and finds the data_group.

Parameters
pack_rawWhole PES packet, starting at the packet_start_code_prefix (00 00 01).
raw_lenSize of pack_raw in bytes.
outReceives the loaded packet. The payload pointers point inside pack_raw.
Returns
TRUE if the packet is a valid PES with data.

◆ packet_pes_set_pts()

void packet_pes_set_pts ( uint32_t *  ts,
PES_pts_t *  pts 
)

Converts a PTS in 90 kHz units to hours, minutes and seconds.

Parameters
tsPTS in 90 kHz units.
ptsReceives the converted PTS; pts->ts gets ts itself.