Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
CHelper_libKODI_game Class Reference

#include <libKODI_game.h>

Public Member Functions

 CHelper_libKODI_game (void)
 
 ~CHelper_libKODI_game (void)
 
bool RegisterMe (void *handle)
 Resolve all callback methods. More...
 
void CloseGame (void)
 Requests the frontend to stop the current game. More...
 
voidOpenStream (const game_stream_properties &properties)
 Create a stream for gameplay data. More...
 
bool GetStreamBuffer (void *stream, unsigned int width, unsigned int height, game_stream_buffer &buffer)
 Get a buffer for zero-copy stream data. More...
 
void AddStreamData (void *stream, const game_stream_packet &packet)
 Add a data packet to a stream. More...
 
void ReleaseStreamBuffer (void *stream, game_stream_buffer &buffer)
 Free an allocated buffer. More...
 
void CloseStream (void *stream)
 Free the specified stream. More...
 
game_proc_address_t HwGetProcAddress (const char *sym)
 Get a symbol from the hardware context. More...
 
bool InputEvent (const game_input_event &event)
 Notify the port of an input event. More...
 

Constructor & Destructor Documentation

◆ CHelper_libKODI_game()

CHelper_libKODI_game::CHelper_libKODI_game ( void  )
inline

◆ ~CHelper_libKODI_game()

CHelper_libKODI_game::~CHelper_libKODI_game ( void  )
inline

Member Function Documentation

◆ AddStreamData()

void CHelper_libKODI_game::AddStreamData ( void stream,
const game_stream_packet packet 
)
inline

Add a data packet to a stream.

Parameters
streamThe target stream
packetThe data packet

◆ CloseGame()

void CHelper_libKODI_game::CloseGame ( void  )
inline

Requests the frontend to stop the current game.

◆ CloseStream()

void CHelper_libKODI_game::CloseStream ( void stream)
inline

Free the specified stream.

Parameters
streamThe stream to close

◆ GetStreamBuffer()

bool CHelper_libKODI_game::GetStreamBuffer ( void stream,
unsigned int  width,
unsigned int  height,
game_stream_buffer buffer 
)
inline

Get a buffer for zero-copy stream data.

Parameters
streamThe stream handle
widthThe framebuffer width, or 0 for no width specified
heightThe framebuffer height, or 0 for no height specified
[out]bufferThe buffer, or unmodified if false is returned

If this returns true, buffer must be freed using ReleaseStreamBuffer().

Returns
True if buffer was set, false otherwise

◆ HwGetProcAddress()

game_proc_address_t CHelper_libKODI_game::HwGetProcAddress ( const char *  sym)
inline

Get a symbol from the hardware context.

Parameters
symThe symbol's name
Returns
A function pointer for the specified symbol

◆ InputEvent()

bool CHelper_libKODI_game::InputEvent ( const game_input_event event)
inline

Notify the port of an input event.

Parameters
eventThe input event

Input events can arrive for the following sources:

  • GAME_INPUT_EVENT_MOTOR
Returns
true if the event was handled, false otherwise

◆ OpenStream()

void * CHelper_libKODI_game::OpenStream ( const game_stream_properties properties)
inline

Create a stream for gameplay data.

Parameters
propertiesThe stream properties
Returns
A stream handle, or NULL on failure

◆ RegisterMe()

bool CHelper_libKODI_game::RegisterMe ( void handle)
inline

Resolve all callback methods.

Parameters
handlePointer to the add-on
Returns
True when all methods were resolved, false otherwise.

◆ ReleaseStreamBuffer()

void CHelper_libKODI_game::ReleaseStreamBuffer ( void stream,
game_stream_buffer buffer 
)
inline

Free an allocated buffer.

Parameters
streamThe stream handle
bufferThe buffer returned from GetStreamBuffer()

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