/* 
 * Decoder
 * 2022.09.23 sugon
 * */

#ifndef __DECODER_H__
#define __DECODER_H__

extern "C"
{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libavcodec/avcodec.h>
#include <libavcodec/packet.h>
#include <libavcodec/codec.h>
#include <libavutil/imgutils.h>
#include <libavutil/samplefmt.h>
#include <libavutil/timestamp.h>
#include <libavformat/avformat.h>
#include <libavutil/time.h>
}

class  Decoder
{
public:
    Decoder();
    virtual ~Decoder();
    virtual int DecoderInit();

    AVFormatContext *fmt_ctx = NULL;
    AVCodecContext *video_dec_ctx = NULL;
    AVStream *video_stream = NULL;
    AVFrame *frame = NULL;
    AVPacket *pkt = NULL;
    const AVCodec *dec = NULL;
    int video_stream_idx = -1;

    const char *src_filename = "../Resource/Images/Mean.mp4";
};


#endif
