VirtualBox

Ignore:
Timestamp:
Sep 20, 2013 2:30:46 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
89166
Message:

VBoxManage,Main: IHost::VideoCaptureDevices. Windows host implementation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp

    r48538 r48600  
    733733
    734734/**
     735 * List video capture devices.
     736 *
     737 * @returns See produceList.
     738 * @param   pVirtualBox         Reference to the IVirtualBox pointer.
     739 */
     740static HRESULT listVideoCaptureDevices(const ComPtr<IVirtualBox> pVirtualBox)
     741{
     742    HRESULT rc;
     743    ComPtr<IHost> host;
     744    CHECK_ERROR(pVirtualBox, COMGETTER(Host)(host.asOutParam()));
     745    com::SafeIfaceArray<IHostVideoCaptureDevice> hostVideoCaptureDevices;
     746    CHECK_ERROR(host, COMGETTER(VideoCaptureDevices)(ComSafeArrayAsOutParam(hostVideoCaptureDevices)));
     747    RTPrintf("Video Capture Devices: %u\n", hostVideoCaptureDevices.size());
     748    for (size_t i = 0; i < hostVideoCaptureDevices.size(); ++i)
     749    {
     750        ComPtr<IHostVideoCaptureDevice> p = hostVideoCaptureDevices[i];
     751        Bstr name;
     752        p->COMGETTER(Name)(name.asOutParam());
     753        Bstr path;
     754        p->COMGETTER(Path)(path.asOutParam());
     755        Bstr alias;
     756        p->COMGETTER(Alias)(alias.asOutParam());
     757        RTPrintf("%ls \"%ls\"\n%ls\n", alias.raw(), name.raw(), path.raw());
     758    }
     759    return rc;
     760}
     761
     762
     763/**
    735764 * The type of lists we can produce.
    736765 */
     
    760789    kListExtPacks,
    761790    kListGroups,
    762     kListNatNetworks
     791    kListNatNetworks,
     792    kListVideoCaptureDevices
    763793};
    764794
     
    10941124        }
    10951125
     1126        case kListVideoCaptureDevices:
     1127            rc = listVideoCaptureDevices(pVirtualBox);
     1128            break;
     1129
    10961130        /* No default here, want gcc warnings. */
    10971131
     
    11421176        { "extpacks",           kListExtPacks,           RTGETOPT_REQ_NOTHING },
    11431177        { "groups",             kListGroups,             RTGETOPT_REQ_NOTHING },
     1178        { "webcams",            kListVideoCaptureDevices, RTGETOPT_REQ_NOTHING },
    11441179    };
    11451180
     
    11871222            case kListGroups:
    11881223            case kListNatNetworks:
     1224            case kListVideoCaptureDevices:
    11891225                enmOptCommand = (enum enmListType)ch;
    11901226                if (fOptMultiple)
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