Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
KODI::RETRO::CRPRenderManager Class Reference

Renders video frames provided by the game loop. More...

#include <RPRenderManager.h>

Inheritance diagram for KODI::RETRO::CRPRenderManager:
KODI::RETRO::IRenderManager KODI::RETRO::IRenderCallback

Public Member Functions

 CRPRenderManager (CRPProcessInfo &processInfo)
 
 ~CRPRenderManager () override=default
 
void Initialize ()
 
void Deinitialize ()
 
CGUIRenderTargetFactoryGetGUIRenderTargetFactory ()
 Access the factory for creating GUI render targets.
 
AVPixelFormat GetPixelFormat () const
 
unsigned int GetNominalWidth () const
 
unsigned int GetNominalHeight () const
 
unsigned int GetMaxWidth () const
 
unsigned int GetMaxHeight () const
 
float GetPixelAspectRatio () const
 
bool Configure (AVPixelFormat format, unsigned int nominalWidth, unsigned int nominalHeight, unsigned int maxWidth, unsigned int maxHeight, float pixelAspectRatio)
 
bool GetVideoBuffer (unsigned int width, unsigned int height, VideoStreamBuffer &buffer)
 
void AddFrame (const uint8_t *data, size_t size, unsigned int width, unsigned int height, unsigned int orientationDegCW)
 
void Flush ()
 
void SetSpeed (double speed)
 
void FrameMove ()
 
void RenderWindow (bool bClear, const RESOLUTION_INFO &coordsRes) override
 Render a fullscreen window.
 
void RenderControl (bool bClear, bool bUseAlpha, const CRect &renderRegion, const IGUIRenderSettings *renderSettings) override
 Render a game control.
 
void ClearBackground () override
 Clear the background of a fullscreen window.
 
bool SupportsRenderFeature (RENDERFEATURE feature) const override
 
bool SupportsScalingMethod (SCALINGMETHOD method) const override
 
void SaveThumbnail (const std::string &thumbnailPath)
 
void CacheVideoFrame (const std::string &savestatePath)
 
void SaveVideoFrame (const std::string &savestatePath, ISavestate &savestate)
 
void ClearVideoFrame (const std::string &savestatePath)
 
- Public Member Functions inherited from KODI::RETRO::IRenderManager
virtual ~IRenderManager ()=default
 
- Public Member Functions inherited from KODI::RETRO::IRenderCallback
virtual ~IRenderCallback ()=default
 

Detailed Description

Renders video frames provided by the game loop.

Generally, buffer pools are registered by the windowing subsystem. A buffer pool provides a software or hardware buffer to store the added frame. When RenderManager is created, it instantiates all registered buffer pools.

When a frame arrives, it is copied into a buffer from each buffer pool with a visible renderer. For example, if a GLES and MMAL renderer are both visible in the GUI, then the frame will be copied into two buffers.

When it is time to render the frame, the GUI control or window calls into this class through the IRenderManager interface. RenderManager selects an appropriate renderer to use to render the frame. The renderer is then given the buffer that came from its buffer pool.

Special behavior is needed when the game is paused. As no new frames are delivered, a newly created renderer will stay black. For this scenario, when we detect a pause event, the frame is preemptively cached so that a newly created renderer will have something to display.

Constructor & Destructor Documentation

◆ CRPRenderManager()

CRPRenderManager::CRPRenderManager ( CRPProcessInfo & processInfo)

◆ ~CRPRenderManager()

KODI::RETRO::CRPRenderManager::~CRPRenderManager ( )
overridedefault

Member Function Documentation

◆ AddFrame()

void CRPRenderManager::AddFrame ( const uint8_t * data,
size_t size,
unsigned int width,
unsigned int height,
unsigned int orientationDegCW )

◆ CacheVideoFrame()

void CRPRenderManager::CacheVideoFrame ( const std::string & savestatePath)

◆ ClearBackground()

void CRPRenderManager::ClearBackground ( )
overridevirtual

Clear the background of a fullscreen window.

Implements KODI::RETRO::IRenderManager.

◆ ClearVideoFrame()

void CRPRenderManager::ClearVideoFrame ( const std::string & savestatePath)

◆ Configure()

bool CRPRenderManager::Configure ( AVPixelFormat format,
unsigned int nominalWidth,
unsigned int nominalHeight,
unsigned int maxWidth,
unsigned int maxHeight,
float pixelAspectRatio )

◆ Deinitialize()

void CRPRenderManager::Deinitialize ( )

◆ Flush()

void CRPRenderManager::Flush ( )

◆ FrameMove()

void CRPRenderManager::FrameMove ( )

◆ GetGUIRenderTargetFactory()

CGUIRenderTargetFactory * KODI::RETRO::CRPRenderManager::GetGUIRenderTargetFactory ( )
inline

Access the factory for creating GUI render targets.

◆ GetMaxHeight()

unsigned int KODI::RETRO::CRPRenderManager::GetMaxHeight ( ) const
inline

◆ GetMaxWidth()

unsigned int KODI::RETRO::CRPRenderManager::GetMaxWidth ( ) const
inline

◆ GetNominalHeight()

unsigned int KODI::RETRO::CRPRenderManager::GetNominalHeight ( ) const
inline

◆ GetNominalWidth()

unsigned int KODI::RETRO::CRPRenderManager::GetNominalWidth ( ) const
inline

◆ GetPixelAspectRatio()

float KODI::RETRO::CRPRenderManager::GetPixelAspectRatio ( ) const
inline

◆ GetPixelFormat()

AVPixelFormat KODI::RETRO::CRPRenderManager::GetPixelFormat ( ) const
inline

◆ GetVideoBuffer()

bool CRPRenderManager::GetVideoBuffer ( unsigned int width,
unsigned int height,
VideoStreamBuffer & buffer )
Todo
De-prioritize buffer pools with write-only or unaligned memory

◆ Initialize()

void CRPRenderManager::Initialize ( )

◆ RenderControl()

void CRPRenderManager::RenderControl ( bool bClear,
bool bUseAlpha,
const CRect & renderRegion,
const IGUIRenderSettings * renderSettings )
overridevirtual

Render a game control.

Parameters
bClearWhether the render area should be cleared
bUseAlphaWhether the graphics context's alpha should be used
renderRegionThe region of the control being rendered
renderSettingsThe settings used to render the control

Implements KODI::RETRO::IRenderManager.

◆ RenderWindow()

void CRPRenderManager::RenderWindow ( bool bClear,
const RESOLUTION_INFO & coordsRes )
overridevirtual

Render a fullscreen window.

Parameters
bClearWhether the render area should be cleared
coordsResResolution that the window coordinates are in

Implements KODI::RETRO::IRenderManager.

◆ SaveThumbnail()

void CRPRenderManager::SaveThumbnail ( const std::string & thumbnailPath)
Todo
rotate image by rotationCCW

◆ SaveVideoFrame()

void CRPRenderManager::SaveVideoFrame ( const std::string & savestatePath,
ISavestate & savestate )

◆ SetSpeed()

void CRPRenderManager::SetSpeed ( double speed)

◆ SupportsRenderFeature()

bool CRPRenderManager::SupportsRenderFeature ( RENDERFEATURE feature) const
overridevirtual
Todo
Move to ProcessInfo

Implements KODI::RETRO::IRenderCallback.

◆ SupportsScalingMethod()

bool CRPRenderManager::SupportsScalingMethod ( SCALINGMETHOD method) const
overridevirtual
Todo
Move to ProcessInfo

Implements KODI::RETRO::IRenderCallback.


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