shithub: mcfs

ref: 0cb8bd19aa3e819f28484ac1fda7ed20845f2c8c
dir: mcfs/packet.h

View raw version
typedef struct Packet Packet;
typedef struct Packetctx Packetctx;

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

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;
	u32int trackuid;
	u32int fmt;

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

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