-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathencoder.h
More file actions
40 lines (30 loc) · 742 Bytes
/
encoder.h
File metadata and controls
40 lines (30 loc) · 742 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
#ifndef ENCODER_H
#define ENCODER_H
#include <stdbool.h>
#include <stdint.h>
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include "opts.h"
typedef struct encoder encoder_t;
struct encoder {
const char *fname;
encopts_t *opt;
/* private members */
AVFormatContext *fmt_ctx;
AVCodecContext *codec_ctx;
AVFrame *frame;
AVPacket *pkt;
AVStream *stream;
int64_t pts;
/* non static methods */
bool (*open)(encoder_t *);
bool (*encode)(encoder_t *, const uint8_t *);
bool (*flush)(encoder_t *);
bool (*close)(encoder_t *);
};
encoder_t *new_encoder(
const char * /* fname */,
encopts_t * /* opt */);
void free_encoder(
encoder_t * /* enc */);
#endif