vdr 2.7.9
cFrameDetector Class Reference

#include <remux.h>

Public Member Functions

 cFrameDetector (int Pid=0, int Type=0)
 
 ~cFrameDetector ()
 
void SetPid (int Pid, int Type)
 
void SetMissing (void)
 
void SetLastPts (int64_t LastPts)
 
int Errors (bool *PreviousErrors=NULL, bool *MissingFrames=NULL)
 
int Analyze (const uchar *Data, int Length, bool ErrorCheck=true)
 
bool Synced (void)
 
bool NewFrame (int *PreviousErrors=NULL, int *MissingFrames=NULL)
 
bool NewFrame (bool &PreviousErrors, bool &MissingFrames)
 
bool IndependentFrame (void)
 
double FramesPerSecond (void)
 
uint16_t FrameWidth (void)
 
uint16_t FrameHeight (void)
 
eScanType ScanType (void)
 
eAspectRatio AspectRatio (void)
 

Private Types

enum  { MaxPtsValues = 150 }
 

Private Attributes

int pid
 
int type
 
bool synced
 
bool newFrame
 
bool independentFrame
 
uint32_t ptsValues [MaxPtsValues]
 
int numPtsValues
 
int numIFrames
 
bool isVideo
 
double framesPerSecond
 
uint16_t frameWidth
 
uint16_t frameHeight
 
eScanType scanType
 
eAspectRatio aspectRatio
 
int framesInPayloadUnit
 
int framesPerPayloadUnit
 
bool scanning
 
bool firstIframeSeen
 
int previousErrors
 
int missingFrames
 
cFrameParserparser
 
cTsCheckertsChecker
 
cPtsCheckerptsChecker
 

Detailed Description

Definition at line 554 of file remux.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
MaxPtsValues 

Definition at line 556 of file remux.h.

Constructor & Destructor Documentation

◆ cFrameDetector()

cFrameDetector::cFrameDetector ( int Pid = 0,
int Type = 0 )

Sets up a frame detector for the given Pid and stream Type.

If no Pid and Type is given, they need to be set by a separate call to SetPid().

Definition at line 2208 of file remux.c.

References arUnknown, aspectRatio, firstIframeSeen, frameHeight, framesInPayloadUnit, framesPerPayloadUnit, framesPerSecond, frameWidth, independentFrame, missingFrames, newFrame, numIFrames, numPtsValues, parser, previousErrors, ptsChecker, scanning, scanType, SetPid(), stUnknown, synced, and tsChecker.

◆ ~cFrameDetector()

cFrameDetector::~cFrameDetector ( )

Definition at line 2230 of file remux.c.

References ptsChecker, and tsChecker.

Member Function Documentation

◆ Analyze()

int cFrameDetector::Analyze ( const uchar * Data,
int Length,
bool ErrorCheck = true )

Analyzes the TS packets pointed to by Data.

Length is the number of bytes Data points to, and must be a multiple of TS_SIZE. Returns the number of bytes that have been analyzed. If the return value is 0, the data was not sufficient for analyzing and Analyze() needs to be called again with more actual data. Error checks can be turned off by setting ErrorCheck to false. This is used when regenerating the index file, where the first chunk of data is scanned for the PAT/PMT and then a rewind is done on the file.

Definition at line 2301 of file remux.c.

References aspectRatio, CmpUint32(), dbgframes, DEFAULTFRAMESPERSECOND, dsyslog, firstIframeSeen, frameHeight, framesInPayloadUnit, framesPerPayloadUnit, framesPerSecond, frameWidth, independentFrame, isVideo, MaxPtsValues, MIN_TS_PACKETS_FOR_FRAME_DETECTOR, missingFrames, newFrame, numIFrames, numPtsValues, parser, PATPID, PesGetPts(), PesHasPts(), pid, previousErrors, ptsChecker, PTSTICKS, ptsValues, scanning, scanType, synced, TS_SIZE, TS_SYNC, tsChecker, TsGetPts(), TsHasPayload(), TsIsScrambled(), TsPayloadOffset(), TsPayloadStart(), and TsPid().

Referenced by cIndexFileGenerator::Action().

◆ AspectRatio()

eAspectRatio cFrameDetector::AspectRatio ( void )
inline

Returns the aspect ratio, or arUnknown if this information is not available.

Definition at line 630 of file remux.h.

References aspectRatio.

Referenced by cIndexFileGenerator::Action().

◆ Errors()

int cFrameDetector::Errors ( bool * PreviousErrors = NULL,
bool * MissingFrames = NULL )

Returns the total number of errors so far.

This includes TS errors and missing frames (each missing frame counts as one error). If PreviousErrors and MissingFrames are given, these will return the final information about these conditions.

Definition at line 2269 of file remux.c.

References ptsChecker, and tsChecker.

Referenced by cIndexFileGenerator::Action().

◆ FrameHeight()

uint16_t cFrameDetector::FrameHeight ( void )
inline

Returns the frame height, or 0 if this information is not available.

Definition at line 626 of file remux.h.

References frameHeight.

Referenced by cIndexFileGenerator::Action().

◆ FramesPerSecond()

double cFrameDetector::FramesPerSecond ( void )
inline

Returns the number of frames per second, or 0 if this information is not available.

Definition at line 621 of file remux.h.

References framesPerSecond.

Referenced by cIndexFileGenerator::Action().

◆ FrameWidth()

uint16_t cFrameDetector::FrameWidth ( void )
inline

Returns the frame width, or 0 if this information is not available.

Definition at line 624 of file remux.h.

References frameWidth.

Referenced by cIndexFileGenerator::Action().

◆ IndependentFrame()

bool cFrameDetector::IndependentFrame ( void )
inline

Returns true if a new frame was detected and this is an independent frame (i.e.

one that can be displayed by itself, without using data from any other frames).

Definition at line 617 of file remux.h.

References independentFrame.

Referenced by cIndexFileGenerator::Action().

◆ NewFrame() [1/2]

bool cFrameDetector::NewFrame ( bool & PreviousErrors,
bool & MissingFrames )

Returns true if the data given to the last call to Analyze() started a new frame.

PreviousErrors is set to true if there were any errors in the previous frame. MissingFrames is set to true if there were any missing frames before this one. The results returned in PreviousErrors and MissingFrames are only valid if the function returns true.

Definition at line 2292 of file remux.c.

References missingFrames, newFrame, and previousErrors.

◆ NewFrame() [2/2]

bool cFrameDetector::NewFrame ( int * PreviousErrors = NULL,
int * MissingFrames = NULL )

Definition at line 2280 of file remux.c.

References missingFrames, newFrame, and previousErrors.

Referenced by cIndexFileGenerator::Action().

◆ ScanType()

eScanType cFrameDetector::ScanType ( void )
inline

Returns the scan type, or stUnknown if this information is not available.

Definition at line 628 of file remux.h.

References scanType.

Referenced by cIndexFileGenerator::Action().

◆ SetLastPts()

void cFrameDetector::SetLastPts ( int64_t LastPts)

If this is a resumed recording, call this function with the last PTS of the previous recording.

Definition at line 2263 of file remux.c.

References ptsChecker.

◆ SetMissing()

void cFrameDetector::SetMissing ( void )
inline

Definition at line 589 of file remux.h.

◆ SetPid()

void cFrameDetector::SetPid ( int Pid,
int Type )

Sets the Pid and stream Type to detect frames for.

Definition at line 2243 of file remux.c.

References esyslog, isVideo, parser, pid, tsChecker, and type.

Referenced by cIndexFileGenerator::Action(), and cFrameDetector().

◆ Synced()

bool cFrameDetector::Synced ( void )
inline

Returns true if the frame detector has synced on the data stream.

Definition at line 607 of file remux.h.

References synced.

Referenced by cIndexFileGenerator::Action().

Member Data Documentation

◆ aspectRatio

eAspectRatio cFrameDetector::aspectRatio
private

Definition at line 570 of file remux.h.

Referenced by Analyze(), AspectRatio(), and cFrameDetector().

◆ firstIframeSeen

bool cFrameDetector::firstIframeSeen
private

Definition at line 575 of file remux.h.

Referenced by Analyze(), and cFrameDetector().

◆ frameHeight

uint16_t cFrameDetector::frameHeight
private

Definition at line 568 of file remux.h.

Referenced by Analyze(), cFrameDetector(), and FrameHeight().

◆ framesInPayloadUnit

int cFrameDetector::framesInPayloadUnit
private

Definition at line 571 of file remux.h.

Referenced by Analyze(), and cFrameDetector().

◆ framesPerPayloadUnit

int cFrameDetector::framesPerPayloadUnit
private

Definition at line 572 of file remux.h.

Referenced by Analyze(), and cFrameDetector().

◆ framesPerSecond

double cFrameDetector::framesPerSecond
private

Definition at line 566 of file remux.h.

Referenced by Analyze(), cFrameDetector(), and FramesPerSecond().

◆ frameWidth

uint16_t cFrameDetector::frameWidth
private

Definition at line 567 of file remux.h.

Referenced by Analyze(), cFrameDetector(), and FrameWidth().

◆ independentFrame

bool cFrameDetector::independentFrame
private

Definition at line 561 of file remux.h.

Referenced by Analyze(), cFrameDetector(), and IndependentFrame().

◆ isVideo

bool cFrameDetector::isVideo
private

Definition at line 565 of file remux.h.

Referenced by Analyze(), and SetPid().

◆ missingFrames

int cFrameDetector::missingFrames
private

Definition at line 577 of file remux.h.

Referenced by Analyze(), cFrameDetector(), NewFrame(), and NewFrame().

◆ newFrame

bool cFrameDetector::newFrame
private

Definition at line 560 of file remux.h.

Referenced by Analyze(), cFrameDetector(), NewFrame(), and NewFrame().

◆ numIFrames

int cFrameDetector::numIFrames
private

Definition at line 564 of file remux.h.

Referenced by Analyze(), and cFrameDetector().

◆ numPtsValues

int cFrameDetector::numPtsValues
private

Definition at line 563 of file remux.h.

Referenced by Analyze(), and cFrameDetector().

◆ parser

cFrameParser* cFrameDetector::parser
private

Definition at line 578 of file remux.h.

Referenced by Analyze(), cFrameDetector(), and SetPid().

◆ pid

int cFrameDetector::pid
private

Definition at line 557 of file remux.h.

Referenced by Analyze(), and SetPid().

◆ previousErrors

int cFrameDetector::previousErrors
private

Definition at line 576 of file remux.h.

Referenced by Analyze(), cFrameDetector(), NewFrame(), and NewFrame().

◆ ptsChecker

cPtsChecker* cFrameDetector::ptsChecker
private

Definition at line 580 of file remux.h.

Referenced by Analyze(), cFrameDetector(), Errors(), SetLastPts(), and ~cFrameDetector().

◆ ptsValues

uint32_t cFrameDetector::ptsValues[MaxPtsValues]
private

Definition at line 562 of file remux.h.

Referenced by Analyze().

◆ scanning

bool cFrameDetector::scanning
private

Definition at line 574 of file remux.h.

Referenced by Analyze(), and cFrameDetector().

◆ scanType

eScanType cFrameDetector::scanType
private

Definition at line 569 of file remux.h.

Referenced by Analyze(), cFrameDetector(), and ScanType().

◆ synced

bool cFrameDetector::synced
private

Definition at line 559 of file remux.h.

Referenced by Analyze(), cFrameDetector(), and Synced().

◆ tsChecker

cTsChecker* cFrameDetector::tsChecker
private

Definition at line 579 of file remux.h.

Referenced by Analyze(), cFrameDetector(), Errors(), SetPid(), and ~cFrameDetector().

◆ type

int cFrameDetector::type
private

Definition at line 558 of file remux.h.

Referenced by SetPid().


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