summaryrefslogtreecommitdiff
path: root/ffmpeg_backend.h
blob: d6a6a661fc883079500a95513d26731d792c0efe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
struct av_codec_info {
    real32 AvgPTSPerFrame;

    AVFormatContext *FileFormatContext;
    AVCodecParameters *VideoCodecParameters;
    const AVCodec* VideoCodec;
    const AVCodecHWConfig* VideoHWConfig;
    // AVPixelFormat HWPixFormat;
    AVCodecContext *VideoCodecContext;
    AVStream *VideoStream;
};

struct av_packet_info {
    uint64 PreviousPTS = -1; // PTS value of the previous frame, used to check timings.

    AVPacket *VideoPacket;
    AVFrame *VideoFrame;
    SwsContext *RGBContext;
};

static bool32 AV_TryFrame(av_codec_info *AV, av_packet_info *AVPacket, int32 *err);     // Internal attempt to decode a frame. Typically run in a while loop until it returns true.