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;
|
|
|
|
double last_time;
|
|
|
|
int playing;
|
2023-05-19 09:55:57 -05:00
|
|
|
sg_image img;
|
|
|
|
int width;
|
|
|
|
int height;
|
2023-11-27 14:29:55 -06:00
|
|
|
soundbyte *ring;
|
2021-11-30 21:29:18 -06:00
|
|
|
};
|
|
|
|
|
2024-03-13 03:51:44 -05:00
|
|
|
struct texture;
|
2022-07-02 03:40:50 -05:00
|
|
|
|
2023-09-04 01:20:55 -05:00
|
|
|
void MakeDatastream();
|
2023-11-27 14:29:55 -06:00
|
|
|
struct datastream *ds_openvideo(const char *path);
|
2024-03-13 03:51:44 -05:00
|
|
|
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
|