-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdecoder.h
More file actions
49 lines (33 loc) · 841 Bytes
/
decoder.h
File metadata and controls
49 lines (33 loc) · 841 Bytes
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
44
45
46
47
48
49
#ifndef DECODER_H
#define DECODER_H
#include <stdbool.h>
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include "opts.h"
struct SwsContext;
typedef struct decoder decoder_t;
struct decoder {
char *fname;
double fps;
int64_t duration;
uint64_t frames;
uint32_t width;
uint32_t height;
size_t _vidx;
bool _exhausted;
decopts_t *dopts;
enum AVPixelFormat target_fmt;
struct SwsContext *sws_ctx;
AVFormatContext *fmt_ctx;
AVStream *stream;
AVCodecParameters *cparams;
AVCodecContext *dec_ctx;
AVFrame *frame;
AVPacket *pkt;
bool (*end)(decoder_t *);
bool (*close)(decoder_t *);
uint8_t *(*next)(decoder_t *);
};
decoder_t *new_decoder(const char *fname, decopts_t *dopts);
void free_decoder(decoder_t *it);
#endif