11 #include "IMemoryStream.h" 28 void Init(
size_t frameSize, uint64_t maxFrameCount)
override;
29 void Reset()
override;
30 size_t FrameSize()
const override {
return m_frameSize; }
41 void SetFrameCounter(uint64_t frameCount)
override { m_currentFrameHistory = frameCount; }
44 virtual void SubmitFrameInternal() = 0;
45 virtual void CullPastFrames(uint64_t frameCount) = 0;
48 uint64_t BufferSize()
const;
50 size_t m_paddedFrameSize;
59 std::unique_ptr<uint32_t[]> m_nextFrame;
60 bool m_bHasCurrentFrame;
63 uint64_t m_currentFrameHistory;
uint64_t AdvanceFrames(uint64_t frameCount) override
Seek ahead the specified number of frames.
Definition: LinearMemoryStream.h:37
uint64_t FutureFramesAvailable() const override
Return the number of frames ahead of the current frame.
Definition: LinearMemoryStream.h:36
std::unique_ptr< uint32_t[]> m_currentFrame
Simple double-buffering.
Definition: LinearMemoryStream.h:58
size_t FrameSize() const override
Return the frame size passed to Init()
Definition: LinearMemoryStream.h:30
uint64_t GetFrameCounter() const override
Get the total number of frames played until the current frame.
Definition: LinearMemoryStream.h:40
void Reset() override
Free any resources used by this stream.
Definition: LinearMemoryStream.cpp:31
uint64_t MaxFrameCount() const override
Return the current max frame count.
Definition: LinearMemoryStream.h:31
void Init(size_t frameSize, uint64_t maxFrameCount) override
Initialize memory stream.
Definition: LinearMemoryStream.cpp:22
const uint8_t * CurrentFrame() const override
Get a pointer to the current frame.
Definition: LinearMemoryStream.cpp:76
uint64_t PastFramesAvailable() const override=0
Return the number of frames behind the current frame.
uint64_t RewindFrames(uint64_t frameCount) override=0
Seek backwards the specified number of frames.
Definition: AudioDecoder.h:18
void SubmitFrame() override
Indicate that a frame of size FrameSize() has been written to the location returned from BeginFrame()...
Definition: LinearMemoryStream.cpp:84
void SetMaxFrameCount(uint64_t maxFrameCount) override
Update the max frame count.
Definition: LinearMemoryStream.cpp:43
Definition: LinearMemoryStream.h:20
Stream of serialized states from game clients.
Definition: IMemoryStream.h:43
void SetFrameCounter(uint64_t frameCount) override
Set the total number of frames played until the current frame.
Definition: LinearMemoryStream.h:41
uint8_t * BeginFrame() override
Definition: LinearMemoryStream.cpp:59