1 | /* $Id: HostVideoCaptureDeviceImpl.cpp 48578 2013-09-20 10:35:43Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | *
|
---|
4 | * Host video capture device implementation.
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2013 Oracle Corporation
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.215389.xyz. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | */
|
---|
18 |
|
---|
19 | #include "HostVideoCaptureDeviceImpl.h"
|
---|
20 | #include "Logging.h"
|
---|
21 |
|
---|
22 | /*
|
---|
23 | * HostVideoCaptureDevice implementation.
|
---|
24 | */
|
---|
25 | DEFINE_EMPTY_CTOR_DTOR(HostVideoCaptureDevice)
|
---|
26 |
|
---|
27 | HRESULT HostVideoCaptureDevice::FinalConstruct()
|
---|
28 | {
|
---|
29 | return BaseFinalConstruct();
|
---|
30 | }
|
---|
31 |
|
---|
32 | void HostVideoCaptureDevice::FinalRelease()
|
---|
33 | {
|
---|
34 | uninit();
|
---|
35 |
|
---|
36 | BaseFinalRelease();
|
---|
37 | }
|
---|
38 |
|
---|
39 | /*
|
---|
40 | * Initializes the instance.
|
---|
41 | */
|
---|
42 | HRESULT HostVideoCaptureDevice::init(com::Utf8Str name, com::Utf8Str path, com::Utf8Str alias)
|
---|
43 | {
|
---|
44 | LogFlowThisFunc(("\n"));
|
---|
45 |
|
---|
46 | /* Enclose the state transition NotReady->InInit->Ready */
|
---|
47 | AutoInitSpan autoInitSpan(this);
|
---|
48 | AssertReturn(autoInitSpan.isOk(), E_FAIL);
|
---|
49 |
|
---|
50 | m.name = name;
|
---|
51 | m.path = path;
|
---|
52 | m.alias = alias;
|
---|
53 |
|
---|
54 | /* Confirm a successful initialization */
|
---|
55 | autoInitSpan.setSucceeded();
|
---|
56 |
|
---|
57 | return S_OK;
|
---|
58 | }
|
---|
59 |
|
---|
60 | /*
|
---|
61 | * Uninitializes the instance.
|
---|
62 | * Called either from FinalRelease() or by the parent when it gets destroyed.
|
---|
63 | */
|
---|
64 | void HostVideoCaptureDevice::uninit()
|
---|
65 | {
|
---|
66 | LogFlowThisFunc(("\n"));
|
---|
67 |
|
---|
68 | m.name.setNull();
|
---|
69 | m.path.setNull();
|
---|
70 | m.alias.setNull();
|
---|
71 |
|
---|
72 | /* Enclose the state transition Ready->InUninit->NotReady */
|
---|
73 | AutoUninitSpan autoUninitSpan(this);
|
---|
74 | if (autoUninitSpan.uninitDone())
|
---|
75 | return;
|
---|
76 | }
|
---|
77 |
|
---|
78 | /* static */ HRESULT HostVideoCaptureDevice::queryHostDevices(HostVideoCaptureDeviceList *pList)
|
---|
79 | {
|
---|
80 | HRESULT hr = S_OK;
|
---|
81 | #if 0
|
---|
82 | PDARWINETHERNIC pEtherNICs = DarwinGetEthernetControllers();
|
---|
83 | while (pEtherNICs)
|
---|
84 | {
|
---|
85 | ComObjPtr<HostNetworkInterface> IfObj;
|
---|
86 | IfObj.createObject();
|
---|
87 | if (SUCCEEDED(IfObj->init(Bstr(pEtherNICs->szName), Guid(pEtherNICs->Uuid), HostNetworkInterfaceType_Bridged)))
|
---|
88 | list.push_back(IfObj);
|
---|
89 |
|
---|
90 | /* next, free current */
|
---|
91 | void *pvFree = pEtherNICs;
|
---|
92 | pEtherNICs = pEtherNICs->pNext;
|
---|
93 | RTMemFree(pvFree);
|
---|
94 | }
|
---|
95 | #endif
|
---|
96 | return hr;
|
---|
97 | }
|
---|
98 |
|
---|
99 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|