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

#include <OverlayRenderer.h>

Inheritance diagram for OVERLAY::CRenderer:
Observer CDebugRenderer::CRenderer

Classes

struct  SElement
 

Public Member Functions

 CRenderer ()
 
virtual ~CRenderer ()
 
void Notify (const Observable &obs, const ObservableMessage msg) override
 Process a message from an observable.
 
void AddOverlay (std::shared_ptr< CDVDOverlay > o, double pts, int index)
 
virtual void Render (int idx, float depth=0.0f)
 
void UnInit ()
 Release resources.
 
void Flush ()
 
void Reset ()
 Reset to default values.
 
void Release (int idx)
 
bool HasOverlay (int idx)
 
void SetVideoRect (CRect &source, CRect &dest, CRect &view)
 
void SetStereoMode (const std::string &stereomode)
 
void SetSubtitleVerticalPosition (const int value, bool save)
 Set the subtitle vertical position, it depends on current screen resolution.
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
virtual ~Observer ()=default
 

Protected Types

enum  PositonResInfoState { POSRESINFO_UNSET = -1 , POSRESINFO_SAVE_CHANGES = -2 }
 

Protected Member Functions

void ResetSubtitlePosition ()
 Reset the subtitle position to default value.
 
void OnViewChange ()
 Called when the screen resolution is changed.
 
void Render (COverlay *o)
 
std::shared_ptr< COverlayConvert (CDVDOverlay &o, double pts)
 
std::shared_ptr< COverlayConvertLibass (CDVDOverlayLibass &o, double pts, bool updateStyle, const std::shared_ptr< struct KODI::SUBTITLES::STYLE::style > &overlayStyle)
 Convert the overlay to a overlay renderer.
 
void CreateSubtitlesStyle ()
 
void Release (std::vector< SElement > &list)
 
void ReleaseCache ()
 
void ReleaseUnused ()
 
void LoadSettings ()
 Load and store settings locally.
 

Protected Attributes

CCriticalSection m_section
 
std::vector< SElementm_buffers [NUM_BUFFERS]
 
std::map< unsigned int, std::shared_ptr< COverlay > > m_textureCache
 
CRect m_rv
 
CRect m_rs
 
CRect m_rd
 
std::string m_stereomode
 
int m_subtitlePosition {0}
 
int m_subtitlePosResInfo {POSRESINFO_UNSET}
 
int m_subtitleVerticalMargin {0}
 
bool m_saveSubtitlePosition {false}
 
KODI::SUBTITLES::HorizontalAlign m_subtitleHorizontalAlign
 
KODI::SUBTITLES::Align m_subtitleAlign {KODI::SUBTITLES::Align::BOTTOM_OUTSIDE}
 
std::shared_ptr< struct KODI::SUBTITLES::STYLE::stylem_overlayStyle
 
std::atomic< boolm_isSettingsChanged {false}
 

Static Protected Attributes

static unsigned int m_textureid = 1
 

Member Enumeration Documentation

◆ PositonResInfoState

Enumerator
POSRESINFO_UNSET 
POSRESINFO_SAVE_CHANGES 

Constructor & Destructor Documentation

◆ CRenderer()

CRenderer::CRenderer ( )

◆ ~CRenderer()

CRenderer::~CRenderer ( )
virtual

Member Function Documentation

◆ AddOverlay()

void CRenderer::AddOverlay ( std::shared_ptr< CDVDOverlay > o,
double pts,
int index )

◆ Convert()

std::shared_ptr< COverlay > CRenderer::Convert ( CDVDOverlay & o,
double pts )
protected

◆ ConvertLibass()

std::shared_ptr< COverlay > CRenderer::ConvertLibass ( CDVDOverlayLibass & o,
double pts,
bool updateStyle,
const std::shared_ptr< struct KODI::SUBTITLES::STYLE::style > & overlayStyle )
protected

Convert the overlay to a overlay renderer.

Parameters
oThe overlay to convert
ptsThe current PTS time
subStyleThe style to be used, MUST BE SET ONLY at the first call or when user change settings
Returns
True if success, false if error

◆ CreateSubtitlesStyle()

void CRenderer::CreateSubtitlesStyle ( )
protected

◆ Flush()

void CRenderer::Flush ( )

◆ HasOverlay()

bool CRenderer::HasOverlay ( int idx)

◆ LoadSettings()

void CRenderer::LoadSettings ( )
protected

Load and store settings locally.

◆ Notify()

void CRenderer::Notify ( const Observable & obs,
const ObservableMessage msg )
overridevirtual

Process a message from an observable.

Parameters
obsThe observable that sends the message.
msgThe message.

Implements Observer.

◆ OnViewChange()

void CRenderer::OnViewChange ( )
protected

Called when the screen resolution is changed.

◆ Release() [1/2]

void CRenderer::Release ( int idx)

◆ Release() [2/2]

void CRenderer::Release ( std::vector< SElement > & list)
protected

◆ ReleaseCache()

void CRenderer::ReleaseCache ( )
protected

◆ ReleaseUnused()

void CRenderer::ReleaseUnused ( )
protected

◆ Render() [1/2]

void CRenderer::Render ( COverlay * o)
protected

◆ Render() [2/2]

void CRenderer::Render ( int idx,
float depth = 0.0f )
virtual

Reimplemented in CDebugRenderer::CRenderer.

◆ Reset()

void CRenderer::Reset ( )

Reset to default values.

◆ ResetSubtitlePosition()

void CRenderer::ResetSubtitlePosition ( )
protected

Reset the subtitle position to default value.

◆ SetStereoMode()

void CRenderer::SetStereoMode ( const std::string & stereomode)

◆ SetSubtitleVerticalPosition()

void CRenderer::SetSubtitleVerticalPosition ( const int value,
bool save )

Set the subtitle vertical position, it depends on current screen resolution.

Parameters
valueThe subtitle position in pixels
saveIf true, the value will be saved to resolution info

◆ SetVideoRect()

void CRenderer::SetVideoRect ( CRect & source,
CRect & dest,
CRect & view )

◆ UnInit()

void CRenderer::UnInit ( )

Release resources.

Member Data Documentation

◆ m_buffers

std::vector<SElement> OVERLAY::CRenderer::m_buffers[NUM_BUFFERS]
protected

◆ m_isSettingsChanged

std::atomic<bool> OVERLAY::CRenderer::m_isSettingsChanged {false}
protected

◆ m_overlayStyle

std::shared_ptr<struct KODI::SUBTITLES::STYLE::style> OVERLAY::CRenderer::m_overlayStyle
protected

◆ m_rd

CRect OVERLAY::CRenderer::m_rd
protected

◆ m_rs

CRect OVERLAY::CRenderer::m_rs
protected

◆ m_rv

CRect OVERLAY::CRenderer::m_rv
protected

◆ m_saveSubtitlePosition

bool OVERLAY::CRenderer::m_saveSubtitlePosition {false}
protected

◆ m_section

CCriticalSection OVERLAY::CRenderer::m_section
protected

◆ m_stereomode

std::string OVERLAY::CRenderer::m_stereomode
protected

◆ m_subtitleAlign

KODI::SUBTITLES::Align OVERLAY::CRenderer::m_subtitleAlign {KODI::SUBTITLES::Align::BOTTOM_OUTSIDE}
protected

◆ m_subtitleHorizontalAlign

KODI::SUBTITLES::HorizontalAlign OVERLAY::CRenderer::m_subtitleHorizontalAlign
protected

◆ m_subtitlePosition

int OVERLAY::CRenderer::m_subtitlePosition {0}
protected

◆ m_subtitlePosResInfo

int OVERLAY::CRenderer::m_subtitlePosResInfo {POSRESINFO_UNSET}
protected

◆ m_subtitleVerticalMargin

int OVERLAY::CRenderer::m_subtitleVerticalMargin {0}
protected

◆ m_textureCache

std::map<unsigned int, std::shared_ptr<COverlay> > OVERLAY::CRenderer::m_textureCache
protected

◆ m_textureid

unsigned int CRenderer::m_textureid = 1
staticprotected

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