kodi
|
Public Member Functions | |
void | Init (size_t frameSize, uint64_t maxFrameCount) override |
Initialize memory stream. More... | |
void | Reset () override |
Free any resources used by this stream. | |
size_t | FrameSize () const override |
Return the frame size passed to Init() | |
uint64_t | MaxFrameCount () const override |
Return the current max frame count. | |
void | SetMaxFrameCount (uint64_t maxFrameCount) override |
Update the max frame count. More... | |
uint8_t * | BeginFrame () override |
void | SubmitFrame () override |
Indicate that a frame of size FrameSize() has been written to the location returned from BeginFrame() | |
const uint8_t * | CurrentFrame () const override |
Get a pointer to the current frame. More... | |
uint64_t | FutureFramesAvailable () const override |
Return the number of frames ahead of the current frame. More... | |
uint64_t | AdvanceFrames (uint64_t frameCount) override |
Seek ahead the specified number of frames. More... | |
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. More... | |
uint64_t | GetFrameCounter () const override |
Get the total number of frames played until the current frame. More... | |
void | SetFrameCounter (uint64_t frameCount) override |
Set the total number of frames played until the current frame. More... | |
Protected Member Functions | |
virtual void | SubmitFrameInternal ()=0 |
virtual void | CullPastFrames (uint64_t frameCount)=0 |
uint64_t | BufferSize () const |
Protected Attributes | |
size_t | m_paddedFrameSize |
uint64_t | m_maxFrames |
std::unique_ptr< uint32_t[]> | m_currentFrame |
Simple double-buffering. More... | |
std::unique_ptr< uint32_t[]> | m_nextFrame |
bool | m_bHasCurrentFrame |
bool | m_bHasNextFrame |
uint64_t | m_currentFrameHistory |
|
inlineoverridevirtual |
Seek ahead the specified number of frames.
Implements KODI::RETRO::IMemoryStream.
|
overridevirtual |
\ brief Get a pointer to which FrameSize() bytes can be written
The buffer exposed by this function is passed to the game client, which fills it with a serialization of its current state.
Implements KODI::RETRO::IMemoryStream.
|
overridevirtual |
Get a pointer to the current frame.
This function must have no side effects. The pointer is valid until the stream is modified.
Implements KODI::RETRO::IMemoryStream.
|
inlineoverridevirtual |
Return the number of frames ahead of the current frame.
If the stream supports forward seeking, frames that are passed over during a "rewind" operation can be recovered again.
Implements KODI::RETRO::IMemoryStream.
|
inlineoverridevirtual |
Get the total number of frames played until the current frame.
Implements KODI::RETRO::IMemoryStream.
|
overridevirtual |
Initialize memory stream.
frameSize | The size of the serialized memory state |
maxFrameCount | The maximum number of frames this stream can hold |
Implements KODI::RETRO::IMemoryStream.
|
overridepure virtual |
Seek backwards the specified number of frames.
Implements KODI::RETRO::IMemoryStream.
Implemented in KODI::RETRO::CDeltaPairMemoryStream.
|
inlineoverridevirtual |
Set the total number of frames played until the current frame.
frameCount | The history of the current frame |
Implements KODI::RETRO::IMemoryStream.
|
overridevirtual |
Update the max frame count.
Old frames may be deleted if the max frame count is reduced.
Implements KODI::RETRO::IMemoryStream.
|
protected |
Simple double-buffering.
After XORing the two states, the next becomes the current, and the current becomes a buffer for the next call to CGameClient::Serialize().