VirtualBox

Changeset 51670 in vbox


Ignore:
Timestamp:
Jun 19, 2014 3:12:30 PM (10 years ago)
Author:
vboxsync
Message:

Main,Frontends: use safearray for IFramebuffer::Notify3DEvent

Location:
trunk/src/VBox
Files:
10 edited

Legend:

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

    r51634 r51670  
    577577}
    578578
    579 STDMETHODIMP VBoxSDLFB::Notify3DEvent(ULONG uType, BYTE *pReserved)
     579STDMETHODIMP VBoxSDLFB::Notify3DEvent(ULONG uType, ComSafeArrayIn(BYTE, aData))
    580580{
    581581    return E_NOTIMPL;
  • trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.h

    r51634 r51670  
    9696    STDMETHOD(ProcessVHWACommand)(BYTE *pCommand);
    9797
    98     STDMETHOD(Notify3DEvent)(ULONG uType, BYTE *pReserved);
     98    STDMETHOD(Notify3DEvent)(ULONG uType, ComSafeArrayIn(BYTE, aData));
    9999
    100100    // internal public methods
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp

    r51657 r51670  
    409409}
    410410
    411 STDMETHODIMP UIFrameBuffer::Notify3DEvent(ULONG uType, BYTE *pData)
     411STDMETHODIMP UIFrameBuffer::Notify3DEvent(ULONG uType, ComSafeArrayIn(BYTE, aData))
    412412{
    413413    /* Lock access to frame-buffer: */
     
    426426    }
    427427
     428    com::SafeArray<BYTE> data(ComSafeArrayInArg(aData));
    428429    switch (uType)
    429430    {
     
    432433            /* Notify machine-view with the async-signal
    433434             * about 3D overlay visibility change: */
    434             BOOL fVisible = !!pData;
     435            BOOL fVisible = data[0];
    435436            LogRel2(("UIFrameBuffer::Notify3DEvent: Sending to async-handler: "
    436437                     "(VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_3DDATA = %s)\n",
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h

    r51627 r51670  
    152152    /** EMT callback: Notifies frame-buffer about 3D backend event.
    153153      * @param        uType Event type. Currently only VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_3DDATA is supported.
    154       * @param        pData Event-specific data, depends on the supplied event type.
    155       * @note         Any EMT callback is subsequent. No any other EMT callback can be called until this one processed.
    156       * @note         Calls to this and #setMarkAsUnused method are synchronized (from GUI side). */
    157     STDMETHOD(Notify3DEvent)(ULONG uType, BYTE *pData);
     154      * @param        aData Event-specific data, depends on the supplied event type.
     155      * @note         Any EMT callback is subsequent. No any other EMT callback can be called until this one processed.
     156      * @note         Calls to this and #setMarkAsUnused method are synchronized (from GUI side). */
     157    STDMETHOD(Notify3DEvent)(ULONG uType, ComSafeArrayIn(BYTE, aData));
    158158
    159159    /** Returns frame-buffer data address. */
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h

    r51330 r51670  
    132132typedef DECLCALLBACKPTR(void, PFNCR_SERVER_RPW_DATA) (const struct CR_SERVER_RPW_ENTRY* pEntry, void *pvEntryTexData);
    133133
    134 typedef DECLCALLBACKPTR(void, PFNCRSERVERNOTIFYEVENT) (int32_t screenId, uint32_t uEvent, void*pvData);
     134typedef DECLCALLBACKPTR(void, PFNCRSERVERNOTIFYEVENT) (int32_t screenId, uint32_t uEvent, void* pvData, uint32_t cbData);
    135135
    136136typedef struct CR_SERVER_RPW_ENTRY
  • trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp

    r51524 r51670  
    3232#include <VBox/hgcmsvc.h>
    3333#include <VBox/log.h>
     34#include <VBox/com/array.h>
    3435#include <VBox/com/ErrorInfo.h>
    3536#include <VBox/com/VirtualBox.h>
     
    227228}
    228229
    229 static DECLCALLBACK(void) svcNotifyEventCB(int32_t screenId, uint32_t uEvent, void*pvData)
     230static DECLCALLBACK(void) svcNotifyEventCB(int32_t screenId, uint32_t uEvent, void* pvData, uint32_t cbData)
    230231{
    231232    ComPtr<IDisplay> pDisplay;
     
    245246        return;
    246247
    247     pFramebuffer->Notify3DEvent(uEvent, (BYTE*)pvData);
     248    com::SafeArray<BYTE> data(cbData);
     249    if (cbData)
     250        memcpy(data.raw(), pvData, cbData);
     251
     252    pFramebuffer->Notify3DEvent(uEvent, ComSafeArrayAsInParam(data));
    248253}
    249254
     
    12311236                    do {
    12321237                        /* determine if the framebuffer is functional */
    1233                         rc = pFramebuffer->Notify3DEvent(VBOX3D_NOTIFY_EVENT_TYPE_TEST_FUNCTIONAL, NULL);
     1238                        com::SafeArray<BYTE> data;
     1239                        rc = pFramebuffer->Notify3DEvent(VBOX3D_NOTIFY_EVENT_TYPE_TEST_FUNCTIONAL, ComSafeArrayAsInParam(data));
    12341240
    12351241                        if (rc == S_OK)
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h

    r51655 r51670  
    141141void crVBoxServerMuralFbResizeEnd(HCR_FRAMEBUFFER hFb);
    142142
    143 void crVBoxServerNotifyEvent(int32_t idScreen, uint32_t uEvent, void*pvData);
     143void crVBoxServerNotifyEvent(int32_t idScreen, uint32_t uEvent, void* pvData, uint32_t cbData);
    144144
    145145void crServerRedirMuralFbClear(CRMuralInfo *mural);
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c

    r51524 r51670  
    27842784}
    27852785
    2786 void crVBoxServerNotifyEvent(int32_t idScreen, uint32_t uEvent, void*pvData)
     2786void crVBoxServerNotifyEvent(int32_t idScreen, uint32_t uEvent, void* pvData, uint32_t cbData)
    27872787{
    27882788    /* this is something unexpected, but just in case */
     
    27932793    }
    27942794
    2795     cr_server.pfnNotifyEventCB(idScreen, uEvent, pvData);
     2795    cr_server.pfnNotifyEventCB(idScreen, uEvent, pvData, cbData);
    27962796}
    27972797
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp

    r51536 r51670  
    29002900        if (mFlags.fNeVisible != fVisible || mFlags.fNeForce)
    29012901        {
    2902             crVBoxServerNotifyEvent(mu32Screen, VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_3DDATA, fVisible ? (void*)1 : NULL);
     2902            crVBoxServerNotifyEvent(mu32Screen, VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_3DDATA, &fVisible, sizeof(fVisible));
    29032903            mFlags.fNeVisible = fVisible;
    29042904            mFlags.fNeForce = 0;
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r51627 r51670  
    1527315273  <interface
    1527415274    name="IFramebuffer" extends="$unknown"
    15275     uuid="c42d2714-6263-473f-a6c4-3d3b38983e74"
     15275    uuid="16d73cd3-da84-4a11-a607-ebab57d050d0"
    1527615276    wsmap="managed"
    1527715277    >
     
    1534415344    </attribute>
    1534515345
    15346     <method name="notifyUpdate" wsmap="suppress">
     15346    <method name="notifyUpdate">
    1534715347      <desc>
    1534815348        Informs about an update.
     
    1549715497        <desc>event type. Currently only VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_3DDATA is supported.</desc>
    1549815498      </param>
    15499       <param name="data" type="octet" mod="ptr" dir="in">
     15499      <param name="data" type="octet" dir="in" safearray="yes">
    1550015500        <desc>event-specific data, depends on the supplied event type</desc>
    1550115501      </param>
Note: See TracChangeset for help on using the changeset viewer.

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