Skip to content

Commit

Permalink
VideoPlayer: vdpau - 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 26ef3a8 commit bac955f
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/RendererVDPAU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/

#include "RendererVDPAU.h"

#include "../RenderFactory.h"
#include "ServiceBroker.h"
#include "cores/VideoPlayer/DVDCodecs/Video/VDPAU.h"
#include "settings/Settings.h"
Expand All @@ -30,6 +30,21 @@

using namespace VDPAU;

CBaseRenderer* CRendererVDPAU::Create(CVideoBuffer *buffer)
{
CVdpauRenderPicture *vb = dynamic_cast<CVdpauRenderPicture*>(buffer);
if (vb)
return new CRendererVDPAU();

return nullptr;
}

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

CRendererVDPAU::CRendererVDPAU()
{

Expand All @@ -44,15 +59,6 @@ CRendererVDPAU::~CRendererVDPAU()
m_interopState.Finish();
}

bool CRendererVDPAU::HandlesVideoBuffer(CVideoBuffer *buffer)
{
CVdpauRenderPicture *pic = dynamic_cast<CVdpauRenderPicture*>(buffer);
if (pic)
return true;

return false;
}

bool CRendererVDPAU::Configure(const VideoPicture &picture, float fps, unsigned flags, unsigned int orientation)
{
CVdpauRenderPicture *pic = dynamic_cast<CVdpauRenderPicture*>(picture.videoBuffer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ class CRendererVDPAU : public CLinuxRendererGL
CRendererVDPAU();
virtual ~CRendererVDPAU();

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

virtual bool Configure(const VideoPicture &picture, float fps, unsigned flags, unsigned int orientation) override;

// Player functions
virtual void ReleaseBuffer(int idx) override;
virtual bool ConfigChanged(const VideoPicture &picture) override;
static bool HandlesVideoBuffer(CVideoBuffer *buffer);
bool NeedBuffer(int idx) override;

// Feature support
Expand Down

0 comments on commit bac955f

Please sign in to comment.