Skip to content

Commit

Permalink
VideoPlayer: vtbgl - register renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
FernetMenta authored and popcornmix committed Jul 6, 2017
1 parent bac955f commit d68f355
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
26 changes: 16 additions & 10 deletions xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/

#include "RendererVTBGL.h"

#include "../RenderFactory.h"
#include "settings/Settings.h"
#include "settings/AdvancedSettings.h"
#include "cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h"
Expand All @@ -30,6 +30,21 @@
#include <OpenGL/CGLIOSurface.h>
#include "windowing/WindowingFactory.h"

CBaseRenderer* CRendererVTB::Create(CVideoBuffer *buffer)
{
VTB::CVideoBufferVTB *vb = dynamic_cast<VTB::CVideoBufferVTB*>(buffer);
if (vb)
return new CRendererVTB();

return nullptr;
}

bool CRendererVTB::Register()
{
VIDEOPLAYER::CRendererFactory::RegisterRenderer("vtbgl", CRendererVTB::Create);
return true;
}

CRendererVTB::CRendererVTB()
{
}
Expand All @@ -42,15 +57,6 @@ CRendererVTB::~CRendererVTB()
}
}

bool CRendererVTB::HandlesVideoBuffer(CVideoBuffer *buffer)
{
VTB::CVideoBufferVTB *vb = dynamic_cast<VTB::CVideoBufferVTB*>(buffer);
if (vb)
return true;

return false;
}

void CRendererVTB::ReleaseBuffer(int idx)
{
YUVBUFFER &buf = m_buffers[idx];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ class CRendererVTB : public CLinuxRendererGL
CRendererVTB();
virtual ~CRendererVTB();

static CBaseRenderer* Create(CVideoBuffer *buffer);
static bool Register();

// Player functions
virtual void ReleaseBuffer(int idx) override;
virtual bool NeedBuffer(int idx) override;
static bool HandlesVideoBuffer(CVideoBuffer *buffer);

protected:
virtual bool LoadShadersHook() override;
Expand Down

0 comments on commit d68f355

Please sign in to comment.