2016-08-30 23:39:59 +00:00
|
|
|
#ifndef ENGINE_SHARED_VIDEO_H
|
|
|
|
#define ENGINE_SHARED_VIDEO_H
|
|
|
|
|
|
|
|
#include <base/system.h>
|
|
|
|
|
|
|
|
class IVideo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~IVideo() {};
|
|
|
|
|
|
|
|
virtual void start() = 0;
|
|
|
|
virtual void stop() = 0;
|
2020-02-27 10:50:18 +00:00
|
|
|
virtual void pause() = 0;
|
2016-08-30 23:39:59 +00:00
|
|
|
|
|
|
|
virtual void nextVideoFrame() = 0;
|
|
|
|
virtual bool frameRendered() = 0;
|
|
|
|
virtual void nextVideoFrame_thread() = 0;
|
|
|
|
|
2019-11-02 08:09:00 +00:00
|
|
|
virtual void nextAudioFrame(void (*Mix)(short *pFinalOut, unsigned Frames)) = 0;
|
2020-01-08 06:25:06 +00:00
|
|
|
virtual bool aframeRendered() = 0;
|
2019-11-02 08:09:00 +00:00
|
|
|
virtual void nextAudioFrame_timeline() = 0;
|
2016-08-30 23:39:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
static IVideo* Current() { return ms_pCurrentVideo; }
|
|
|
|
|
2017-10-26 20:31:02 +00:00
|
|
|
static int64 time() { return ms_Time; }
|
|
|
|
static float LocalTime() { return ms_LocalTime; }
|
2016-08-30 23:39:59 +00:00
|
|
|
static void SetLocalStartTime(int64 LocalStartTime) { ms_LocalStartTime = LocalStartTime; }
|
|
|
|
static void SetFPS(int fps) { ms_TickTime = time_freq() / fps; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static IVideo* ms_pCurrentVideo;
|
|
|
|
static int64 ms_Time;
|
|
|
|
static int64 ms_LocalStartTime;
|
|
|
|
static float ms_LocalTime;
|
|
|
|
static int64 ms_TickTime;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|