xbmc
Public Member Functions | List of all members
KODI::RETRO::CRPRenderManager Class Reference

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

#include <RPRenderManager.h>

Inheritance diagram for KODI::RETRO::CRPRenderManager:
Inheritance graph
[legend]
Collaboration diagram for KODI::RETRO::CRPRenderManager:
Collaboration graph
[legend]

Public Member Functions

 CRPRenderManager (CRPProcessInfo &processInfo)
 
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)
 
std::vector< VideoStreamBufferGetVideoBuffers (unsigned int width, unsigned int height)
 
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. More...
 
void RenderControl (bool bClear, bool bUseAlpha, const CRect &renderRegion, const IGUIRenderSettings *renderSettings) override
 Render a game control. More...
 
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)
 

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.

Member Function Documentation

◆ 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

◆ 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: