~kris/hacks

sframe

sframe/src/decode.h -rw-r--r-- 602 bytes
0d0fb70a — Kris Yotam convert README.md to README.txt 4 months ago
                                                                                
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
/* 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 */