DDraceNetwork Docs
video.h
Go to the documentation of this file.
1#ifndef ENGINE_SHARED_VIDEO_H
2#define ENGINE_SHARED_VIDEO_H
3
4#include <base/system.h>
5
6#include <functional>
7
8typedef std::function<void(short *pFinalOut, unsigned Frames)> ISoundMixFunc;
9
10class IVideo
11{
12public:
13 virtual ~IVideo(){};
14
15 virtual bool Start() = 0;
16 virtual void Stop() = 0;
17 virtual void Pause(bool Pause) = 0;
18 virtual bool IsRecording() = 0;
19
20 virtual void NextVideoFrame() = 0;
21 virtual void NextVideoFrameThread() = 0;
22
23 virtual void NextAudioFrame(ISoundMixFunc Mix) = 0;
25
26 static IVideo *Current() { return ms_pCurrentVideo; }
27
28 static int64_t Time() { return ms_Time; }
29 static float LocalTime() { return ms_LocalTime; }
30 static void SetLocalStartTime(int64_t LocalStartTime) { ms_LocalStartTime = LocalStartTime; }
31 static void SetFPS(int FPS) { ms_TickTime = time_freq() / FPS; }
32
33protected:
35 static int64_t ms_Time;
36 static int64_t ms_LocalStartTime;
37 static float ms_LocalTime;
38 static int64_t ms_TickTime;
39};
40
41#endif
Definition: video.h:11
virtual ~IVideo()
Definition: video.h:13
virtual void NextVideoFrame()=0
static float ms_LocalTime
Definition: video.h:37
virtual void Pause(bool Pause)=0
static float LocalTime()
Definition: video.h:29
virtual bool IsRecording()=0
virtual void NextAudioFrame(ISoundMixFunc Mix)=0
static void SetLocalStartTime(int64_t LocalStartTime)
Definition: video.h:30
virtual void NextVideoFrameThread()=0
static void SetFPS(int FPS)
Definition: video.h:31
static int64_t ms_LocalStartTime
Definition: video.h:36
static IVideo * ms_pCurrentVideo
Definition: video.h:34
virtual void Stop()=0
virtual bool Start()=0
static int64_t Time()
Definition: video.h:28
static int64_t ms_Time
Definition: video.h:35
static int64_t ms_TickTime
Definition: video.h:38
static IVideo * Current()
Definition: video.h:26
virtual void NextAudioFrameTimeline(ISoundMixFunc Mix)=0
int64_t time_freq()
Definition: system.cpp:953
std::function< void(short *pFinalOut, unsigned Frames)> ISoundMixFunc
Definition: video.h:8