MythTV  master
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
AVCParser Class Reference

#include <AVCParser.h>

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

Public Types

enum  NAL_unit_type {
  UNKOWN = -1, SLICE = 1, SLICE_DPA = 2, SLICE_DPB = 3,
  SLICE_DPC = 4, SLICE_IDR = 5, SEI = 6, SPS = 7,
  PPS = 8, AU_DELIMITER = 9, END_SEQUENCE = 10, END_STREAM = 11,
  FILLER_DATA = 12, SPS_EXT = 13, NALU_prefix = 14, SPS_subset = 15,
  AUXILIARY_SLICE = 19, SLICE_EXTENSION = 20
}
 
enum  SEI_type { SEI_TYPE_PIC_TIMING = 1, SEI_FILLER_PAYLOAD = 3, SEI_TYPE_USER_DATA_UNREGISTERED = 5, SEI_TYPE_RECOVERY_POINT = 6 }
 
- Public Types inherited from H2645Parser
enum  { MAX_SLICE_HEADER_SIZE = 256 }
 
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

field_type getFieldType (void) const override
 
 AVCParser (void)
 
 AVCParser (const AVCParser &rhs)
 
 ~AVCParser (void) override
 
uint32_t addBytes (const uint8_t *bytes, uint32_t byte_count, uint64_t stream_offset) override
 
void Reset (void) override
 
QString NAL_type_str (int8_t type) override
 
void use_I_forKeyframes (bool val)
 
bool using_I_forKeyframes (void) const
 
void parse_SPS (uint8_t *sps, uint32_t sps_size, bool &interlaced, int32_t &max_ref_frames)
 
void reset_SPS (void)
 
bool seen_SPS (void) const
 
bool found_AU (void) const
 
uint8_t lastNALtype (void) const
 
uint getRefFrames (void) const
 
uint pictureWidthCropped (void) const override
 
uint pictureHeightCropped (void) const override
 
double frameRate (void) const
 
void getFrameRate (FrameRate &result) const override
 
void set_AU_pending (void)
 
- Public Member Functions inherited from H2645Parser
 H2645Parser (void)
 
 H2645Parser (const H2645Parser &rhs)
 
virtual ~H2645Parser (void)
 
bool stateChanged (void) const
 
bool onFrameStart (void) const
 
bool onKeyFrameStart (void) const
 
uint pictureWidth (void) const
 
uint pictureHeight (void) const
 
uint aspectRatio (void) const
 Computes aspect ratio from picture size and sample aspect ratio. More...
 
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 Member Functions

static bool isKeySlice (uint slice_type)
 
static bool NALisSlice (int8_t nal_type)
 

Protected Member Functions

bool new_AU (void)
 
void processRBSP (bool rbsp_complete)
 
- Protected Member Functions inherited from H2645Parser
void resetRBSP (void)
 
bool fillRBSP (const uint8_t *byteP, uint32_t byte_count, bool found_start_code)
 
void vui_parameters (GetBitContext *gb, bool hevc)
 

Private Member Functions

bool decode_Header (GetBitContext *gb)
 
void decode_SPS (GetBitContext *gb)
 
void decode_PPS (GetBitContext *gb)
 
void decode_SEI (GetBitContext *gb)
 

Private Attributes

int m_deltaPicOrderCntBottom {0}
 
int m_deltaPicOrderCnt [2] {0}
 
int m_frameNum {-1}
 
int m_picOrderCntLsb {0}
 
int m_picParameterSetId {-1}
 
int m_prevDeltaPicOrderCntBottom {0}
 
int m_prevDeltaPicOrderCnt [2] {0}
 
int m_prevFrameNum {-1}
 
int m_prevPicOrderCntLsb {0}
 
int m_prevPicParameterSetId {-1}
 
uint m_idrPicId {65536}
 
uint m_log2MaxFrameNum {0}
 
uint m_log2MaxPicOrderCntLsb {0}
 
uint m_numRefFrames {0}
 
uint m_prevIdrPicId {65536}
 
uint m_redundantPicCnt {0}
 
uint m_seqParameterSetId {0}
 
uint m_sliceType {SLICE_UNDEF}
 
int8_t m_bottomFieldFlag {-1}
 
int8_t m_fieldPicFlag {-1}
 
int8_t m_frameMbsOnlyFlag {-1}
 
int8_t m_nalUnitType {UNKNOWN}
 
int8_t m_picOrderPresentFlag {-1}
 
int8_t m_prevBottomFieldFlag {-1}
 
int8_t m_prevFieldPicFlag {-1}
 
int8_t m_prevNalUnitType {UNKNOWN}
 
int8_t m_redundantPicCntPresentFlag {0}
 
uint8_t m_deltaPicOrderAlwaysZeroFlag {0}
 
uint8_t m_nalRefIdc {111}
 
uint8_t m_picOrderCntType {0}
 
uint8_t m_prevNALRefIdc {111}
 
uint8_t m_prevPicOrderCntType {0}
 
bool m_auContainsKeyframeMessage {false}
 
bool m_iIsKeyframe {true}
 

Additional Inherited Members

- Protected Types inherited from H2645Parser
enum  constants { EXTENDED_SAR = 255 }
 
- Protected Attributes inherited from H2645Parser
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::PROGRESSIVE}
 
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}
 

Detailed Description

Definition at line 28 of file AVCParser.h.

Member Enumeration Documentation

◆ NAL_unit_type

Enumerator
UNKOWN 
SLICE 
SLICE_DPA 
SLICE_DPB 
SLICE_DPC 
SLICE_IDR 
SEI 
SPS 
PPS 
AU_DELIMITER 
END_SEQUENCE 
END_STREAM 
FILLER_DATA 
SPS_EXT 
NALU_prefix 
SPS_subset 
AUXILIARY_SLICE 
SLICE_EXTENSION 

Definition at line 52 of file AVCParser.h.

◆ SEI_type

Enumerator
SEI_TYPE_PIC_TIMING 
SEI_FILLER_PAYLOAD 
SEI_TYPE_USER_DATA_UNREGISTERED 
SEI_TYPE_RECOVERY_POINT 

Definition at line 73 of file AVCParser.h.

Constructor & Destructor Documentation

◆ AVCParser() [1/2]

AVCParser::AVCParser ( void  )
inline

Definition at line 89 of file AVCParser.h.

◆ AVCParser() [2/2]

AVCParser::AVCParser ( const AVCParser rhs)

◆ ~AVCParser()

AVCParser::~AVCParser ( void  )
inlineoverride

Definition at line 91 of file AVCParser.h.

Member Function Documentation

◆ getFieldType()

H2645Parser::field_type AVCParser::getFieldType ( void  ) const
overridevirtual

Implements H2645Parser.

Definition at line 1054 of file AVCParser.cpp.

Referenced by AvFormatDecoder::H264PreProcessPkt().

◆ addBytes()

uint32_t AVCParser::addBytes ( const uint8_t *  bytes,
uint32_t  byte_count,
uint64_t  stream_offset 
)
overridevirtual

Implements H2645Parser.

Definition at line 291 of file AVCParser.cpp.

Referenced by AvFormatDecoder::H264PreProcessPkt().

◆ Reset()

void AVCParser::Reset ( void  )
overridevirtual

Reimplemented from H2645Parser.

Definition at line 92 of file AVCParser.cpp.

Referenced by AvFormatDecoder::CloseContext(), and AvFormatDecoder::ScanStreams().

◆ NAL_type_str()

QString AVCParser::NAL_type_str ( int8_t  type)
overridevirtual

Implements H2645Parser.

Definition at line 136 of file AVCParser.cpp.

◆ isKeySlice()

static bool AVCParser::isKeySlice ( uint  slice_type)
inlinestatic

Definition at line 101 of file AVCParser.h.

Referenced by decode_Header().

◆ NALisSlice()

static bool AVCParser::NALisSlice ( int8_t  nal_type)
inlinestatic

Definition at line 109 of file AVCParser.h.

Referenced by addBytes(), and processRBSP().

◆ use_I_forKeyframes()

void AVCParser::use_I_forKeyframes ( bool  val)
inline

Definition at line 116 of file AVCParser.h.

Referenced by AvFormatDecoder::SetIdrOnlyKeyframes().

◆ using_I_forKeyframes()

bool AVCParser::using_I_forKeyframes ( void  ) const
inline

Definition at line 117 of file AVCParser.h.

◆ parse_SPS()

void AVCParser::parse_SPS ( uint8_t *  sps,
uint32_t  sps_size,
bool interlaced,
int32_t &  max_ref_frames 
)

Definition at line 899 of file AVCParser.cpp.

◆ reset_SPS()

void AVCParser::reset_SPS ( void  )
inline

Definition at line 122 of file AVCParser.h.

◆ seen_SPS()

bool AVCParser::seen_SPS ( void  ) const
inline

Definition at line 123 of file AVCParser.h.

◆ found_AU()

bool AVCParser::found_AU ( void  ) const
inline

Definition at line 125 of file AVCParser.h.

◆ lastNALtype()

uint8_t AVCParser::lastNALtype ( void  ) const
inline

Definition at line 127 of file AVCParser.h.

◆ getRefFrames()

uint AVCParser::getRefFrames ( void  ) const
inline

Definition at line 129 of file AVCParser.h.

Referenced by AvFormatDecoder::H264PreProcessPkt().

◆ pictureWidthCropped()

uint AVCParser::pictureWidthCropped ( void  ) const
overridevirtual

Implements H2645Parser.

Definition at line 1031 of file AVCParser.cpp.

Referenced by AvFormatDecoder::H264PreProcessPkt().

◆ pictureHeightCropped()

uint AVCParser::pictureHeightCropped ( void  ) const
overridevirtual

Implements H2645Parser.

Definition at line 1043 of file AVCParser.cpp.

Referenced by AvFormatDecoder::H264PreProcessPkt().

◆ frameRate()

double AVCParser::frameRate ( void  ) const

Definition at line 1073 of file AVCParser.cpp.

Referenced by AvFormatDecoder::H264PreProcessPkt().

◆ getFrameRate()

void AVCParser::getFrameRate ( FrameRate result) const
overridevirtual

Implements H2645Parser.

Definition at line 1081 of file AVCParser.cpp.

◆ set_AU_pending()

void AVCParser::set_AU_pending ( void  )
inline

Definition at line 137 of file AVCParser.h.

Referenced by addBytes(), and processRBSP().

◆ new_AU()

bool AVCParser::new_AU ( void  )
protected

Definition at line 172 of file AVCParser.cpp.

Referenced by processRBSP().

◆ processRBSP()

void AVCParser::processRBSP ( bool  rbsp_complete)
protected

Definition at line 421 of file AVCParser.cpp.

Referenced by addBytes().

◆ decode_Header()

bool AVCParser::decode_Header ( GetBitContext *  gb)
private

Definition at line 502 of file AVCParser.cpp.

Referenced by processRBSP().

◆ decode_SPS()

void AVCParser::decode_SPS ( GetBitContext *  gb)
private

Definition at line 700 of file AVCParser.cpp.

Referenced by parse_SPS(), and processRBSP().

◆ decode_PPS()

void AVCParser::decode_PPS ( GetBitContext *  gb)
private

Definition at line 909 of file AVCParser.cpp.

Referenced by processRBSP().

◆ decode_SEI()

void AVCParser::decode_SEI ( GetBitContext *  gb)
private

Definition at line 984 of file AVCParser.cpp.

Referenced by processRBSP().

Member Data Documentation

◆ m_deltaPicOrderCntBottom

int AVCParser::m_deltaPicOrderCntBottom {0}
private

Definition at line 158 of file AVCParser.h.

Referenced by decode_Header(), new_AU(), and Reset().

◆ m_deltaPicOrderCnt

int AVCParser::m_deltaPicOrderCnt[2] {0}
private

Definition at line 159 of file AVCParser.h.

Referenced by decode_Header(), new_AU(), and Reset().

◆ m_frameNum

int AVCParser::m_frameNum {-1}
private

Definition at line 160 of file AVCParser.h.

Referenced by decode_Header(), new_AU(), and Reset().

◆ m_picOrderCntLsb

int AVCParser::m_picOrderCntLsb {0}
private

Definition at line 161 of file AVCParser.h.

Referenced by decode_Header(), new_AU(), and Reset().

◆ m_picParameterSetId

int AVCParser::m_picParameterSetId {-1}
private

Definition at line 162 of file AVCParser.h.

Referenced by decode_Header(), decode_PPS(), new_AU(), and Reset().

◆ m_prevDeltaPicOrderCntBottom

int AVCParser::m_prevDeltaPicOrderCntBottom {0}
private

Definition at line 163 of file AVCParser.h.

Referenced by new_AU(), and Reset().

◆ m_prevDeltaPicOrderCnt

int AVCParser::m_prevDeltaPicOrderCnt[2] {0}
private

Definition at line 164 of file AVCParser.h.

Referenced by new_AU(), and Reset().

◆ m_prevFrameNum

int AVCParser::m_prevFrameNum {-1}
private

Definition at line 165 of file AVCParser.h.

Referenced by new_AU(), and Reset().

◆ m_prevPicOrderCntLsb

int AVCParser::m_prevPicOrderCntLsb {0}
private

Definition at line 166 of file AVCParser.h.

Referenced by new_AU(), and Reset().

◆ m_prevPicParameterSetId

int AVCParser::m_prevPicParameterSetId {-1}
private

Definition at line 167 of file AVCParser.h.

Referenced by new_AU(), and Reset().

◆ m_idrPicId

uint AVCParser::m_idrPicId {65536}
private

Definition at line 169 of file AVCParser.h.

Referenced by decode_Header(), new_AU(), and Reset().

◆ m_log2MaxFrameNum

uint AVCParser::m_log2MaxFrameNum {0}
private

Definition at line 170 of file AVCParser.h.

Referenced by decode_Header(), decode_SPS(), and Reset().

◆ m_log2MaxPicOrderCntLsb

uint AVCParser::m_log2MaxPicOrderCntLsb {0}
private

Definition at line 171 of file AVCParser.h.

Referenced by decode_Header(), decode_SPS(), and Reset().

◆ m_numRefFrames

uint AVCParser::m_numRefFrames {0}
private

Definition at line 172 of file AVCParser.h.

Referenced by decode_SPS(), NALisSlice(), parse_SPS(), and Reset().

◆ m_prevIdrPicId

uint AVCParser::m_prevIdrPicId {65536}
private

Definition at line 173 of file AVCParser.h.

Referenced by new_AU(), and Reset().

◆ m_redundantPicCnt

uint AVCParser::m_redundantPicCnt {0}
private

Definition at line 174 of file AVCParser.h.

Referenced by decode_Header(), and Reset().

◆ m_seqParameterSetId

uint AVCParser::m_seqParameterSetId {0}
private

Definition at line 175 of file AVCParser.h.

Referenced by decode_PPS(), and Reset().

◆ m_sliceType

uint AVCParser::m_sliceType {SLICE_UNDEF}
private

Definition at line 176 of file AVCParser.h.

Referenced by decode_Header(), and Reset().

◆ m_bottomFieldFlag

int8_t AVCParser::m_bottomFieldFlag {-1}
private

Definition at line 178 of file AVCParser.h.

Referenced by decode_Header(), getFieldType(), new_AU(), and Reset().

◆ m_fieldPicFlag

int8_t AVCParser::m_fieldPicFlag {-1}
private

Definition at line 179 of file AVCParser.h.

Referenced by decode_Header(), new_AU(), and Reset().

◆ m_frameMbsOnlyFlag

int8_t AVCParser::m_frameMbsOnlyFlag {-1}
private

Definition at line 180 of file AVCParser.h.

Referenced by decode_Header(), decode_SPS(), parse_SPS(), pictureHeightCropped(), and Reset().

◆ m_nalUnitType

int8_t AVCParser::m_nalUnitType {UNKNOWN}
private

Definition at line 181 of file AVCParser.h.

Referenced by addBytes(), decode_Header(), new_AU(), processRBSP(), and Reset().

◆ m_picOrderPresentFlag

int8_t AVCParser::m_picOrderPresentFlag {-1}
private

Definition at line 182 of file AVCParser.h.

Referenced by decode_Header(), decode_PPS(), and Reset().

◆ m_prevBottomFieldFlag

int8_t AVCParser::m_prevBottomFieldFlag {-1}
private

Definition at line 183 of file AVCParser.h.

Referenced by new_AU(), and Reset().

◆ m_prevFieldPicFlag

int8_t AVCParser::m_prevFieldPicFlag {-1}
private

Definition at line 184 of file AVCParser.h.

Referenced by new_AU(), and Reset().

◆ m_prevNalUnitType

int8_t AVCParser::m_prevNalUnitType {UNKNOWN}
private

Definition at line 185 of file AVCParser.h.

Referenced by new_AU(), and Reset().

◆ m_redundantPicCntPresentFlag

int8_t AVCParser::m_redundantPicCntPresentFlag {0}
private

Definition at line 186 of file AVCParser.h.

Referenced by decode_Header(), decode_PPS(), and Reset().

◆ m_deltaPicOrderAlwaysZeroFlag

uint8_t AVCParser::m_deltaPicOrderAlwaysZeroFlag {0}
private

Definition at line 188 of file AVCParser.h.

Referenced by decode_Header(), decode_SPS(), and Reset().

◆ m_nalRefIdc

uint8_t AVCParser::m_nalRefIdc {111}
private

Definition at line 189 of file AVCParser.h.

Referenced by addBytes(), new_AU(), and Reset().

◆ m_picOrderCntType

uint8_t AVCParser::m_picOrderCntType {0}
private

Definition at line 190 of file AVCParser.h.

Referenced by decode_Header(), decode_SPS(), new_AU(), and Reset().

◆ m_prevNALRefIdc

uint8_t AVCParser::m_prevNALRefIdc {111}
private

Definition at line 191 of file AVCParser.h.

Referenced by new_AU(), and Reset().

◆ m_prevPicOrderCntType

uint8_t AVCParser::m_prevPicOrderCntType {0}
private

Definition at line 192 of file AVCParser.h.

Referenced by new_AU(), and Reset().

◆ m_auContainsKeyframeMessage

bool AVCParser::m_auContainsKeyframeMessage {false}
private

Definition at line 194 of file AVCParser.h.

Referenced by decode_SEI(), and processRBSP().

◆ m_iIsKeyframe

bool AVCParser::m_iIsKeyframe {true}
private

Definition at line 195 of file AVCParser.h.

Referenced by decode_Header().


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