Skip to content

Commit

Permalink
FIX: [amcs] surface is not a bypass
Browse files Browse the repository at this point in the history
  • Loading branch information
koying committed Oct 23, 2016
1 parent 38b4983 commit 8fef65d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ void CDVDMediaCodecInfo::Validate(bool state)
m_valid = state;
}

bool CDVDMediaCodecInfo::WaitForFrame(int millis)
{
return m_frameready->WaitMSec(millis);
}

void CDVDMediaCodecInfo::ReleaseOutputBuffer(bool render)
{
CSingleLock lock(m_section);
Expand Down Expand Up @@ -277,7 +282,7 @@ void CDVDMediaCodecInfo::UpdateTexImage()
// we hook the SurfaceTexture OnFrameAvailable callback
// using CJNISurfaceTextureOnFrameAvailableListener and wait
// on a CEvent to fire. 50ms seems to be a good max fallback.
m_frameready->WaitMSec(50);
WaitForFrame(50);

m_surfacetexture->updateTexImage();
if (xbmc_jnienv()->ExceptionCheck())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class CDVDMediaCodecInfo

// meat and potatos
void Validate(bool state);
bool WaitForFrame(int millis);
// MediaCodec related
void ReleaseOutputBuffer(bool render);
// SurfaceTexture released
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ void CRendererMediaCodecSurface::AddVideoPictureHW(DVDVideoPicture &picture, int
#endif
}

bool CRendererMediaCodecSurface::RenderUpdateCheckForEmptyField()
{
return false;
}

void CRendererMediaCodecSurface::ReleaseBuffer(int idx)
{
YUVBUFFER &buf = m_buffers[idx];
Expand All @@ -79,11 +84,6 @@ int CRendererMediaCodecSurface::GetImageHook(YV12Image *image, int source, bool
return source;
}

bool CRendererMediaCodecSurface::IsGuiLayer()
{
return false;
}

bool CRendererMediaCodecSurface::Supports(EINTERLACEMETHOD method)
{
return false;
Expand Down Expand Up @@ -113,12 +113,7 @@ bool CRendererMediaCodecSurface::LoadShadersHook()

bool CRendererMediaCodecSurface::RenderHook(int index)
{
return true; // nothing to be done
}

bool CRendererMediaCodecSurface::RenderUpdateVideoHook(bool clear, DWORD flags, DWORD alpha)
{
CDVDMediaCodecInfo *mci = static_cast<CDVDMediaCodecInfo *>(m_buffers[m_iYV12RenderBuffer].hwDec);
CDVDMediaCodecInfo *mci = static_cast<CDVDMediaCodecInfo *>(m_buffers[index].hwDec);
if (mci)
{
// this hack is needed to get the 2D mode of a 3D movie going
Expand Down Expand Up @@ -151,8 +146,6 @@ bool CRendererMediaCodecSurface::RenderUpdateVideoHook(bool clear, DWORD flags,

mci->RenderUpdate(srcRect, dstRect);
}

CXBMCApp::WaitVSync(1000.0 / g_graphicsContext.GetFPS());
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class CRendererMediaCodecSurface : public CLinuxRendererGLES

// Player functions
virtual void AddVideoPictureHW(DVDVideoPicture &picture, int index);
virtual bool RenderUpdateCheckForEmptyField();
virtual void ReleaseBuffer(int idx);
virtual bool IsGuiLayer();

// Feature support
virtual bool Supports(EINTERLACEMETHOD method);
Expand All @@ -56,7 +56,6 @@ class CRendererMediaCodecSurface : public CLinuxRendererGLES
virtual bool LoadShadersHook();
virtual bool RenderHook(int index);
virtual int GetImageHook(YV12Image *image, int source = AUTOSOURCE, bool readonly = false);
virtual bool RenderUpdateVideoHook(bool clear, DWORD flags = 0, DWORD alpha = 255);
};

#endif

0 comments on commit 8fef65d

Please sign in to comment.