Logo
ApraPipes 1.0
Loading...
Searching...
No Matches
H264Decoder Class Reference

#include <H264Decoder.h>

Inheritance diagram for H264Decoder:
Inheritance graph
Collaboration diagram for H264Decoder:
Collaboration graph

Classes

class  Detail
 

Public Member Functions

 H264Decoder (H264DecoderProps _props)
 
virtual ~H264Decoder ()
 
bool init ()
 
bool term ()
 
bool processEOS (string &pinId)
 
- Public Member Functions inherited from Module
 Module (Kind nature, string name, ModuleProps _props)
 
virtual ~Module ()
 
Kind getNature ()
 
string getName ()
 
string getId ()
 
double getPipelineFps ()
 
uint64_t getTickCounter ()
 
string addOutputPin (framemetadata_sp &metadata)
 
vector< string > getAllOutputPinsByType (int type)
 
void addOutputPin (framemetadata_sp &metadata, string &pinId)
 
bool setNext (boost::shared_ptr< Module > next, vector< string > &pinIdArr, bool open=true)
 
virtual bool setNext (boost::shared_ptr< Module > next, bool open=true, bool sieve=true)
 
bool addFeedback (boost::shared_ptr< Module > next, vector< string > &pinIdArr, bool open=true)
 
bool addFeedback (boost::shared_ptr< Module > next, bool open=true)
 
boost_deque< boost::shared_ptr< Module > > getConnectedModules ()
 
bool relay (boost::shared_ptr< Module > next, bool open, bool priority=false)
 
void operator() ()
 
virtual bool run ()
 
bool play (float speed, bool direction=true)
 
bool play (bool play)
 
bool queueStep ()
 
virtual bool step ()
 
virtual bool stop ()
 
virtual bool isFull ()
 
bool isNextModuleQueFull ()
 
void adaptQueue (boost::shared_ptr< FrameContainerQueueAdapter > queAdapter)
 
void register_consumer (boost::function< void(Module *, unsigned short)>, bool bFatal=false)
 
boost::shared_ptr< PaceMakergetPacer ()
 
bool getPlayDirection ()
 
virtual void flushQueRecursive ()
 
virtual void addControlModule (boost::shared_ptr< Module > cModule)
 
void registerHealthCallback (APHealthCallback callback)
 
void executeErrorCallback (const APErrorObject &error)
 
void registerErrorCallback (APErrorCallback callback)
 
ModuleProps getProps ()
 

Protected Member Functions

bool process (frame_container &frames)
 
bool processSOS (frame_sp &frame)
 
void addInputPin (framemetadata_sp &metadata, string &pinId)
 
bool validateInputPins ()
 
bool validateOutputPins ()
 
bool shouldTriggerSOS ()
 
void flushQue ()
 
bool handleCommand (Command::CommandType type, frame_sp &frame)
 
- Protected Member Functions inherited from Module
virtual boost_deque< frame_sp > getFrames (frame_container &frames)
 
virtual bool produce ()
 
bool stepNonSource (frame_container &frames)
 
bool preProcessNonSource (frame_container &frames)
 
bool preProcessControl (frame_container &frames)
 
bool isRunning ()
 
void setProps (ModuleProps &props)
 
void fillProps (ModuleProps &props)
 
template<class T >
void addPropsToQueue (T &props, bool priority=false)
 
virtual bool handlePropsChange (frame_sp &frame)
 
template<class T >
bool handlePropsChange (frame_sp &frame, T &props)
 
template<class T >
bool queuePriorityCommand (T &cmd)
 
template<class T >
bool queueCommand (T &cmd, bool priority=false)
 
template<class T >
void getCommand (T &cmd, frame_sp &frame)
 
bool queuePlayPauseCommand (PlayPauseCommand ppCmd, bool priority=false)
 
frame_sp makeCommandFrame (size_t size, framemetadata_sp &metadata)
 
frame_sp makeFrame (size_t size, string &pinId)
 
frame_sp makeFrame (size_t size)
 
frame_sp makeFrame ()
 
frame_sp makeFrame (frame_sp &bigFrame, size_t &newSize, string &pinId)
 
frame_sp getEOSFrame ()
 
frame_sp getEmptyFrame ()
 
void setMetadata (std::string &pinId, framemetadata_sp &metadata)
 
virtual bool send (frame_container &frames, bool forceBlockingPush=false)
 
virtual void sendEOS ()
 
virtual void sendEOS (frame_sp &frame)
 
virtual void sendMp4ErrorFrame (frame_sp &frame)
 
virtual void sendEoPFrame ()
 
void ignore (int times)
 
void stop_onStepfail ()
 
void emit_event (unsigned short eventID)
 
void emit_fatal (unsigned short eventID)
 
void setModuleState (enum ModuleState es)
 
ModuleState getModuleState ()
 
virtual bool validateInputOutputPins ()
 
size_t getNumberOfOutputPins (bool implicit=true)
 
size_t getNumberOfInputPins ()
 
framemetadata_sp getFirstInputMetadata ()
 
framemetadata_sp getFirstOutputMetadata ()
 
framemetadata_sp getOutputMetadata (string outPinID)
 
metadata_by_pin & getInputMetadata ()
 
framefactory_by_pin & getOutputFrameFactory ()
 
framemetadata_sp getInputMetadataByType (int type)
 
int getNumberOfInputsByType (int type)
 
int getNumberOfOutputsByType (int type)
 
framemetadata_sp getOutputMetadataByType (int type)
 
bool isMetadataEmpty (framemetadata_sp &metadata)
 
bool isFrameEmpty (frame_sp &frame)
 
string getInputPinIdByType (int type)
 
string getOutputPinIdByType (int type)
 
bool setNext (boost::shared_ptr< Module > next, bool open, bool isFeedback, bool sieve)
 
bool setNext (boost::shared_ptr< Module > next, vector< string > &pinIdArr, bool open, bool isFeedback, bool sieve)
 
void addInputPin (framemetadata_sp &metadata, string &pinId, bool isFeedback)
 
boost::shared_ptr< FrameContainerQueuegetQue ()
 
bool getPlayState ()
 
Connections getConnections ()
 
frame_container try_pop ()
 
frame_container pop ()
 
bool processSourceQue ()
 
bool handlePausePlay (bool play)
 
virtual bool handlePausePlay (float speed=1, bool direction=true)
 
virtual void notifyPlay (bool play)
 
FFBufferMaker createFFBufferMaker ()
 

Private Member Functions

void bufferDecodedFrames (frame_sp &frame)
 
void bufferBackwardEncodedFrames (frame_sp &frame, short naluType)
 
void bufferAndDecodeForwardEncodedFrames (frame_sp &frame, short naluType)
 
void sendDecodedFrame ()
 
void decodeFrameFromBwdGOP ()
 
void clearIncompleteBwdGopTsFromIncomingTSQ (std::deque< frame_sp > &latestGop)
 
void saveSpsPps (frame_sp frame)
 
void * prependSpsPps (frame_sp &iFrame, size_t &spsPpsFrameSize)
 
void dropFarthestFromCurrentTs (uint64_t ts)
 

Private Attributes

boost::shared_ptr< DetailmDetail
 
bool mShouldTriggerSOS
 
framemetadata_sp mOutputMetadata
 
std::string mOutputPinId
 
H264DecoderProps mProps
 
std::deque< std::deque< frame_sp > > backwardGopBuffer
 
std::deque< frame_sp > latestBackwardGop
 
std::deque< frame_sp > latestForwardGop
 
std::map< uint64, frame_sp > decodedFramesCache
 
bool mDirection
 
bool dirChangedToFwd = false
 
bool dirChangedToBwd = false
 
bool foundIFrameOfReverseGop = false
 
bool decodePreviousFramesOfTheForwardGop = false
 
bool prevFrameInCache = false
 
std::deque< uint64_t > incomingFramesTSQ
 
frame_sp mHeaderFrame
 
boost::asio::const_buffer spsBuffer
 
boost::asio::const_buffer ppsBuffer
 
std::mutex m
 
int framesToSkip = 0
 
int iFramesToSkip = 0
 
int currentFps = 24
 
int previousFps = 24
 
float playbackSpeed = 1
 
int gop
 
uint64_t lastFrameSent
 
bool resumeFwdPlayback = true
 
bool resumeBwdPlayback = true
 
bool resumePlayback = true
 
int incomingFramesTSQSize = 0
 

Additional Inherited Members

- Public Types inherited from Module
enum  Kind { SOURCE , TRANSFORM , SINK , CONTROL }
 
enum  ModuleState { Initialized , Running , EndOfStreamNormal , EndOfStreamSocketError }
 
- Static Public Member Functions inherited from Module
static frame_sp getFrameByType (frame_container &frames, int frameType)
 
- Protected Attributes inherited from Module
boost::function< void()> onStepFail
 
boost::function< void(Module *, unsigned short)> event_consumer
 
boost::function< void(Module *, unsigned short)> fatal_event_consumer
 
enum ModuleState module_state
 
boost::shared_ptr< ModulecontrolModule = nullptr
 

Constructor & Destructor Documentation

◆ H264Decoder()

H264Decoder::H264Decoder ( H264DecoderProps _props)
Here is the call graph for this function:

◆ ~H264Decoder()

H264Decoder::~H264Decoder ( )
virtual

Member Function Documentation

◆ addInputPin()

void H264Decoder::addInputPin ( framemetadata_sp & metadata,
string & pinId )
protectedvirtual

Reimplemented from Module.

Here is the call graph for this function:

◆ bufferAndDecodeForwardEncodedFrames()

void H264Decoder::bufferAndDecodeForwardEncodedFrames ( frame_sp & frame,
short naluType )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bufferBackwardEncodedFrames()

void H264Decoder::bufferBackwardEncodedFrames ( frame_sp & frame,
short naluType )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bufferDecodedFrames()

void H264Decoder::bufferDecodedFrames ( frame_sp & frame)
private
Here is the caller graph for this function:

◆ clearIncompleteBwdGopTsFromIncomingTSQ()

void H264Decoder::clearIncompleteBwdGopTsFromIncomingTSQ ( std::deque< frame_sp > & latestGop)
private
Here is the caller graph for this function:

◆ decodeFrameFromBwdGOP()

void H264Decoder::decodeFrameFromBwdGOP ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dropFarthestFromCurrentTs()

void H264Decoder::dropFarthestFromCurrentTs ( uint64_t ts)
private
Here is the caller graph for this function:

◆ flushQue()

void H264Decoder::flushQue ( )
protectedvirtual

Reimplemented from Module.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleCommand()

bool H264Decoder::handleCommand ( Command::CommandType type,
frame_sp & frame )
protectedvirtual

Reimplemented from Module.

Here is the call graph for this function:

◆ init()

bool H264Decoder::init ( )
virtual

Reimplemented from Module.

Here is the call graph for this function:

◆ prependSpsPps()

void * H264Decoder::prependSpsPps ( frame_sp & iFrame,
size_t & spsPpsFrameSize )
private
Here is the caller graph for this function:

◆ process()

bool H264Decoder::process ( frame_container & frames)
protectedvirtual

Reimplemented from Module.

Here is the call graph for this function:

◆ processEOS()

bool H264Decoder::processEOS ( string & pinId)
virtual

Reimplemented from Module.

◆ processSOS()

bool H264Decoder::processSOS ( frame_sp & frame)
protectedvirtual

Reimplemented from Module.

Here is the call graph for this function:

◆ saveSpsPps()

void H264Decoder::saveSpsPps ( frame_sp frame)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendDecodedFrame()

void H264Decoder::sendDecodedFrame ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shouldTriggerSOS()

bool H264Decoder::shouldTriggerSOS ( )
protectedvirtual

Reimplemented from Module.

◆ term()

bool H264Decoder::term ( )
virtual

Reimplemented from Module.

Here is the call graph for this function:

◆ validateInputPins()

bool H264Decoder::validateInputPins ( )
protectedvirtual

Reimplemented from Module.

Here is the call graph for this function:

◆ validateOutputPins()

bool H264Decoder::validateOutputPins ( )
protectedvirtual

Reimplemented from Module.

Here is the call graph for this function:

Member Data Documentation

◆ backwardGopBuffer

std::deque<std::deque<frame_sp> > H264Decoder::backwardGopBuffer
private

◆ currentFps

int H264Decoder::currentFps = 24
private

◆ decodedFramesCache

std::map<uint64, frame_sp> H264Decoder::decodedFramesCache
private

◆ decodePreviousFramesOfTheForwardGop

bool H264Decoder::decodePreviousFramesOfTheForwardGop = false
private

◆ dirChangedToBwd

bool H264Decoder::dirChangedToBwd = false
private

◆ dirChangedToFwd

bool H264Decoder::dirChangedToFwd = false
private

◆ foundIFrameOfReverseGop

bool H264Decoder::foundIFrameOfReverseGop = false
private

◆ framesToSkip

int H264Decoder::framesToSkip = 0
private

◆ gop

int H264Decoder::gop
private

◆ iFramesToSkip

int H264Decoder::iFramesToSkip = 0
private

◆ incomingFramesTSQ

std::deque<uint64_t> H264Decoder::incomingFramesTSQ
private

◆ incomingFramesTSQSize

int H264Decoder::incomingFramesTSQSize = 0
private

◆ lastFrameSent

uint64_t H264Decoder::lastFrameSent
private

◆ latestBackwardGop

std::deque<frame_sp> H264Decoder::latestBackwardGop
private

◆ latestForwardGop

std::deque<frame_sp> H264Decoder::latestForwardGop
private

◆ m

std::mutex H264Decoder::m
private

◆ mDetail

boost::shared_ptr<Detail> H264Decoder::mDetail
private

◆ mDirection

bool H264Decoder::mDirection
private

◆ mHeaderFrame

frame_sp H264Decoder::mHeaderFrame
private

◆ mOutputMetadata

framemetadata_sp H264Decoder::mOutputMetadata
private

◆ mOutputPinId

std::string H264Decoder::mOutputPinId
private

◆ mProps

H264DecoderProps H264Decoder::mProps
private

◆ mShouldTriggerSOS

bool H264Decoder::mShouldTriggerSOS
private

◆ playbackSpeed

float H264Decoder::playbackSpeed = 1
private

◆ ppsBuffer

boost::asio::const_buffer H264Decoder::ppsBuffer
private

◆ prevFrameInCache

bool H264Decoder::prevFrameInCache = false
private

◆ previousFps

int H264Decoder::previousFps = 24
private

◆ resumeBwdPlayback

bool H264Decoder::resumeBwdPlayback = true
private

◆ resumeFwdPlayback

bool H264Decoder::resumeFwdPlayback = true
private

◆ resumePlayback

bool H264Decoder::resumePlayback = true
private

◆ spsBuffer

boost::asio::const_buffer H264Decoder::spsBuffer
private

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