Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Stream of serialized states from game clients. More...
#include <IMemoryStream.h>
Public Member Functions | |
virtual | ~IMemoryStream ()=default |
virtual void | Init (size_t frameSize, uint64_t maxFrameCount)=0 |
Initialize memory stream. | |
virtual void | Reset ()=0 |
Free any resources used by this stream. | |
virtual size_t | FrameSize () const =0 |
Return the frame size passed to Init() | |
virtual uint64_t | MaxFrameCount () const =0 |
Return the current max frame count. | |
virtual void | SetMaxFrameCount (uint64_t maxFrameCount)=0 |
Update the max frame count. | |
virtual uint8_t * | BeginFrame ()=0 |
virtual void | SubmitFrame ()=0 |
Indicate that a frame of size FrameSize() has been written to the location returned from BeginFrame() | |
virtual const uint8_t * | CurrentFrame () const =0 |
Get a pointer to the current frame. | |
virtual uint64_t | FutureFramesAvailable () const =0 |
Return the number of frames ahead of the current frame. | |
virtual uint64_t | AdvanceFrames (uint64_t frameCount)=0 |
Seek ahead the specified number of frames. | |
virtual uint64_t | PastFramesAvailable () const =0 |
Return the number of frames behind the current frame. | |
virtual uint64_t | RewindFrames (uint64_t frameCount)=0 |
Seek backwards the specified number of frames. | |
virtual uint64_t | GetFrameCounter () const =0 |
Get the total number of frames played until the current frame. | |
virtual void | SetFrameCounter (uint64_t frameCount)=0 |
Set the total number of frames played until the current frame. | |
Stream of serialized states from game clients.
A memory stream is composed of "frames" of memory representing serialized states of the game client. For each video frame run by the game loop, the game client's state is serialized into a buffer provided by this interface.
Implementation of three types of memory streams are provided:
Basic memory stream: has only a current frame, and supports neither rewind nor forward seeking.
Linear memory stream: can grow in one direction. It is possible to rewind, but not fast-forward.
Nonlinear memory stream: can have frames both ahead of and behind the current frame. If a stream is rewound, it is possible to recover these frames by seeking forward again.
|
virtualdefault |
|
pure virtual |
Seek ahead the specified number of frames.
Implemented in KODI::RETRO::CBasicMemoryStream, and KODI::RETRO::CLinearMemoryStream.
|
pure virtual |
\ 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.
Implemented in KODI::RETRO::CBasicMemoryStream, and KODI::RETRO::CLinearMemoryStream.
|
pure virtual |
Get a pointer to the current frame.
This function must have no side effects. The pointer is valid until the stream is modified.
Implemented in KODI::RETRO::CBasicMemoryStream, and KODI::RETRO::CLinearMemoryStream.
|
pure virtual |
Return the frame size passed to Init()
Implemented in KODI::RETRO::CBasicMemoryStream, and KODI::RETRO::CLinearMemoryStream.
|
pure virtual |
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.
Implemented in KODI::RETRO::CBasicMemoryStream, and KODI::RETRO::CLinearMemoryStream.
|
pure virtual |
Get the total number of frames played until the current frame.
Implemented in KODI::RETRO::CBasicMemoryStream, and KODI::RETRO::CLinearMemoryStream.
|
pure virtual |
Initialize memory stream.
frameSize | The size of the serialized memory state |
maxFrameCount | The maximum number of frames this stream can hold |
Implemented in KODI::RETRO::CBasicMemoryStream, and KODI::RETRO::CLinearMemoryStream.
|
pure virtual |
Return the current max frame count.
Implemented in KODI::RETRO::CBasicMemoryStream, and KODI::RETRO::CLinearMemoryStream.
|
pure virtual |
Return the number of frames behind the current frame.
Implemented in KODI::RETRO::CBasicMemoryStream, KODI::RETRO::CDeltaPairMemoryStream, and KODI::RETRO::CLinearMemoryStream.
|
pure virtual |
Free any resources used by this stream.
Implemented in KODI::RETRO::CBasicMemoryStream, KODI::RETRO::CDeltaPairMemoryStream, and KODI::RETRO::CLinearMemoryStream.
|
pure virtual |
Seek backwards the specified number of frames.
Implemented in KODI::RETRO::CBasicMemoryStream, KODI::RETRO::CDeltaPairMemoryStream, and KODI::RETRO::CLinearMemoryStream.
|
pure virtual |
Set the total number of frames played until the current frame.
frameCount | The history of the current frame |
Implemented in KODI::RETRO::CBasicMemoryStream, and KODI::RETRO::CLinearMemoryStream.
|
pure virtual |
Update the max frame count.
Old frames may be deleted if the max frame count is reduced.
Implemented in KODI::RETRO::CBasicMemoryStream, and KODI::RETRO::CLinearMemoryStream.
|
pure virtual |
Indicate that a frame of size FrameSize() has been written to the location returned from BeginFrame()
Implemented in KODI::RETRO::CBasicMemoryStream, and KODI::RETRO::CLinearMemoryStream.