/* See LICENSE file for copyright and license details. */
#ifndef DECODE_H
#define DECODE_H
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include <libavutil/avutil.h>
#include <libswscale/swscale.h>
typedef struct {
AVFormatContext *fmt_ctx;
AVCodecContext *codec_ctx;
struct SwsContext *sws_gray;
struct SwsContext *sws_rgb;
int stream_idx;
int width;
int height;
} Decoder;
int dec_open(Decoder *d, const char *path);
int dec_read_frame(Decoder *d, AVFrame *frame);
double dec_frame_time(Decoder *d, AVFrame *frame);
void dec_close(Decoder *d);
#endif /* DECODE_H */