prosperon/source/engine/datastream.h

42 lines
873 B
C
Raw Normal View History

2021-11-30 21:29:18 -06:00
#ifndef DATASTREAM_H
#define DATASTREAM_H
2022-02-06 10:14:57 -06:00
#include <pl_mpeg.h>
2023-05-12 13:22:05 -05:00
#include <stdint.h>
2023-11-27 14:29:55 -06:00
#include "dsp.h"
2022-07-19 15:13:15 -05:00
2023-05-19 09:55:57 -05:00
#include "sokol/sokol_gfx.h"
2022-07-19 15:13:15 -05:00
struct soundstream;
2021-11-30 21:29:18 -06:00
struct datastream {
2023-05-12 13:22:05 -05:00
plm_t *plm;
2023-05-19 09:55:57 -05:00
sg_image img;
sg_image y;
sg_image cr;
sg_image cb;
2023-05-19 09:55:57 -05:00
int width;
int height;
int dirty;
2023-11-27 14:29:55 -06:00
soundbyte *ring;
2021-11-30 21:29:18 -06:00
};
typedef struct datastream datastream;
struct texture;
2022-07-02 03:40:50 -05:00
void datastream_free(datastream *ds);
2023-11-27 14:29:55 -06:00
struct datastream *ds_openvideo(const char *path);
struct texture *ds_maketexture(struct datastream *);
2022-07-02 03:40:50 -05:00
void ds_advance(struct datastream *ds, double);
void ds_seek(struct datastream *ds, double);
2022-01-19 16:43:21 -06:00
void ds_advanceframes(struct datastream *ds, int frames);
2021-11-30 21:29:18 -06:00
void ds_pause(struct datastream *ds);
void ds_stop(struct datastream *ds);
int ds_videodone(struct datastream *ds);
double ds_remainingtime(struct datastream *ds);
2022-01-19 16:43:21 -06:00
double ds_length(struct datastream *ds);
2021-11-30 21:29:18 -06:00
#endif