Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CH264CCBitstreamParser Class Reference

Base class for H.264 closed caption bitstream parsers. More...

#include <H264CCBitstreamParser.h>

Inheritance diagram for CH264CCBitstreamParser:
ICCBitstreamParser CH264AVCCBitstreamParser CH264AnnexBBitstreamParser

Protected Member Functions

void ProcessSEIPayload (std::span< const uint8_t > buf, double pts, std::vector< CCaptionBlock > &tempBuffer)
 Process SEI payload containing closed caption data.
 
CCPictureType DetectSliceType (std::span< const uint8_t > buf)
 Detect slice type from H.264 slice header.
 

Additional Inherited Members

- Public Member Functions inherited from ICCBitstreamParser
virtual ~ICCBitstreamParser ()=default
 
virtual CCPictureType ParsePacket (DemuxPacket *pPacket, std::vector< CCaptionBlock > &tempBuffer, std::vector< CCaptionBlock > &reorderBuffer)=0
 Parse a video packet and extract closed caption data.
 
virtual const char * GetName () const =0
 Get parser name for debugging/logging.
 

Detailed Description

Base class for H.264 closed caption bitstream parsers.

Provides shared functionality for parsing H.264 SEI (Supplemental Enhancement Information) payloads containing CEA-608/708 closed caption data.

H.264 CC data is embedded in SEI NAL units (type 6) with payload type 4 (user_data_registered_itu_t_t35). The data may be prefixed with ITU-T T.35 country/provider codes or contain GA94 data directly.

Member Function Documentation

◆ DetectSliceType()

CCPictureType CH264CCBitstreamParser::DetectSliceType ( std::span< const uint8_t > buf)
protected

Detect slice type from H.264 slice header.

Parses the slice header to determine if this is an I-slice, P-slice, or B-slice. Used to determine when to decode CC data (I/P frames only).

Parameters
bufPointer to slice NAL unit data (after NAL header)
lenLength of slice data
Returns
Picture type (I_FRAME, P_FRAME, OTHER, or INVALID if parsing fails)

◆ ProcessSEIPayload()

void CH264CCBitstreamParser::ProcessSEIPayload ( std::span< const uint8_t > buf,
double pts,
std::vector< CCaptionBlock > & tempBuffer )
protected

Process SEI payload containing closed caption data.

Searches for GA94 closed caption payload within SEI user data. Handles both:

  • ITU-T T.35 format: country_code(1) + provider_code(2) + 'GA94'...
  • Direct GA94 format: 'GA94'...
Parameters
bufPointer to SEI payload data
lenLength of SEI payload
ptsPresentation timestamp for CC data
tempBufferTemporary buffer for CC data (for reordering)

The documentation for this class was generated from the following files: