bool extPlayerActive = m_eCurrentPlayer == EPC_EXTPLAYER && IsPlaying() && !m_AppFocused;
m_bPresentFrame = false;
- if (!extPlayerActive && g_graphicsContext.IsFullScreenVideo() && !IsPaused())
+ if (!extPlayerActive && g_graphicsContext.IsFullScreenVideo() && !IsPaused() && g_renderManager.RendererHandlesPresent())
{
CSingleLock lock(m_frameMutex);
m_RenderUpdateCallBackCtx = ctx;
}
+void CBaseRenderer::RegisterRenderFeaturesCallBack(const void *ctx, RenderFeaturesCallBackFn fn)
+{
+ m_RenderFeaturesCallBackFn = fn;
+ m_RenderFeaturesCallBackCtx = ctx;
+}
+
void CBaseRenderer::ChooseBestResolution(float fps)
{
if (fps == 0.0) return;
#include "guilib/Resolution.h"
#include "guilib/Geometry.h"
#include "RenderFormats.h"
+#include "RenderFeatures.h"
#define MAX_PLANES 3
#define MAX_FIELDS 3
FS_BOT
};
-enum ERENDERFEATURE
-{
- RENDERFEATURE_GAMMA,
- RENDERFEATURE_BRIGHTNESS,
- RENDERFEATURE_CONTRAST,
- RENDERFEATURE_NOISE,
- RENDERFEATURE_SHARPNESS,
- RENDERFEATURE_NONLINSTRETCH,
- RENDERFEATURE_ROTATION,
- RENDERFEATURE_STRETCH,
- RENDERFEATURE_CROP,
- RENDERFEATURE_ZOOM,
- RENDERFEATURE_VERTICAL_SHIFT,
- RENDERFEATURE_PIXEL_RATIO,
- RENDERFEATURE_POSTPROCESS
-};
-
// Render Methods
enum RenderMethods
{
};
typedef void (*RenderUpdateCallBackFn)(const void *ctx, const CRect &SrcRect, const CRect &DestRect);
+typedef void (*RenderFeaturesCallBackFn)(const void *ctx, Features &renderFeatures);
struct DVDVideoPicture;
std::vector<ERenderFormat> SupportedFormats() { return std::vector<ERenderFormat>(); }
virtual void RegisterRenderUpdateCallBack(const void *ctx, RenderUpdateCallBackFn fn);
+ virtual void RegisterRenderFeaturesCallBack(const void *ctx, RenderFeaturesCallBackFn fn);
static void SettingOptionsRenderMethodsFiller(const CSetting *setting, std::vector< std::pair<std::string, int> > &list, int ¤t);
const void* m_RenderUpdateCallBackCtx;
RenderUpdateCallBackFn m_RenderUpdateCallBackFn;
+
+ const void* m_RenderFeaturesCallBackCtx;
+ RenderFeaturesCallBackFn m_RenderFeaturesCallBackFn;
};
#include "guilib/Shader.h"
#include "settings/VideoSettings.h"
#include "RenderFlags.h"
+#include "RenderFormats.h"
#include "guilib/GraphicContext.h"
#include "BaseRenderer.h"
#include "RenderFormats.h"
m_RenderUpdateCallBackCtx = NULL;
if ((m_format == RENDER_FMT_BYPASS) && g_application.GetCurrentPlayer())
{
+ m_renderFeatures.clear();
+ m_scalingMethods.clear();
+ m_deinterlaceModes.clear();
+ m_deinterlaceMethods.clear();
+
+ if (m_RenderFeaturesCallBackFn)
+ {
+ (*m_RenderFeaturesCallBackFn)(m_RenderFeaturesCallBackCtx, m_renderFeatures);
+ // after setting up m_renderFeatures, we are done with the callback
+ m_RenderFeaturesCallBackFn = NULL;
+ m_RenderFeaturesCallBackCtx = NULL;
+ }
g_application.m_pPlayer->GetRenderFeatures(m_renderFeatures);
g_application.m_pPlayer->GetDeinterlaceMethods(m_deinterlaceMethods);
g_application.m_pPlayer->GetDeinterlaceModes(m_deinterlaceModes);
m_bConfigured = false;
m_RenderUpdateCallBackFn = NULL;
m_RenderUpdateCallBackCtx = NULL;
+ m_RenderFeaturesCallBackFn = NULL;
+ m_RenderFeaturesCallBackCtx = NULL;
}
inline void CLinuxRendererGLES::ReorderDrawPoints()
#include "xbmc/guilib/Shader.h"
#include "settings/VideoSettings.h"
#include "RenderFlags.h"
+#include "RenderFormats.h"
#include "guilib/GraphicContext.h"
#include "BaseRenderer.h"
#include "xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h"
--- /dev/null
+#pragma once
+/*
+ * Copyright (C) 2005-2012 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+enum ERENDERFEATURE
+{
+ RENDERFEATURE_GAMMA,
+ RENDERFEATURE_BRIGHTNESS,
+ RENDERFEATURE_CONTRAST,
+ RENDERFEATURE_NOISE,
+ RENDERFEATURE_SHARPNESS,
+ RENDERFEATURE_NONLINSTRETCH,
+ RENDERFEATURE_ROTATION,
+ RENDERFEATURE_STRETCH,
+ RENDERFEATURE_CROP,
+ RENDERFEATURE_ZOOM,
+ RENDERFEATURE_VERTICAL_SHIFT,
+ RENDERFEATURE_PIXEL_RATIO,
+ RENDERFEATURE_POSTPROCESS
+};
+
+typedef std::vector<int> Features;
CApplicationMessenger::Get().SwitchToFullscreen();
lock.Enter();
}
+ if( format & RENDER_FMT_BYPASS )
+ m_presentmethod = PRESENT_METHOD_BYPASS;
+
m_pRenderer->Update(false);
m_bIsStarted = true;
m_bReconfigured = true;
return result;
}
+bool CXBMCRenderManager::RendererHandlesPresent()
+{
+ return IsConfigured() && m_presentmethod != PRESENT_METHOD_BYPASS;
+}
+
bool CXBMCRenderManager::IsConfigured()
{
if (!m_pRenderer)
m_pRenderer->RegisterRenderUpdateCallBack(ctx, fn);
}
+void CXBMCRenderManager::RegisterRenderFeaturesCallBack(const void *ctx, RenderFeaturesCallBackFn fn)
+{
+ if (m_pRenderer)
+ m_pRenderer->RegisterRenderFeaturesCallBack(ctx, fn);
+}
+
void CXBMCRenderManager::Render(bool clear, DWORD flags, DWORD alpha)
{
CSharedLock lock(m_sharedSection);
void UpdateResolution();
+ bool RendererHandlesPresent();
+
#ifdef HAS_GL
CLinuxRendererGL *m_pRenderer;
#elif HAS_GLES == 2
CSharedSection& GetSection() { return m_sharedSection; };
void RegisterRenderUpdateCallBack(const void *ctx, RenderUpdateCallBackFn fn);
+ void RegisterRenderFeaturesCallBack(const void *ctx, RenderFeaturesCallBackFn fn);
protected:
void Render(bool clear, DWORD flags, DWORD alpha);
PRESENT_METHOD_BLEND,
PRESENT_METHOD_WEAVE,
PRESENT_METHOD_BOB,
+ PRESENT_METHOD_BYPASS,
};
double m_displayLatency;
#include "guilib/GraphicContext.h"
#include "RenderFlags.h"
+#include "RenderFormats.h"
#include "BaseRenderer.h"
#include "guilib/D3DResource.h"
#include "RenderCapture.h"
void CGUIVideoControl::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
// TODO Proper processing which marks when its actually changed. Just mark always for now.
- MarkDirtyRegion();
+ if (g_renderManager.RendererHandlesPresent())
+ MarkDirtyRegion();
CGUIControl::Process(currentTime, dirtyregions);
}