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

#include <BaseRenderer.h>

Inheritance diagram for CBaseRenderer:
CLinuxRendererGL CLinuxRendererGLES CRendererDRMPRIME CRendererDRMPRIMEGLES CRendererMediaCodecSurface CRendererStarfish CRendererVTBDisplayLayer CRendererWasmMedia CWinRenderer

Public Member Functions

 CBaseRenderer ()
 
virtual ~CBaseRenderer ()
 
virtual bool Configure (const VideoPicture &picture, float fps, unsigned int orientation)=0
 
virtual bool IsConfigured ()=0
 
virtual void AddVideoPicture (const VideoPicture &picture, int index)=0
 
virtual bool IsPictureHW (const VideoPicture &picture)
 
virtual void UnInit ()=0
 
virtual void PrepareForReconfigure ()
 Called before the renderer is deleted to be replaced by a new one for the same playback.
 
virtual bool Flush (bool saveBuffers)
 
virtual void SetBufferSize (int numBuffers)
 
virtual void ReleaseBuffer (int idx)
 
virtual bool NeedBuffer (int idx)
 
virtual bool IsGuiLayer ()
 
virtual bool VideoBypassesFramebuffer ()
 
virtual bool CaptureVideoFrame (const KODI::RENDERING::CAPTURE::CaptureSpec &spec, KODI::RENDERING::CAPTURE::CaptureResult &result)
 Render this renderer's video frame for screencap into result. Overridden by renderers whose VideoBypassesFramebuffer() is true. Default: capture unavailable.
 
virtual bool CompositeVideoCapture (KODI::RENDERING::CAPTURE::CaptureResult &result)
 Composite externally rendered video into a finished framebuffer capture.
 
virtual CRenderInfo GetRenderInfo ()
 
virtual void Update ()=0
 
virtual void RenderUpdate (int index, int index2, bool clear, unsigned int flags, unsigned int alpha)=0
 
virtual bool ConfigChanged (const VideoPicture &picture)=0
 
virtual bool ChangePictureSize (const VideoPicture &picture)
 Take pictures of another size from here on, keeping all else Configure() set up. The pictures the renderer holds are released.
 
virtual bool SupportsMultiPassRendering ()=0
 
virtual bool Supports (ERENDERFEATURE feature) const
 
virtual bool Supports (ESCALINGMETHOD method) const =0
 
virtual bool WantsDoublePass ()
 
void SetFps (float fps)
 
void SetViewMode (int viewMode)
 
void SetFrameContentRect (const CRectInt &rect)
 Take VideoPicture::contentRect for the frame about to be drawn. Empty leaves the stored measurement in charge.
 
void GetVideoRect (CRect &source, CRect &dest, CRect &view) const
 Get video rectangle and view window.
 
float GetAspectRatio () const
 
unsigned int GetOrientation () const
 
void SetVideoSettings (const CVideoSettings &settings)
 
virtual DEBUG_INFO_VIDEO GetDebugInfo (int idx)
 

Static Public Member Functions

static void SettingOptionsRenderMethodsFiller (const std::shared_ptr< const CSetting > &setting, std::vector< IntegerSettingOption > &list, int &current)
 

Protected Member Functions

void CalcDestRect (float offsetX, float offsetY, float width, float height, float inputFrameRatio, float zoomAmount, float verticalShift, CRect &destRect)
 
void CalcNormalRenderRect (float offsetX, float offsetY, float width, float height, float inputFrameRatio, float zoomAmount, float verticalShift)
 
void CalculateFrameAspectRatio (unsigned int desired_width, unsigned int desired_height)
 
virtual void ManageRenderArea ()
 
CRect ApplyContentGeometry (float &contentRatio)
 The content geometry's part of ManageRenderArea(): cut to the frame's own measurement, fit the mask opening, then honour a maintained ratio.
 
virtual void ReorderDrawPoints ()
 
virtual EShaderFormat GetShaderFormat ()
 
void MarkDirty ()
 
void EnableAlwaysClip ()
 
void saveRotatedCoords ()
 
void syncDestRectToRotatedPoints ()
 
void restoreRotatedCoords ()
 

Protected Attributes

unsigned int m_sourceWidth = 720
 
unsigned int m_sourceHeight = 480
 
float m_sourceFrameRatio = 1.0f
 
float m_fps = 0.0f
 
unsigned int m_renderOrientation = 0
 
CPoint m_rotatedDestCoords [4]
 
CPoint m_savedRotatedDestCoords [4]
 
CRect m_destRect
 
CRect m_sourceRect
 
CRect m_viewRect
 
CRectInt m_frameContentRect
 
unsigned m_iFlags = 0
 
AVPixelFormat m_format = AV_PIX_FMT_NONE
 
CVideoSettings m_videoSettings
 

Constructor & Destructor Documentation

◆ CBaseRenderer()

CBaseRenderer::CBaseRenderer ( )

◆ ~CBaseRenderer()

CBaseRenderer::~CBaseRenderer ( )
virtualdefault

Member Function Documentation

◆ AddVideoPicture()

◆ ApplyContentGeometry()

CRect CBaseRenderer::ApplyContentGeometry ( float & contentRatio)
protected

The content geometry's part of ManageRenderArea(): cut to the frame's own measurement, fit the mask opening, then honour a maintained ratio.

◆ CalcDestRect()

void CBaseRenderer::CalcDestRect ( float offsetX,
float offsetY,
float width,
float height,
float inputFrameRatio,
float zoomAmount,
float verticalShift,
CRect & destRect )
protected

◆ CalcNormalRenderRect()

void CBaseRenderer::CalcNormalRenderRect ( float offsetX,
float offsetY,
float width,
float height,
float inputFrameRatio,
float zoomAmount,
float verticalShift )
protected

◆ CalculateFrameAspectRatio()

void CBaseRenderer::CalculateFrameAspectRatio ( unsigned int desired_width,
unsigned int desired_height )
protected

◆ CaptureVideoFrame()

virtual bool CBaseRenderer::CaptureVideoFrame ( const KODI::RENDERING::CAPTURE::CaptureSpec & spec,
KODI::RENDERING::CAPTURE::CaptureResult & result )
inlinevirtual

Render this renderer's video frame for screencap into result. Overridden by renderers whose VideoBypassesFramebuffer() is true. Default: capture unavailable.

Reimplemented in CRendererDRMPRIME, and CRendererVTBDisplayLayer.

◆ ChangePictureSize()

virtual bool CBaseRenderer::ChangePictureSize ( const VideoPicture & picture)
inlinevirtual

Take pictures of another size from here on, keeping all else Configure() set up. The pictures the renderer holds are released.

Returns
false if the renderer has to be configured again for them

Reimplemented in CWinRenderer.

◆ CompositeVideoCapture()

virtual bool CBaseRenderer::CompositeVideoCapture ( KODI::RENDERING::CAPTURE::CaptureResult & result)
inlinevirtual

Composite externally rendered video into a finished framebuffer capture.

Reimplemented in CRendererVTBDisplayLayer.

◆ ConfigChanged()

◆ Configure()

◆ EnableAlwaysClip()

void CBaseRenderer::EnableAlwaysClip ( )
protected

◆ Flush()

virtual bool CBaseRenderer::Flush ( bool saveBuffers)
inlinevirtual

◆ GetAspectRatio()

float CBaseRenderer::GetAspectRatio ( ) const

◆ GetDebugInfo()

virtual DEBUG_INFO_VIDEO CBaseRenderer::GetDebugInfo ( int idx)
inlinevirtual

Reimplemented in CWinRenderer.

◆ GetOrientation()

unsigned int CBaseRenderer::GetOrientation ( ) const
inline

◆ GetRenderInfo()

◆ GetShaderFormat()

EShaderFormat CBaseRenderer::GetShaderFormat ( )
protectedvirtual

◆ GetVideoRect()

void CBaseRenderer::GetVideoRect ( CRect & source,
CRect & dest,
CRect & view ) const

Get video rectangle and view window.

Parameters
sourceis original size of the video
destis the target rendering area honoring aspect ratio of source
viewis the entire target rendering area for the video (including black bars)

◆ IsConfigured()

◆ IsGuiLayer()

◆ IsPictureHW()

virtual bool CBaseRenderer::IsPictureHW ( const VideoPicture & picture)
inlinevirtual

◆ ManageRenderArea()

void CBaseRenderer::ManageRenderArea ( )
protectedvirtual

◆ MarkDirty()

void CBaseRenderer::MarkDirty ( )
protected

◆ NeedBuffer()

virtual bool CBaseRenderer::NeedBuffer ( int idx)
inlinevirtual

◆ PrepareForReconfigure()

virtual void CBaseRenderer::PrepareForReconfigure ( )
inlinevirtual

Called before the renderer is deleted to be replaced by a new one for the same playback.

Reimplemented in CWinRenderer.

◆ ReleaseBuffer()

◆ RenderUpdate()

virtual void CBaseRenderer::RenderUpdate ( int index,
int index2,
bool clear,
unsigned int flags,
unsigned int alpha )
pure virtual

◆ ReorderDrawPoints()

void CBaseRenderer::ReorderDrawPoints ( )
inlineprotectedvirtual

Reimplemented in CRendererMediaCodecSurface.

◆ restoreRotatedCoords()

void CBaseRenderer::restoreRotatedCoords ( )
protected

◆ saveRotatedCoords()

void CBaseRenderer::saveRotatedCoords ( )
protected

◆ SetBufferSize()

virtual void CBaseRenderer::SetBufferSize ( int numBuffers)
inlinevirtual

◆ SetFps()

void CBaseRenderer::SetFps ( float fps)
inline

◆ SetFrameContentRect()

void CBaseRenderer::SetFrameContentRect ( const CRectInt & rect)
inline

Take VideoPicture::contentRect for the frame about to be drawn. Empty leaves the stored measurement in charge.

◆ SettingOptionsRenderMethodsFiller()

void CBaseRenderer::SettingOptionsRenderMethodsFiller ( const std::shared_ptr< const CSetting > & setting,
std::vector< IntegerSettingOption > & list,
int & current )
static

◆ SetVideoSettings()

void CBaseRenderer::SetVideoSettings ( const CVideoSettings & settings)

◆ SetViewMode()

void CBaseRenderer::SetViewMode ( int viewMode)

◆ Supports() [1/2]

◆ Supports() [2/2]

◆ SupportsMultiPassRendering()

◆ syncDestRectToRotatedPoints()

void CBaseRenderer::syncDestRectToRotatedPoints ( )
protected

◆ UnInit()

◆ Update()

◆ VideoBypassesFramebuffer()

virtual bool CBaseRenderer::VideoBypassesFramebuffer ( )
inlinevirtual

True when video never reaches the framebuffer: a DRM plane, an Android SurfaceView, the Amlogic video layer. Such a renderer must produce its own capture frame; every other renderer is served by reading the framebuffer.

Reimplemented in CLinuxRendererGL, CLinuxRendererGLES, and CRendererDRMPRIMEGLES.

◆ WantsDoublePass()

virtual bool CBaseRenderer::WantsDoublePass ( )
inlinevirtual

Reimplemented in CWinRenderer.

Member Data Documentation

◆ m_destRect

CRect CBaseRenderer::m_destRect
protected

◆ m_format

AVPixelFormat CBaseRenderer::m_format = AV_PIX_FMT_NONE
protected

◆ m_fps

float CBaseRenderer::m_fps = 0.0f
protected

◆ m_frameContentRect

CRectInt CBaseRenderer::m_frameContentRect
protected

◆ m_iFlags

unsigned CBaseRenderer::m_iFlags = 0
protected

◆ m_renderOrientation

unsigned int CBaseRenderer::m_renderOrientation = 0
protected

◆ m_rotatedDestCoords

CPoint CBaseRenderer::m_rotatedDestCoords[4]
protected

◆ m_savedRotatedDestCoords

CPoint CBaseRenderer::m_savedRotatedDestCoords[4]
protected

◆ m_sourceFrameRatio

float CBaseRenderer::m_sourceFrameRatio = 1.0f
protected

◆ m_sourceHeight

unsigned int CBaseRenderer::m_sourceHeight = 480
protected

◆ m_sourceRect

CRect CBaseRenderer::m_sourceRect
protected

◆ m_sourceWidth

unsigned int CBaseRenderer::m_sourceWidth = 720
protected

◆ m_videoSettings

CVideoSettings CBaseRenderer::m_videoSettings
protected

◆ m_viewRect

CRect CBaseRenderer::m_viewRect
protected

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