#include "DvppDecoderApi.h" #include "DvppDecoder.h" DvppDecoderApi::DvppDecoderApi(){ m_pDecoder = nullptr; } DvppDecoderApi::~DvppDecoderApi(){ if(m_pDecoder != nullptr){ delete m_pDecoder; m_pDecoder = nullptr; } } bool DvppDecoderApi::init(FFDecConfig& cfg){ m_pDecoder = new DvppDecoder(); if(m_pDecoder != nullptr){ return m_pDecoder->init(cfg); } return false; } void DvppDecoderApi::close(){ if(m_pDecoder != nullptr){ return m_pDecoder->close(); } } bool DvppDecoderApi::start(){ if(m_pDecoder != nullptr){ return m_pDecoder->start(); } return false; } void DvppDecoderApi::pause(){ if(m_pDecoder != nullptr){ return m_pDecoder->pause(); } } void DvppDecoderApi::resume(){ if(m_pDecoder != nullptr){ return m_pDecoder->resume(); } } void DvppDecoderApi::setDecKeyframe(bool bKeyframe){ if(m_pDecoder != nullptr){ return m_pDecoder->setDecKeyframe(bKeyframe); } } bool DvppDecoderApi::isRunning(){ if(m_pDecoder != nullptr){ return m_pDecoder->isRunning(); } return false; } bool DvppDecoderApi::isFinished(){ if(m_pDecoder != nullptr){ return m_pDecoder->isFinished(); } return false; } bool DvppDecoderApi::isPausing(){ if(m_pDecoder != nullptr){ return m_pDecoder->isPausing(); } return false; } bool DvppDecoderApi::getResolution(int &width, int &height){ if(m_pDecoder != nullptr){ return m_pDecoder->getResolution(width, height); } return false; } bool DvppDecoderApi::isSurport(FFDecConfig& cfg){ if(m_pDecoder != nullptr){ return m_pDecoder->isSurport(cfg); } return false; } float DvppDecoderApi::fps(){ if(m_pDecoder != nullptr){ return m_pDecoder->fps(); } return 0.0; } int DvppDecoderApi::getCachedQueueLength(){ if(m_pDecoder != nullptr){ return m_pDecoder->getCachedQueueLength(); } return 0; } void DvppDecoderApi::setName(string nm){ if(m_pDecoder != nullptr){ return m_pDecoder->setName(nm); } } string DvppDecoderApi::getName(){ if(m_pDecoder != nullptr){ return m_pDecoder->getName(); } return nullptr; } FFImgInfo* DvppDecoderApi::snapshot(){ if(m_pDecoder != nullptr){ return m_pDecoder->snapshot(); } return nullptr; } void DvppDecoderApi::setPostDecArg(const void* postDecArg){ if(m_pDecoder != nullptr){ return m_pDecoder->setPostDecArg(postDecArg); } } void DvppDecoderApi::setFinishedDecArg(const void* finishedDecArg){ if(m_pDecoder != nullptr){ return m_pDecoder->setFinishedDecArg(finishedDecArg); } }