MythTV  master
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
H2645Parser Class Referenceabstract

#include <H2645Parser.h>

Inheritance diagram for H2645Parser:
Inheritance graph
[legend]
Collaboration diagram for H2645Parser:
Collaboration graph
[legend]

Public Types

enum  field_type { FRAME = 'F', FIELD_TOP = 'T', FIELD_BOTTOM = 'B' }
 
enum  NAL_unit_type { UNKNOWN = -1 }
 
enum  SLICE_type {
  SLICE_P = 0, SLICE_B = 1, SLICE_I = 2, SLICE_SP = 3,
  SLICE_SI = 4, SLICE_P_a = 5, SLICE_B_a = 6, SLICE_I_a = 7,
  SLICE_SP_a = 8, SLICE_SI_a = 9, SLICE_UNDEF = 10
}
 

Public Member Functions

 H2645Parser (void)
 
 H2645Parser (const H2645Parser &rhs)
 
virtual ~H2645Parser (void)
 
virtual uint32_t addBytes (const uint8_t *bytes, uint32_t byte_count, uint64_t stream_offset)=0
 
virtual void Reset (void)
 
virtual QString NAL_type_str (int8_t type)=0
 
bool stateChanged (void) const
 
bool onFrameStart (void) const
 
bool onKeyFrameStart (void) const
 
uint pictureWidth (void) const
 
uint pictureHeight (void) const
 
virtual uint pictureWidthCropped (void) const =0
 
virtual uint pictureHeightCropped (void) const =0
 
uint aspectRatio (void) const
 Computes aspect ratio from picture size and sample aspect ratio. More...
 
virtual void getFrameRate (FrameRate &result) const =0
 
virtual field_type getFieldType (void) const =0
 
uint64_t frameAUstreamOffset (void) const
 
uint64_t keyframeAUstreamOffset (void) const
 
uint64_t SPSstreamOffset (void) const
 
uint32_t GetTimeScale (void) const
 
uint32_t GetUnitsInTick (void) const
 
SCAN_t GetScanType (void) const
 

Static Public Attributes

static constexpr uint16_t MAX_SLICE_HEADER_SIZE { 256 }
 

Protected Member Functions

void resetRBSP (void)
 
bool fillRBSP (const uint8_t *byteP, uint32_t byte_count, bool found_start_code)
 
void vui_parameters (BitReader &br, bool hevc)
 

Protected Attributes

uint64_t m_framecnt {0}
 
uint64_t m_keyframecnt {0}
 
uint64_t m_totalframecnt {0}
 
uint64_t m_totalkeyframecnt {0}
 
uint64_t m_auOffset {0}
 
uint64_t m_frameStartOffset {0}
 
uint64_t m_keyframeStartOffset {0}
 
uint64_t m_pktOffset {0}
 
uint64_t m_spsOffset {0}
 
uint32_t m_consecutiveZeros {0}
 
uint32_t m_rbspBufferSize {188 * 2}
 
uint32_t m_rbspIndex {0}
 
uint32_t m_syncAccumulator {0xffffffff}
 
uint32_t m_timeScale {0}
 
uint32_t m_unitsInTick {0}
 
SCAN_t m_scanType {SCAN_t::UNKNOWN_SCAN}
 
uint m_frameCropBottomOffset {0}
 
uint m_frameCropLeftOffset {0}
 
uint m_frameCropRightOffset {0}
 
uint m_frameCropTopOffset {0}
 
uint m_picHeight {0}
 
uint m_picWidth {0}
 
uint m_sarHeight {0}
 
uint m_sarWidth {0}
 
uint8_t * m_rbspBuffer {nullptr}
 
uint8_t m_aspectRatioIdc {0}
 
int8_t m_chromaFormatIdc {1}
 
bool m_auPending {false}
 
bool m_fixedRate {false}
 
bool m_haveUnfinishedNAL {false}
 
bool m_isKeyframe {false}
 
bool m_onAU {false}
 
bool m_onFrame {false}
 
bool m_onKeyFrame {false}
 
bool m_seenSPS {false}
 
bool m_separateColourPlaneFlag {false}
 
bool m_stateChanged {false}
 

Static Protected Attributes

static constexpr uint8_t EXTENDED_SAR { 255 }
 

Detailed Description

Definition at line 39 of file H2645Parser.h.

Member Enumeration Documentation

◆ field_type

Enumerator
FRAME 
FIELD_TOP 
FIELD_BOTTOM 

Definition at line 43 of file H2645Parser.h.

◆ NAL_unit_type

Enumerator
UNKNOWN 

Definition at line 84 of file H2645Parser.h.

◆ SLICE_type

Enumerator
SLICE_P 
SLICE_B 
SLICE_I 
SLICE_SP 
SLICE_SI 
SLICE_P_a 
SLICE_B_a 
SLICE_I_a 
SLICE_SP_a 
SLICE_SI_a 
SLICE_UNDEF 

Definition at line 88 of file H2645Parser.h.

Constructor & Destructor Documentation

◆ H2645Parser() [1/2]

H2645Parser::H2645Parser ( void  )

Definition at line 86 of file H2645Parser.cpp.

◆ H2645Parser() [2/2]

H2645Parser::H2645Parser ( const H2645Parser rhs)

◆ ~H2645Parser()

virtual H2645Parser::~H2645Parser ( void  )
inlinevirtual

Definition at line 51 of file H2645Parser.h.

Member Function Documentation

◆ addBytes()

virtual uint32_t H2645Parser::addBytes ( const uint8_t *  bytes,
uint32_t  byte_count,
uint64_t  stream_offset 
)
pure virtual

Implemented in HEVCParser, and AVCParser.

Referenced by DTVRecorder::FindH2645Keyframes().

◆ Reset()

void H2645Parser::Reset ( void  )
virtual

◆ NAL_type_str()

virtual QString H2645Parser::NAL_type_str ( int8_t  type)
pure virtual

Implemented in HEVCParser, and AVCParser.

◆ stateChanged()

bool H2645Parser::stateChanged ( void  ) const
inline

◆ onFrameStart()

bool H2645Parser::onFrameStart ( void  ) const
inline

◆ onKeyFrameStart()

bool H2645Parser::onKeyFrameStart ( void  ) const
inline

◆ pictureWidth()

uint H2645Parser::pictureWidth ( void  ) const
inline

Definition at line 65 of file H2645Parser.h.

Referenced by DTVRecorder::FindH2645Keyframes().

◆ pictureHeight()

uint H2645Parser::pictureHeight ( void  ) const
inline

Definition at line 66 of file H2645Parser.h.

Referenced by DTVRecorder::FindH2645Keyframes().

◆ pictureWidthCropped()

virtual uint H2645Parser::pictureWidthCropped ( void  ) const
pure virtual

Implemented in HEVCParser, and AVCParser.

Referenced by aspectRatio().

◆ pictureHeightCropped()

virtual uint H2645Parser::pictureHeightCropped ( void  ) const
pure virtual

Implemented in HEVCParser, and AVCParser.

Referenced by aspectRatio().

◆ aspectRatio()

uint H2645Parser::aspectRatio ( void  ) const

Computes aspect ratio from picture size and sample aspect ratio.

Definition at line 386 of file H2645Parser.cpp.

Referenced by DTVRecorder::FindH2645Keyframes().

◆ getFrameRate()

virtual void H2645Parser::getFrameRate ( FrameRate result) const
pure virtual

Implemented in HEVCParser, and AVCParser.

Referenced by DTVRecorder::FindH2645Keyframes().

◆ getFieldType()

virtual field_type H2645Parser::getFieldType ( void  ) const
pure virtual

Implemented in HEVCParser, and AVCParser.

Referenced by DTVRecorder::FindH2645Keyframes().

◆ frameAUstreamOffset()

uint64_t H2645Parser::frameAUstreamOffset ( void  ) const
inline

Definition at line 76 of file H2645Parser.h.

◆ keyframeAUstreamOffset()

uint64_t H2645Parser::keyframeAUstreamOffset ( void  ) const
inline

◆ SPSstreamOffset()

uint64_t H2645Parser::SPSstreamOffset ( void  ) const
inline

Definition at line 78 of file H2645Parser.h.

◆ GetTimeScale()

uint32_t H2645Parser::GetTimeScale ( void  ) const
inline

Definition at line 80 of file H2645Parser.h.

Referenced by DTVRecorder::FindH2645Keyframes().

◆ GetUnitsInTick()

uint32_t H2645Parser::GetUnitsInTick ( void  ) const
inline

Definition at line 81 of file H2645Parser.h.

Referenced by DTVRecorder::FindH2645Keyframes().

◆ GetScanType()

SCAN_t H2645Parser::GetScanType ( void  ) const
inline

Definition at line 82 of file H2645Parser.h.

Referenced by DTVRecorder::FindH2645Keyframes().

◆ resetRBSP()

void H2645Parser::resetRBSP ( void  )
protected

Definition at line 127 of file H2645Parser.cpp.

Referenced by AVCParser::addBytes(), HEVCParser::addBytes(), and AVCParser::Reset().

◆ fillRBSP()

bool H2645Parser::fillRBSP ( const uint8_t *  byteP,
uint32_t  byte_count,
bool  found_start_code 
)
protected

Definition at line 134 of file H2645Parser.cpp.

Referenced by AVCParser::addBytes(), and HEVCParser::addBytes().

◆ vui_parameters()

void H2645Parser::vui_parameters ( BitReader br,
bool  hevc 
)
protected

Definition at line 215 of file H2645Parser.cpp.

Referenced by AVCParser::decode_SPS(), and HEVCParser::parseSPS().

Member Data Documentation

◆ MAX_SLICE_HEADER_SIZE

constexpr uint16_t H2645Parser::MAX_SLICE_HEADER_SIZE { 256 }
staticconstexpr

Definition at line 41 of file H2645Parser.h.

Referenced by AVCParser::processRBSP().

◆ EXTENDED_SAR

constexpr uint8_t H2645Parser::EXTENDED_SAR { 255 }
staticconstexprprotected

Definition at line 103 of file H2645Parser.h.

Referenced by aspectRatio(), and vui_parameters().

◆ m_framecnt

uint64_t H2645Parser::m_framecnt {0}
protected

Definition at line 111 of file H2645Parser.h.

Referenced by HEVCParser::addBytes(), and HEVCParser::processRBSP().

◆ m_keyframecnt

uint64_t H2645Parser::m_keyframecnt {0}
protected

Definition at line 112 of file H2645Parser.h.

Referenced by HEVCParser::addBytes(), and HEVCParser::processRBSP().

◆ m_totalframecnt

uint64_t H2645Parser::m_totalframecnt {0}
protected

Definition at line 113 of file H2645Parser.h.

Referenced by HEVCParser::addBytes(), and HEVCParser::processRBSP().

◆ m_totalkeyframecnt

uint64_t H2645Parser::m_totalkeyframecnt {0}
protected

Definition at line 114 of file H2645Parser.h.

Referenced by HEVCParser::addBytes(), and HEVCParser::processRBSP().

◆ m_auOffset

uint64_t H2645Parser::m_auOffset {0}
protected

Definition at line 115 of file H2645Parser.h.

Referenced by AVCParser::processRBSP(), HEVCParser::processRBSP(), and Reset().

◆ m_frameStartOffset

uint64_t H2645Parser::m_frameStartOffset {0}
protected

◆ m_keyframeStartOffset

uint64_t H2645Parser::m_keyframeStartOffset {0}
protected

◆ m_pktOffset

uint64_t H2645Parser::m_pktOffset {0}
protected

◆ m_spsOffset

uint64_t H2645Parser::m_spsOffset {0}
protected

◆ m_consecutiveZeros

uint32_t H2645Parser::m_consecutiveZeros {0}
protected

Definition at line 121 of file H2645Parser.h.

Referenced by fillRBSP(), and resetRBSP().

◆ m_rbspBufferSize

uint32_t H2645Parser::m_rbspBufferSize {188 * 2}
protected

Definition at line 122 of file H2645Parser.h.

Referenced by fillRBSP(), and H2645Parser().

◆ m_rbspIndex

uint32_t H2645Parser::m_rbspIndex {0}
protected

◆ m_syncAccumulator

uint32_t H2645Parser::m_syncAccumulator {0xffffffff}
protected

Definition at line 124 of file H2645Parser.h.

Referenced by AVCParser::addBytes(), HEVCParser::addBytes(), and Reset().

◆ m_timeScale

uint32_t H2645Parser::m_timeScale {0}
protected

◆ m_unitsInTick

uint32_t H2645Parser::m_unitsInTick {0}
protected

◆ m_scanType

SCAN_t H2645Parser::m_scanType {SCAN_t::UNKNOWN_SCAN}
protected

Definition at line 128 of file H2645Parser.h.

Referenced by GetScanType(), and HEVCParser::profileTierLevel().

◆ m_frameCropBottomOffset

uint H2645Parser::m_frameCropBottomOffset {0}
protected

◆ m_frameCropLeftOffset

uint H2645Parser::m_frameCropLeftOffset {0}
protected

Definition at line 131 of file H2645Parser.h.

Referenced by AVCParser::decode_SPS(), HEVCParser::parseSPS(), and Reset().

◆ m_frameCropRightOffset

uint H2645Parser::m_frameCropRightOffset {0}
protected

◆ m_frameCropTopOffset

uint H2645Parser::m_frameCropTopOffset {0}
protected

Definition at line 133 of file H2645Parser.h.

Referenced by AVCParser::decode_SPS(), HEVCParser::parseSPS(), and Reset().

◆ m_picHeight

uint H2645Parser::m_picHeight {0}
protected

◆ m_picWidth

uint H2645Parser::m_picWidth {0}
protected

◆ m_sarHeight

uint H2645Parser::m_sarHeight {0}
protected

Definition at line 136 of file H2645Parser.h.

Referenced by aspectRatio(), HEVCParser::parseSPS(), Reset(), and vui_parameters().

◆ m_sarWidth

uint H2645Parser::m_sarWidth {0}
protected

Definition at line 137 of file H2645Parser.h.

Referenced by aspectRatio(), HEVCParser::parseSPS(), Reset(), and vui_parameters().

◆ m_rbspBuffer

uint8_t* H2645Parser::m_rbspBuffer {nullptr}
protected

◆ m_aspectRatioIdc

uint8_t H2645Parser::m_aspectRatioIdc {0}
protected

Definition at line 140 of file H2645Parser.h.

Referenced by aspectRatio(), Reset(), and vui_parameters().

◆ m_chromaFormatIdc

int8_t H2645Parser::m_chromaFormatIdc {1}
protected

◆ m_auPending

bool H2645Parser::m_auPending {false}
protected

◆ m_fixedRate

bool H2645Parser::m_fixedRate {false}
protected

Definition at line 145 of file H2645Parser.h.

Referenced by HEVCParser::parseVPS(), Reset(), and vui_parameters().

◆ m_haveUnfinishedNAL

bool H2645Parser::m_haveUnfinishedNAL {false}
protected

◆ m_isKeyframe

bool H2645Parser::m_isKeyframe {false}
protected

Definition at line 147 of file H2645Parser.h.

Referenced by AVCParser::decode_Header(), AVCParser::processRBSP(), and Reset().

◆ m_onAU

bool H2645Parser::m_onAU {false}
protected

Definition at line 148 of file H2645Parser.h.

Referenced by HEVCParser::newAU(), and HEVCParser::processRBSP().

◆ m_onFrame

bool H2645Parser::m_onFrame {false}
protected

◆ m_onKeyFrame

bool H2645Parser::m_onKeyFrame {false}
protected

◆ m_seenSPS

bool H2645Parser::m_seenSPS {false}
protected

◆ m_separateColourPlaneFlag

bool H2645Parser::m_separateColourPlaneFlag {false}
protected

◆ m_stateChanged

bool H2645Parser::m_stateChanged {false}
protected

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