ddnet/src/engine/shared/video.h

40 lines
1,003 B
C
Raw Normal View History

#ifndef ENGINE_SHARED_VIDEO_H
#define ENGINE_SHARED_VIDEO_H
#include <base/system.h>
2022-03-02 08:32:51 +00:00
typedef void (*ISoundMixFunc)(short *pFinalOut, unsigned Frames);
class IVideo
{
public:
virtual ~IVideo(){};
virtual void Start() = 0;
virtual void Stop() = 0;
virtual void Pause(bool Pause) = 0;
virtual bool IsRecording() = 0;
virtual void NextVideoFrame() = 0;
virtual void NextVideoFrameThread() = 0;
virtual void NextAudioFrame(ISoundMixFunc Mix) = 0;
2022-03-02 08:32:51 +00:00
virtual void NextAudioFrameTimeline(ISoundMixFunc Mix) = 0;
static IVideo *Current() { return ms_pCurrentVideo; }
2021-06-23 05:05:49 +00:00
static int64_t Time() { return ms_Time; }
2017-10-26 20:31:02 +00:00
static float LocalTime() { return ms_LocalTime; }
2021-06-23 05:05:49 +00:00
static void SetLocalStartTime(int64_t LocalStartTime) { ms_LocalStartTime = LocalStartTime; }
static void SetFPS(int FPS) { ms_TickTime = time_freq() / FPS; }
protected:
static IVideo *ms_pCurrentVideo;
2021-06-23 05:05:49 +00:00
static int64_t ms_Time;
static int64_t ms_LocalStartTime;
static float ms_LocalTime;
2021-06-23 05:05:49 +00:00
static int64_t ms_TickTime;
};
#endif