[WiP] madVR support in MP1 (30 Viewers)

Sebastiii

Development Group
  • Team MediaPortal
  • November 12, 2007
    16,523
    10,466
    France
    Home Country
    France France
    btw the code for restore :

    C++:
    Log("MPMadPresenter::Destructor() - m_pMad release 1");
        if (m_pMad)
        {
          // Let's madVR restore original display mode (when adjust refresh it's handled by madVR)
          if (Com::SmartQIPtr<IMadVRCommand> pMadVrCmd = m_pMad)
          {
            pMadVrCmd->SendCommand("restoreDisplayModeNow");
            pMadVrCmd.Release();
            Log("MPMadPresenter::Destructor() - restoreDisplayModeNow");
          }
          m_pMad.FullRelease();
        }
        Log("MPMadPresenter::Destructor() - m_pMad release 2");
     

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,332
    1,009
    Home Country
    Netherlands Netherlands
    Thanks, tested with the videohelp.com linked version and MadVR is restoring refresh rate correctly there when Kodi is on either primary or secondary screen.
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,523
    10,466
    France
    Home Country
    France France
    Nice :) so now why on MP it doesn't works :(
    maybe and surely because of some kind of delay introduced by c# vs c++ :( or it's something else.
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,523
    10,466
    France
    Home Country
    France France
    Kodi DS code :

    C++:
    CmadVRAllocatorPresenter::~CmadVRAllocatorPresenter()
    {
      if (m_pSRCB) {
        // nasty, but we have to let it know about our death somehow
        ((CSubRenderCallback*)(ISubRenderCallback2*)m_pSRCB)->SetDXRAP(nullptr);
      }
     
      if (m_pORCB) {
        // nasty, but we have to let it know about our death somehow
        ((COsdRenderCallback*)(IOsdRenderCallback*)m_pORCB)->SetDXRAP(nullptr);
      }
    
      // Unregister madVR Exclusive Callback
      if (Com::SmartQIPtr<IMadVRExclusiveModeCallback> pEXL = m_pDXR)
        pEXL->Unregister(m_exclusiveCallback, this);
    
      // Let's madVR restore original display mode (when adjust refresh it's handled by madVR)
      if (Com::SmartQIPtr<IMadVRCommand> pMadVrCmd = m_pDXR)
        pMadVrCmd->SendCommand("restoreDisplayModeNow");
    
      g_renderManager.UnInit();
      g_advancedSettings.m_guiAlgorithmDirtyRegions = m_kodiGuiDirtyAlgo;
     
      // the order is important here
      CDSRendererCallback::Destroy();
      SAFE_DELETE(m_pMadvrShared);
      m_pSubPicQueue = nullptr;
      m_pAllocator = nullptr;
      m_pDXR = nullptr;
      m_pORCB = nullptr;
      m_pSRCB = nullptr;
    
      CLog::Log(LOGDEBUG, "%s Resources released", __FUNCTION__);
    }
     

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,332
    1,009
    Home Country
    Netherlands Netherlands
    Yeah think it releases / restored the window correctly, before it crashed when restoring refresh rate with secondary window so maybe it's the fix from V227-229 (not sure which) ?
    On IRC so can ping if you have the time :)

    What we could try is to log the specific steps and see if perhaps it's crashing before it can reach "restoreDisplayModeNow" , any idea if we need to store the current display refresh rate on renderer start for MadVR or is that handled internally?
    We also have some MPC-HC examples here:

    https://fossies.org/windows/misc/mpc-hc-1.7.10.zip/mpc-hc-1.7.10/include/mvrInterfaces.h
    https://github.com/MediaBrowser/Emby.Theater.Windows/blob/master/Emby.Theater.DirectShow/MadvrInterface.c <-- Looks incomplete
     
    Last edited:

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,523
    10,466
    France
    Home Country
    France France
    Thanks :)
    mvrinterfaces.h comes from madshi bin :)
    The other one i have take some part but didn't work correctly under MP lol :p
     

    Users who are viewing this thread

    Top Bottom