Kodi Documentation 23.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches

Class: kodi::addon::CInstanceGame::CStream

Game stream handler More...

Classes

class  kodi::addon::CInstanceGame::CStream
 

Functions

bool kodi::addon::CInstanceGame::CStream::Open (const game_stream_properties &properties)
 Create a stream for gameplay data.
 
void kodi::addon::CInstanceGame::CStream::Close ()
 Free the specified stream.
 
bool kodi::addon::CInstanceGame::CStream::GetBuffer (unsigned int width, unsigned int height, game_stream_buffer &buffer)
 Get a buffer for zero-copy stream data.
 
void kodi::addon::CInstanceGame::CStream::AddData (const game_stream_packet &packet)
 Add a data packet to a stream.
 
void kodi::addon::CInstanceGame::CStream::ReleaseBuffer (game_stream_buffer &buffer)
 Free an allocated buffer.
 
bool kodi::addon::CInstanceGame::CStream::IsOpen () const
 Check if the stream opened correctly, e.g. after calling the constructor.
 

Detailed Description

Class: kodi::addon::CInstanceGame::CStream

Game stream handler

This class will be integrated into the addon, which can then open it if necessary for the processing of an audio or video stream.

Note
Callback to Kodi class

Function Documentation

◆ AddData()

void kodi::addon::CInstanceGame::CStream::AddData ( const game_stream_packet & packet)
inline

Add a data packet to a stream.

Parameters
[in]packetThe data packet

Hardware packets carry the current frame size, display aspect ratio and rotation. Rotation affects presentation geometry; it does not change the framebuffer contents or the context's bottom-left-origin setting.

Remarks
Only called from the add-on itself

◆ Close()

void kodi::addon::CInstanceGame::CStream::Close ( )
inline

Free the specified stream.

Remarks
Only called from the add-on itself

◆ GetBuffer()

bool kodi::addon::CInstanceGame::CStream::GetBuffer ( unsigned int width,
unsigned int height,
game_stream_buffer & buffer )
inline

Get a buffer for zero-copy stream data.

Parameters
[in]widthThe framebuffer width, or 0 for no width specified
[in]heightThe framebuffer height, or 0 for no height specified
[out]bufferThe buffer, or unmodified if false is returned
Returns
True if buffer was set, false otherwise
Note
If this returns true, buffer must be freed using ReleaseBuffer()
Remarks
Only called from the add-on itself

◆ IsOpen()

bool kodi::addon::CInstanceGame::CStream::IsOpen ( ) const
inline

Check if the stream opened correctly, e.g. after calling the constructor.

Returns
True if stream was successfully opened, false otherwise
Remarks
Only called from the add-on itself

◆ Open()

bool kodi::addon::CInstanceGame::CStream::Open ( const game_stream_properties & properties)
inline

Create a stream for gameplay data.

Parameters
[in]propertiesThe stream properties

Hardware streams are reset once after their handle is installed. Reset may use GetBuffer(); reset failure releases that stream.

Returns
True if the stream is ready, false otherwise
Remarks
Only called from the add-on itself

◆ ReleaseBuffer()

void kodi::addon::CInstanceGame::CStream::ReleaseBuffer ( game_stream_buffer & buffer)
inline

Free an allocated buffer.

Parameters
[in]bufferThe buffer returned from GetStreamBuffer()
Remarks
Only called from the add-on itself