~ft/mcfs

ref: 49dc43fd64bb77001494be6721380895f1bba971 mcfs/packet.h -rw-r--r-- 1.2 KiB
49dc43fd — Sigrid Solveig Haflínudóttir matroska: handle av1 9 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
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
59
60
typedef struct Packet Packet;
typedef struct Packetctx Packetctx;

typedef int (*packet_f)(Biobuf *out, Packetctx *ctx, Packet *p, int np, uvlong ts, int key);

struct Packet {
	uchar *data;
	int sz;
};

struct Packetctx {
	uvlong frid;
	uvlong duration;
	uvlong seekpreroll;
	vlong discardpad;
	vlong blockdur;
	struct {
		char name[16];
		vlong delay;
		struct {
			uchar *data;
			int sz;
		}priv;
	}codec;
	struct {
		uchar *data;
		int sz;
		int algo;
	}comp;
	u32int trackuid;
	u32int fmt;

	struct {
		int width;
		int height;
	}video;
	struct {
		float samplerate;
		float outsamplerate;
		int channels;
		int bps;
	}audio;

	/* private stuff for packet_f functions */
	uchar adts[7];
	struct {
		uchar *p;
		int n;
	}ps[16];
	int nps;
	int key;
	int nonkey;
	int kfgshift;
};

int aacpacket(Biobuf *out, Packetctx *ctx, Packet *p, int np, uvlong ts, int key);
int asspacket(Biobuf *out, Packetctx *ctx, Packet *p, int np, uvlong ts, int key);
int ivfpacket(Biobuf *out, Packetctx *ctx, Packet *p, int np, uvlong ts, int key);
int oggpacket(Biobuf *out, Packetctx *ctx, Packet *p, int np, uvlong ts, int key);
int srtpacket(Biobuf *out, Packetctx *ctx, Packet *p, int np, uvlong ts, int key);