kodi
Public Member Functions | List of all members
KODI::RETRO::CBasicMemoryStream Class Reference
Inheritance diagram for KODI::RETRO::CBasicMemoryStream:
Inheritance graph
[legend]
Collaboration diagram for KODI::RETRO::CBasicMemoryStream:
Collaboration graph
[legend]

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
 Return the number of frames behind the current frame.
 
uint64_t RewindFrames (uint64_t frameCount) override
 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...
 

Member Function Documentation

◆ AdvanceFrames()

uint64_t KODI::RETRO::CBasicMemoryStream::AdvanceFrames ( uint64_t  frameCount)
inlineoverridevirtual

Seek ahead the specified number of frames.

Returns
The number of frames advanced

Implements KODI::RETRO::IMemoryStream.

◆ BeginFrame()

uint8_t * CBasicMemoryStream::BeginFrame ( )
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.

◆ CurrentFrame()

const uint8_t * CBasicMemoryStream::CurrentFrame ( ) const
overridevirtual

Get a pointer to the current frame.

This function must have no side effects. The pointer is valid until the stream is modified.

Returns
A buffer of size FrameSize(), or nullptr if the stream is empty

Implements KODI::RETRO::IMemoryStream.

◆ FutureFramesAvailable()

uint64_t KODI::RETRO::CBasicMemoryStream::FutureFramesAvailable ( ) const
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.

◆ GetFrameCounter()

uint64_t KODI::RETRO::CBasicMemoryStream::GetFrameCounter ( ) const
inlineoverridevirtual

Get the total number of frames played until the current frame.

Returns
The history of the current frame, or 0 for unknown

Implements KODI::RETRO::IMemoryStream.

◆ Init()

void CBasicMemoryStream::Init ( size_t  frameSize,
uint64_t  maxFrameCount 
)
overridevirtual

Initialize memory stream.

Parameters
frameSizeThe size of the serialized memory state
maxFrameCountThe maximum number of frames this stream can hold

Implements KODI::RETRO::IMemoryStream.

◆ RewindFrames()

uint64_t KODI::RETRO::CBasicMemoryStream::RewindFrames ( uint64_t  frameCount)
inlineoverridevirtual

Seek backwards the specified number of frames.

Returns
The number of frames rewound

Implements KODI::RETRO::IMemoryStream.

◆ SetFrameCounter()

void KODI::RETRO::CBasicMemoryStream::SetFrameCounter ( uint64_t  frameCount)
inlineoverridevirtual

Set the total number of frames played until the current frame.

Parameters
frameCountThe history of the current frame

Implements KODI::RETRO::IMemoryStream.

◆ SetMaxFrameCount()

void KODI::RETRO::CBasicMemoryStream::SetMaxFrameCount ( uint64_t  maxFrameCount)
inlineoverridevirtual

Update the max frame count.

Old frames may be deleted if the max frame count is reduced.

Implements KODI::RETRO::IMemoryStream.


The documentation for this class was generated from the following files: