VirtualBox

Changeset 47416 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Jul 26, 2013 6:55:18 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
87566
Message:

include,Main,Extpack: emulated webcam updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/UsbWebcamInterface.cpp

    r45029 r47416  
    5151
    5252
     53static DECLCALLBACK(void) drvEmWebcamReady(PPDMIWEBCAMDOWN pInterface,
     54                                           bool fReady)
     55{
     56    PEMWEBCAMDRV pThis = RT_FROM_MEMBER(pInterface, EMWEBCAMDRV, IWebcamDown);
     57    NOREF(pThis);
     58    NOREF(fReady);
     59}
     60
    5361static DECLCALLBACK(int) drvEmWebcamControl(PPDMIWEBCAMDOWN pInterface,
    5462                                            void *pvUser,
     
    270278    if (mpDrv && mpDrv->pIWebcamUp)
    271279    {
    272         mpDrv->pIWebcamUp->pfnWebcamUpFrame(mpDrv->pIWebcamUp,
    273                                             mpRemote->u64DeviceId,
    274                                             (const uint8_t *)pFrame,
    275                                             cbFrame);
     280        if (   cbFrame >= sizeof(VRDEVIDEOINPAYLOADHDR)
     281            && cbFrame >= pFrame->u8HeaderLength)
     282        {
     283            uint32_t cbImage = cbFrame - pFrame->u8HeaderLength;
     284            const uint8_t *pu8Image = cbImage > 0? (const uint8_t *)pFrame + pFrame->u8HeaderLength: NULL;
     285
     286            mpDrv->pIWebcamUp->pfnWebcamUpFrame(mpDrv->pIWebcamUp,
     287                                                mpRemote->u64DeviceId,
     288                                                (PDMIWEBCAM_FRAMEHDR *)pFrame,
     289                                                pFrame->u8HeaderLength,
     290                                                pu8Image,
     291                                                cbImage);
     292        }
    276293    }
    277294}
     
    380397    pDrvIns->IBase.pfnQueryInterface = drvQueryInterface;
    381398
     399    pThis->IWebcamDown.pfnWebcamDownReady = drvEmWebcamReady;
    382400    pThis->IWebcamDown.pfnWebcamDownControl = drvEmWebcamControl;
    383401
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