vdr  2.0.2
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
cH264Parser Class Reference

Public Member Functions

 cH264Parser (void)
 
virtual int Parse (const uchar *Data, int Length, int Pid)
 
- Public Member Functions inherited from cFrameParser
 cFrameParser (void)
 
virtual ~cFrameParser ()
 
void SetDebug (bool Debug)
 
bool NewFrame (void)
 
bool IndependentFrame (void)
 

Private Types

enum  eNalUnitType { nutCodedSliceNonIdr = 1, nutCodedSliceIdr = 5, nutSequenceParameterSet = 7, nutAccessUnitDelimiter = 9 }
 

Private Member Functions

uchar GetByte (bool Raw=false)
 
uchar GetBit (void)
 
uint32_t GetBits (int Bits)
 
uint32_t GetGolombUe (void)
 
int32_t GetGolombSe (void)
 
void ParseAccessUnitDelimiter (void)
 
void ParseSequenceParameterSet (void)
 
void ParseSliceHeader (void)
 

Private Attributes

cTsPayload tsPayload
 
uchar byte
 
int bit
 
int zeroBytes
 
uint32_t scanner
 
bool separate_colour_plane_flag
 
int log2_max_frame_num
 
bool frame_mbs_only_flag
 
bool gotAccessUnitDelimiter
 
bool gotSequenceParameterSet
 

Additional Inherited Members

- Protected Attributes inherited from cFrameParser
bool debug
 
bool newFrame
 
bool independentFrame
 

Detailed Description

Definition at line 1204 of file remux.c.

Member Enumeration Documentation

Enumerator
nutCodedSliceNonIdr 
nutCodedSliceIdr 
nutSequenceParameterSet 
nutAccessUnitDelimiter 

Definition at line 1206 of file remux.c.

Constructor & Destructor Documentation

cH264Parser::cH264Parser ( void  )

Sets up a new H.264 parser.

This class parses only the data absolutely necessary to determine the frame borders and field count of the given H264 material.

Definition at line 1243 of file remux.c.

References bit, byte, EMPTY_SCANNER, frame_mbs_only_flag, gotAccessUnitDelimiter, gotSequenceParameterSet, log2_max_frame_num, scanner, separate_colour_plane_flag, and zeroBytes.

Member Function Documentation

uchar cH264Parser::GetBit ( void  )
private

Definition at line 1275 of file remux.c.

References bit, byte, and GetByte().

Referenced by GetBits(), GetGolombUe(), ParseSequenceParameterSet(), and ParseSliceHeader().

uint32_t cH264Parser::GetBits ( int  Bits)
private

Definition at line 1284 of file remux.c.

References GetBit().

Referenced by GetGolombUe(), and ParseSliceHeader().

uchar cH264Parser::GetByte ( bool  Raw = false)
private

Gets the next data byte.

If Raw is true, no filtering will be done. With Raw set to false, if the byte sequence 0x000003 is encountered, the byte with 0x03 will be skipped.

Definition at line 1256 of file remux.c.

References bit, cTsPayload::GetByte(), tsPayload, and zeroBytes.

Referenced by GetBit(), Parse(), ParseAccessUnitDelimiter(), and ParseSequenceParameterSet().

int32_t cH264Parser::GetGolombSe ( void  )
private

Definition at line 1300 of file remux.c.

References GetGolombUe().

Referenced by ParseSequenceParameterSet().

uint32_t cH264Parser::GetGolombUe ( void  )
private

Definition at line 1292 of file remux.c.

References GetBit(), and GetBits().

Referenced by GetGolombSe(), ParseSequenceParameterSet(), and ParseSliceHeader().

int cH264Parser::Parse ( const uchar Data,
int  Length,
int  Pid 
)
virtual

Parses the given Data, which is a sequence of Length bytes of TS packets.

The payload in the TS packets with the given Pid is searched for just enough information to determine the beginning and type of the next video frame. Returns the number of bytes parsed. Upon return, the functions NewFrame() and IndependentFrame() can be called to retrieve the required information.

Implements cFrameParser.

Definition at line 1312 of file remux.c.

References cTsPayload::AtPayloadStart(), cTsPayload::AtTsStart(), cTsPayload::Available(), dbgframes, cFrameParser::debug, EMPTY_SCANNER, GetByte(), gotAccessUnitDelimiter, gotSequenceParameterSet, cFrameParser::independentFrame, MIN_TS_PACKETS_FOR_FRAME_DETECTOR, cFrameParser::newFrame, nutAccessUnitDelimiter, nutCodedSliceIdr, nutCodedSliceNonIdr, nutSequenceParameterSet, ParseAccessUnitDelimiter(), ParseSequenceParameterSet(), ParseSliceHeader(), scanner, cTsPayload::Setup(), cTsPayload::SkipPesHeader(), TS_SIZE, tsPayload, TsPayloadStart(), and cTsPayload::Used().

void cH264Parser::ParseAccessUnitDelimiter ( void  )
private

Definition at line 1352 of file remux.c.

References dbgframes, cFrameParser::debug, GetByte(), and gotSequenceParameterSet.

Referenced by Parse().

void cH264Parser::ParseSequenceParameterSet ( void  )
private
void cH264Parser::ParseSliceHeader ( void  )
private

Member Data Documentation

int cH264Parser::bit
private

Definition at line 1214 of file remux.c.

Referenced by cH264Parser(), GetBit(), and GetByte().

uchar cH264Parser::byte
private

Definition at line 1213 of file remux.c.

Referenced by cH264Parser(), and GetBit().

bool cH264Parser::frame_mbs_only_flag
private

Definition at line 1220 of file remux.c.

Referenced by cH264Parser(), ParseSequenceParameterSet(), and ParseSliceHeader().

bool cH264Parser::gotAccessUnitDelimiter
private

Definition at line 1222 of file remux.c.

Referenced by cH264Parser(), Parse(), and ParseSequenceParameterSet().

bool cH264Parser::gotSequenceParameterSet
private

Definition at line 1223 of file remux.c.

Referenced by cH264Parser(), Parse(), ParseAccessUnitDelimiter(), and ParseSequenceParameterSet().

int cH264Parser::log2_max_frame_num
private

Definition at line 1219 of file remux.c.

Referenced by cH264Parser(), ParseSequenceParameterSet(), and ParseSliceHeader().

uint32_t cH264Parser::scanner
private

Definition at line 1216 of file remux.c.

Referenced by cH264Parser(), and Parse().

bool cH264Parser::separate_colour_plane_flag
private

Definition at line 1218 of file remux.c.

Referenced by cH264Parser(), ParseSequenceParameterSet(), and ParseSliceHeader().

cTsPayload cH264Parser::tsPayload
private

Definition at line 1212 of file remux.c.

Referenced by GetByte(), and Parse().

int cH264Parser::zeroBytes
private

Definition at line 1215 of file remux.c.

Referenced by cH264Parser(), and GetByte().


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