-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.h
58 lines (52 loc) · 1.62 KB
/
common.h
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
50
51
52
53
54
55
56
57
58
#ifndef YP_COMMON_H_
#define YP_COMMON_H_
#include <libavformat/avformat.h>
typedef struct YPInputStream {
const char *filename;
AVFormatContext *ctx;
int stream_idx;
int is_video;
int is_audio;
unsigned int set_id; // Adaptation set
unsigned int stream_id; // Representation
unsigned int period_id; // Period
} YPInputStream;
typedef struct YPOutputStream {
AVFormatContext *ctx;
} YPOutputStream;
typedef struct YPConfig {
YPInputStream **instreams;
char *outdir;
char *index_fname;
char *profile;
int min_buffer;
int seg_duration;
int verbose;
int has_video;
int has_audio;
int single_file;
int segment_template;
int segment_timeline;
} YPConfig;
typedef struct YPIndexHandlerClass {
void *opaque;
int (*init)(struct YPIndexHandlerClass *self, YPConfig *config);
int (*add_segment)(struct YPIndexHandlerClass
*self, YPInputStream *instream,
char *filename,
int64_t pos,
int64_t size,
double duration,
int num);
int (*finalize)(struct YPIndexHandlerClass *self);
} YPIndexHandlerClass;
typedef struct YPMuxerClass {
void *opaque; // Muxer private data
struct YPIndexHandlerClass *index;
int (*init)(struct YPMuxerClass *self, YPConfig *config, int instream_index);
int (*handle_packet)(struct YPMuxerClass *self,
struct YPInputStream* instream,
AVPacket *pkt);
int (*finalize)(struct YPMuxerClass *self);
} YPMuxerClass;
#endif // YP_COMMON_H_