コード例 #1
0
void CXBMCRenderManager::Render(bool clear, DWORD flags, DWORD alpha)
{
  CSharedLock lock(m_sharedSection);

  if( m_presentmethod == PRESENT_METHOD_BOB )
    PresentBob(clear, flags, alpha);
  else if( m_presentmethod == PRESENT_METHOD_WEAVE )
    PresentWeave(clear, flags, alpha);
  else if( m_presentmethod == PRESENT_METHOD_BLEND )
    PresentBlend(clear, flags, alpha);
  else
    PresentSingle(clear, flags, alpha);

//XXX  m_overlays.Render();
}
コード例 #2
0
ファイル: RenderManager.cpp プロジェクト: Kr0nZ/boxee
void CXBMCRenderManager::Present()
{
  { CRetakeLock<CExclusiveLock> lock(m_sharedSection);
    if (!m_pRenderer)
      return;

    if(m_presentstep == PRESENT_FLIP)
    {
      m_overlays.Flip();
      m_pRenderer->FlipPage(m_presentsource);
      m_presentstep = PRESENT_FRAME;
      m_presentevent.Set();
    }
  }

  CSharedLock lock(m_sharedSection);

  lock.Leave();
  if (g_application.m_pPlayer && !g_application.m_pPlayer->PreRender())
    return;
  lock.Enter();

  if     ( m_presentmethod == VS_INTERLACEMETHOD_RENDER_BOB
        || m_presentmethod == VS_INTERLACEMETHOD_RENDER_BOB_INVERTED)
    PresentBob();
  else if( m_presentmethod == VS_INTERLACEMETHOD_RENDER_WEAVE
        || m_presentmethod == VS_INTERLACEMETHOD_RENDER_WEAVE_INVERTED)
    PresentWeave();
  else if( m_presentmethod == VS_INTERLACEMETHOD_RENDER_BLEND )
    PresentBlend();
  else
    PresentSingle();

  m_overlays.Render();

  if (g_application.m_pPlayer)
    g_application.m_pPlayer->PostRender();

  /* wait for this present to be valid */
  if(g_graphicsContext.IsFullScreenVideo())
    WaitPresentTime(m_presenttime);

  m_presentevent.Set();
}
コード例 #3
0
ファイル: RenderManager.cpp プロジェクト: suhongrui/plex
void CXBoxRenderManager::Present()
{
#ifdef HAS_SDL_OPENGL
  if (!m_pRenderer)
  {
    CLog::Log(LOGERROR, "%s called without valid Renderer object", __FUNCTION__);
    return;
  }
  
#endif

  EINTERLACEMETHOD mInt = g_stSettings.m_currentVideoSettings.m_InterlaceMethod;

  /* check for forced fields */
  if( mInt == VS_INTERLACEMETHOD_AUTO && m_presentfield != FS_NONE )
  {
    /* this is uggly to do on each frame, should only need be done once */
    int mResolution = g_graphicsContext.GetVideoResolution();
#if defined (HAS_SDL_OPENGL)
    if (1)
#else
    if( m_rendermethod == RENDER_HQ_RGB_SHADER 
     || m_rendermethod == RENDER_HQ_RGB_SHADERV2 )
#endif
      mInt = VS_INTERLACEMETHOD_RENDER_BOB;
    else if( mResolution == HDTV_480p_16x9 
          || mResolution == HDTV_480p_4x3 
          || mResolution == HDTV_720p 
          || mResolution == HDTV_1080i )
      mInt = VS_INTERLACEMETHOD_RENDER_BLEND;
    else
      mInt = VS_INTERLACEMETHOD_RENDER_BOB;
  }
  else if( mInt == VS_INTERLACEMETHOD_RENDER_BOB_INVERTED || mInt == VS_INTERLACEMETHOD_RENDER_WEAVE_INVERTED )
  {
    /* all methods should default to odd if nothing is specified */
    if( m_presentfield == FS_EVEN )
      m_presentfield = FS_ODD;
    else
      m_presentfield = FS_EVEN;
  }

  /* if we have a field, we will have a presentation delay */
  if( m_presentfield == FS_NONE )
    m_presentdelay = 20;
  else
    m_presentdelay = 40;

  if( m_presenttime >= m_presentdelay )
    m_presenttime -=  m_presentdelay;
  else
    m_presenttime = 0;

  if( mInt == VS_INTERLACEMETHOD_RENDER_BOB || mInt == VS_INTERLACEMETHOD_RENDER_BOB_INVERTED)
    PresentBob();
  else if( mInt == VS_INTERLACEMETHOD_RENDER_WEAVE || mInt == VS_INTERLACEMETHOD_RENDER_WEAVE_INVERTED)
    PresentWeave();
  else if( mInt == VS_INTERLACEMETHOD_RENDER_BLEND )
    PresentBlend();
  else
    PresentSingle();

#ifdef HAS_SDL_OPENGL
  m_eventPresented.Set();
#endif
}