summaryrefslogtreecommitdiffstats
path: root/common/encode.h
blob: 996fe6685719f2695c1c19da0ba68add6a9af880 (plain)
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 MPLAYER_ENCODE_H
#define MPLAYER_ENCODE_H

#include <stdbool.h>

#include "demux/demux.h"

struct mpv_global;
struct mp_log;
struct encode_lavc_context;

struct encode_opts {
    char *file;
    char *format;
    char **fopts;
    float fps;
    float maxfps;
    char *vcodec;
    char **vopts;
    char *acodec;
    char **aopts;
    int harddup;
    float voffset;
    float aoffset;
    int copyts;
    int rawts;
    int autofps;
    int neverdrop;
    int video_first;
    int audio_first;
    int metadata;
};

// interface for mplayer.c
struct encode_lavc_context *encode_lavc_init(struct encode_opts *options,
                                             struct mpv_global *global);
void encode_lavc_finish(struct encode_lavc_context *ctx);
void encode_lavc_free(struct encode_lavc_context *ctx);
void encode_lavc_discontinuity(struct encode_lavc_context *ctx);
bool encode_lavc_showhelp(struct mp_log *log, struct encode_opts *options);
int encode_lavc_getstatus(struct encode_lavc_context *ctx, char *buf, int bufsize, float relative_position);
void encode_lavc_expect_stream(struct encode_lavc_context *ctx, int mt);
void encode_lavc_set_metadata(struct encode_lavc_context *ctx,
                              struct mp_tags *metadata);
void encode_lavc_set_video_fps(struct encode_lavc_context *ctx, float fps);
void encode_lavc_set_audio_pts(struct encode_lavc_context *ctx, double pts);
bool encode_lavc_didfail(struct encode_lavc_context *ctx); // check if encoding failed

#endif