ref: 3f03592d6961c9f33b681b3269803739766b0c4b
dir: /stream.h/
typedef struct Stream Stream; typedef struct Streamhdr Streamhdr; typedef struct Streamframe Streamframe; typedef struct Streaminfo Streaminfo; typedef struct Streamops Streamops; #pragma incomplete Stream enum { Svideo, Saudio, /* video */ FmtAV1 = 0, FmtVP9, FmtVP8, /* audio */ FmtAAC, FmtOpus, }; struct Streamframe { u8int *buf; int sz; uvlong offset; uvlong timestamp; }; struct Streamops { Stream *(*open)(char *filename, int *num, int *failed); u8int *(*alloc)(void *aux, int sz); void (*close)(Stream *s); vlong (*offset)(Stream *s); int (*read)(Stream *s, Streamframe *f); void *aux; }; struct Streaminfo { int type; int fmt; struct { uvlong denum, num; }timebase; union { struct { int w, h; }video; struct { int nchan; int srate; }audio; }; }; struct Stream { Streaminfo; Streamops ops; /* private stuff */ void *b; u8int *buf; int bufsz; }; Stream *Sopen(char *filename, int *num); vlong Soffset(Stream *s); void Sclose(Stream *s); int Sread(Stream *s, Streamframe *f);