Decoder.h 815 Bytes
Newer Older
lijian6's avatar
lijian6 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* 
 * 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