VirtualBox

Changeset 48578 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Sep 20, 2013 10:35:43 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
89135
Message:

IHost::VideoCaptureDevices

Location:
trunk/src/VBox/Main
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/Makefile.kmk

    r48479 r48578  
    349349        src-server/HostNetworkInterfaceImpl.cpp \
    350350        src-server/HostPower.cpp \
     351        src-server/HostVideoCaptureDeviceImpl.cpp \
    351352        src-server/MachineImpl.cpp \
    352353        src-server/MachineImplCloneVM.cpp \
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r48538 r48578  
    83098309
    83108310  <interface
     8311    name="IHostVideoCaptureDevice" extends="$unknown"
     8312    uuid="b3979ea4-bf32-4a03-8158-44d64a59487d"
     8313    wsmap="managed"
     8314    >
     8315    <desc>
     8316      Represents one of host's video capture devices, for example a webcam.
     8317    </desc>
     8318    <attribute name="name" type="wstring" readonly="yes">
     8319      <desc>User friendly name.</desc>
     8320    </attribute>
     8321
     8322    <attribute name="path" type="wstring" readonly="yes">
     8323      <desc>The host path of the device.</desc>
     8324    </attribute>
     8325
     8326    <attribute name="alias" type="wstring" readonly="yes">
     8327      <desc>An alias which can be used for IConsole::webcamAttach</desc>
     8328    </attribute>
     8329
     8330  </interface>
     8331
     8332  <interface
    83118333    name="IHost" extends="$unknown"
    8312     uuid="a6107246-f939-42c4-82b6-8aca40327b6d"
     8334    uuid="e1e3150d-1764-4819-b53a-c09a75a8b8f0"
    83138335    wsmap="managed"
    83148336    >
     
    87658787      </param>
    87668788    </method>
     8789
     8790    <attribute name="videoCaptureDevices" type="IHostVideoCaptureDevice" safearray="yes" readonly="yes">
     8791      <desc>List of currently available host video capture devices.</desc>
     8792    </attribute>
    87678793
    87688794  </interface>
  • trunk/src/VBox/Main/include/HostImpl.h

    r47018 r48578  
    7878    STDMETHOD(COMGETTER(UTCTime))(LONG64 *aUTCTime);
    7979    STDMETHOD(COMGETTER(Acceleration3DAvailable))(BOOL *aSupported);
     80    STDMETHOD(COMGETTER(VideoCaptureDevices))(ComSafeArrayOut(IHostVideoCaptureDevice*, aVideoCaptureDevices));
    8081
    8182    // IHost methods
  • trunk/src/VBox/Main/src-server/HostImpl.cpp

    r48333 r48578  
    3232
    3333#include "HostNetworkInterfaceImpl.h"
     34#include "HostVideoCaptureDeviceImpl.h"
    3435#include "MachineImpl.h"
    3536#include "AutoCaller.h"
     
    17241725    Bstr(mac).cloneTo(aAddress);
    17251726    return S_OK;
     1727}
     1728
     1729/**
     1730 * Returns a list of host video capture devices (webcams, etc).
     1731 *
     1732 * @returns COM status code
     1733 * @param aVideoCaptureDevices Array of interface pointers to be filled.
     1734 */
     1735STDMETHODIMP Host::COMGETTER(VideoCaptureDevices)(ComSafeArrayOut(IHostVideoCaptureDevice*, aVideoCaptureDevices))
     1736{
     1737    if (ComSafeArrayOutIsNull(aVideoCaptureDevices))
     1738        return E_POINTER;
     1739
     1740    AutoCaller autoCaller(this);
     1741    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1742
     1743    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     1744    HostVideoCaptureDeviceList list;
     1745
     1746    HRESULT hr = HostVideoCaptureDevice::queryHostDevices(&list);
     1747
     1748    if (SUCCEEDED(hr))
     1749    {
     1750        SafeIfaceArray<IHostVideoCaptureDevice> devices(list);
     1751        devices.detachTo(ComSafeArrayOutArg(aVideoCaptureDevices));
     1752    }
     1753
     1754    return hr;
    17261755}
    17271756
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