VirtualBox

Changeset 55133 in vbox for trunk


Ignore:
Timestamp:
Apr 8, 2015 1:12:53 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
99432
Message:

Main,Frontends: framebuffer identifier.

Location:
trunk/src/VBox
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r53624 r55133  
    208208static ULONG       gcMonitors = 1;
    209209static ComObjPtr<VBoxSDLFB> gpFramebuffer[64];
     210static Bstr gaFramebufferId[64];
    210211static SDL_Cursor *gpDefaultCursor = NULL;
    211212#ifdef VBOXSDL_WITH_X11
     
    20082009    {
    20092010        // register our framebuffer
    2010         rc = gpDisplay->AttachFramebuffer(i, gpFramebuffer[i]);
     2011        rc = gpDisplay->AttachFramebuffer(i, gpFramebuffer[i], gaFramebufferId[i].asOutParam());
    20112012        if (FAILED(rc))
    20122013        {
     
    30283029    {
    30293030        for (unsigned i = 0; i < gcMonitors; i++)
    3030             gpDisplay->DetachFramebuffer(i);
     3031            gpDisplay->DetachFramebuffer(i, gaFramebufferId[i].raw());
    30313032    }
    30323033
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp

    r55113 r55133  
    381381     CComPtr <IUnknown> m_pUnkMarshaler;
    382382#endif /* Q_OS_WIN */
     383     /** Identifier returned by AttachFramebuffer. Used in DetachFramebuffer. */
     384     QString m_strFramebufferId;
    383385};
    384386
     
    599601void UIFrameBufferPrivate::attach()
    600602{
    601     display().AttachFramebuffer(m_uScreenId, CFramebuffer(this));
     603    m_strFramebufferId = display().AttachFramebuffer(m_uScreenId, CFramebuffer(this));
    602604}
    603605
     
    606608    CFramebuffer frameBuffer = display().QueryFramebuffer(m_uScreenId);
    607609    if (!frameBuffer.isNull())
    608         display().DetachFramebuffer(m_uScreenId);
     610    {
     611        display().DetachFramebuffer(m_uScreenId, m_strFramebufferId);
     612        m_strFramebufferId.clear();
     613    }
    609614}
    610615
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r55078 r55133  
    1593815938  <interface
    1593915939    name="IDisplay" extends="$unknown"
    15940     uuid="04AA5E91-3816-4990-8C52-59939307E5EF"
     15940    uuid="94a7faa2-7792-42a3-8535-00770eca1f53"
    1594115941    wsmap="managed"
    1594215942    wrap-hint-server-addinterfaces="IEventListener"
     
    1597815978      <param name="screenId" type="unsigned long" dir="in"/>
    1597915979      <param name="framebuffer" type="IFramebuffer" dir="in"/>
     15980      <param name="id" type="uuid" mod="string" dir="return"/>
    1598015981    </method>
    1598115982
     
    1598515986      </desc>
    1598615987      <param name="screenId" type="unsigned long" dir="in"/>
     15988      <param name="id" type="uuid" mod="string" dir="in"/>
    1598715989    </method>
    1598815990
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r54828 r55133  
    4848
    4949    ComPtr<IFramebuffer> pFramebuffer;
     50    com::Guid framebufferId;
    5051    ComPtr<IDisplaySourceBitmap> pSourceBitmap;
    5152    bool fDisabled;
     
    225226                                        GuestMonitorStatus_T *aGuestMonitorStatus);
    226227    virtual HRESULT attachFramebuffer(ULONG aScreenId,
    227                                       const ComPtr<IFramebuffer> &aFramebuffer);
    228     virtual HRESULT detachFramebuffer(ULONG aScreenId);
     228                                      const ComPtr<IFramebuffer> &aFramebuffer,
     229                                      com::Guid &aId);
     230    virtual HRESULT detachFramebuffer(ULONG aScreenId,
     231                                      const com::Guid &aId);
    229232    virtual HRESULT queryFramebuffer(ULONG aScreenId,
    230233                                     ComPtr<IFramebuffer> &aFramebuffer);
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r54841 r55133  
    16021602
    16031603
    1604 HRESULT Display::attachFramebuffer(ULONG aScreenId, const ComPtr<IFramebuffer> &aFramebuffer)
     1604HRESULT Display::attachFramebuffer(ULONG aScreenId, const ComPtr<IFramebuffer> &aFramebuffer, com::Guid &aId)
    16051605{
    16061606    LogRelFlowFunc(("aScreenId = %d\n", aScreenId));
     
    16181618
    16191619    pFBInfo->pFramebuffer = aFramebuffer;
     1620    pFBInfo->framebufferId.create();
     1621    aId = pFBInfo->framebufferId;
    16201622
    16211623    SafeArray<FramebufferCapabilities_T> caps;
     
    16631665    }
    16641666
    1665     LogRelFlowFunc(("Attached to %d\n", aScreenId));
     1667    LogRelFlowFunc(("Attached to %d %RTuuid\n", aScreenId, aId.raw()));
    16661668    return S_OK;
    16671669}
    16681670
    1669 HRESULT Display::detachFramebuffer(ULONG aScreenId)
    1670 {
    1671     LogRelFlowFunc(("aScreenId = %d\n", aScreenId));
     1671HRESULT Display::detachFramebuffer(ULONG aScreenId, const com::Guid &aId)
     1672{
     1673    LogRelFlowFunc(("aScreenId = %d %RTuuid\n", aScreenId, aId.raw()));
    16721674
    16731675    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    16791681    DISPLAYFBINFO *pFBInfo = &maFramebuffers[aScreenId];
    16801682
     1683    if (pFBInfo->framebufferId != aId)
     1684    {
     1685        LogRelFlowFunc(("Invalid framebuffer aScreenId = %d, attached %p\n", aScreenId, pFBInfo->framebufferId.raw()));
     1686        return setError(E_FAIL, tr("DetachFramebuffer: Invalid framebuffer object"));
     1687    }
     1688
    16811689    pFBInfo->pFramebuffer.setNull();
     1690    pFBInfo->framebufferId.clear();
    16821691
    16831692    alock.release();
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette