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>
|
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;
|
|
|
|
int audio_device;
|
2023-05-19 09:55:57 -05:00
|
|
|
sg_image img;
|
|
|
|
int width;
|
|
|
|
int height;
|
2023-05-12 13:22:05 -05:00
|
|
|
struct soundstream *astream;
|
2021-11-30 21:29:18 -06:00
|
|
|
};
|
|
|
|
|
2022-07-02 03:40:50 -05:00
|
|
|
struct Texture;
|
|
|
|
|
2023-09-04 01:20:55 -05:00
|
|
|
void MakeDatastream();
|
2022-07-02 03:40:50 -05:00
|
|
|
void ds_openvideo(struct datastream *ds, const char *path, const char *adriver);
|
2023-05-12 13:22:05 -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
|