DvppStreamDecoder.h 1008 Bytes
#ifndef __DVPP_STREAM_DECODER_H__
#define __DVPP_STREAM_DECODER_H__

#include "depend_headers.h"
#include "dvpp_headers.h"

#include "VpcUtils.h"

using namespace std;

class DvppStreamDecoder
{
public:
    DvppStreamDecoder(/* args */);
    ~DvppStreamDecoder();

    bool init_vdpp(FFDecConfig cfg);

    DataFrame* Decode(int videoType, char* data, int len, int isKey, uint64_t pts);

public:
    void doProcessReport();
    void doVdppVdecCallBack(acldvppStreamDesc *input, acldvppPicDesc *output, void *pUserData);

private:
    bool sendVdecEos(aclvdecChannelDesc *vdecChannelDesc);
    int sendPkt(aclvdecChannelDesc *vdecChannelDesc, AVPacket* pkt, unsigned long long frame_nb);

private:
    string m_dec_name {""};
    int m_deviceId {-1};

    int m_dvpp_channel {-1};
    aclrtContext m_context{nullptr};

    aclvdecChannelDesc *vdecChannelDesc {nullptr};

    int m_vdec_out_size {-1};

    VpcUtils m_vpcUtils;

    unsigned long m_frame_nb {0};
};




#endif      // __DVPP_STREAM_DECODER_H__