diff options
author | Martijn Kaijser <martijn@xbmc.org> | 2016-10-23 15:11:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-23 15:11:27 +0200 |
commit | 77947d918a3549c113233335b54c8979f79e23c2 (patch) | |
tree | e434621e1065bf59972c0cec3d9279d451fec26d | |
parent | 546a41bdd7654fc0278adc7c0da1e69687c7e552 (diff) | |
parent | 4007e3463693dd5179d8cce33690908d14d635b8 (diff) |
Merge pull request #10757 from koying/amcsnotbypass
AMC(surface) is not a BYPASS
4 files changed, 16 insertions, 17 deletions
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp index 9d3a614371..5b6a767784 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp @@ -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); @@ -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()) diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h index fb39ea51d0..10f31e11c3 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h @@ -63,8 +63,10 @@ public: // meat and potatos void Validate(bool state); + bool WaitForFrame(int millis); // MediaCodec related void ReleaseOutputBuffer(bool render); + bool IsReleased() { return m_isReleased; } // SurfaceTexture released ssize_t GetIndex() const; int GetTextureID() const; diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererMediaCodecSurface.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererMediaCodecSurface.cpp index 1f53175f8c..9a27abaf39 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererMediaCodecSurface.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererMediaCodecSurface.cpp @@ -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]; @@ -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; @@ -113,13 +113,8 @@ 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); - if (mci) + CDVDMediaCodecInfo *mci = static_cast<CDVDMediaCodecInfo *>(m_buffers[index].hwDec); + if (mci && !mci->IsReleased()) { // this hack is needed to get the 2D mode of a 3D movie going RENDER_STEREO_MODE stereo_mode = g_graphicsContext.GetStereoMode(); @@ -151,8 +146,6 @@ bool CRendererMediaCodecSurface::RenderUpdateVideoHook(bool clear, DWORD flags, mci->RenderUpdate(srcRect, dstRect); } - - CXBMCApp::WaitVSync(1000.0 / g_graphicsContext.GetFPS()); return true; } diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererMediaCodecSurface.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererMediaCodecSurface.h index f600ee2bec..4e13978b78 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererMediaCodecSurface.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererMediaCodecSurface.h @@ -36,8 +36,8 @@ public: // 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); @@ -56,7 +56,6 @@ protected: 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 |