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:
|
2020-09-26 19:41:58 +00:00
|
|
|
virtual ~IVideo(){};
|
2016-08-30 23:39:59 +00:00
|
|
|
|
2020-06-22 21:59:37 +00:00
|
|
|
virtual void Start() = 0;
|
|
|
|
virtual void Stop() = 0;
|
|
|
|
virtual void Pause(bool Pause) = 0;
|
|
|
|
virtual bool IsRecording() = 0;
|
2016-08-30 23:39:59 +00:00
|
|
|
|
2020-06-22 21:59:37 +00:00
|
|
|
virtual void NextVideoFrame() = 0;
|
|
|
|
virtual bool FrameRendered() = 0;
|
|
|
|
virtual void NextVideoFrameThread() = 0;
|
2016-08-30 23:39:59 +00:00
|
|
|
|
2020-06-22 21:59:37 +00:00
|
|
|
virtual void NextAudioFrame(void (*Mix)(short *pFinalOut, unsigned Frames)) = 0;
|
|
|
|
virtual bool AudioFrameRendered() = 0;
|
|
|
|
virtual void NextAudioFrameTimeline() = 0;
|
2016-08-30 23:39:59 +00:00
|
|
|
|
2020-09-26 19:41:58 +00:00
|
|
|
static IVideo *Current() { return ms_pCurrentVideo; }
|
2016-08-30 23:39:59 +00:00
|
|
|
|
2020-06-22 21:59:37 +00:00
|
|
|
static int64 Time() { return ms_Time; }
|
2017-10-26 20:31:02 +00:00
|
|
|
static float LocalTime() { return ms_LocalTime; }
|
2016-08-30 23:39:59 +00:00
|
|
|
static void SetLocalStartTime(int64 LocalStartTime) { ms_LocalStartTime = LocalStartTime; }
|
2020-06-22 21:59:37 +00:00
|
|
|
static void SetFPS(int FPS) { ms_TickTime = time_freq() / FPS; }
|
2016-08-30 23:39:59 +00:00
|
|
|
|
|
|
|
protected:
|
2020-09-26 19:41:58 +00:00
|
|
|
static IVideo *ms_pCurrentVideo;
|
2016-08-30 23:39:59 +00:00
|
|
|
static int64 ms_Time;
|
|
|
|
static int64 ms_LocalStartTime;
|
|
|
|
static float ms_LocalTime;
|
|
|
|
static int64 ms_TickTime;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|