Ocean
Loading...
Searching...
No Matches
AVFDevices.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) Meta Platforms, Inc. and affiliates.
3
*
4
* This source code is licensed under the MIT license found in the
5
* LICENSE file in the root directory of this source tree.
6
*/
7
8
#ifndef META_OCEAN_MEDIA_AVF_DEVICES_H
9
#define META_OCEAN_MEDIA_AVF_DEVICES_H
10
11
#include "
ocean/media/avfoundation/AVFoundation.h
"
12
13
#include <vector>
14
15
namespace
Ocean
16
{
17
18
namespace
Media
19
{
20
21
namespace
AVFoundation
22
{
23
24
/**
25
* This class implements a simple enumerator for devices available via the AVFoundation library.
26
* @ingroup mediaavf
27
*/
28
class
AVFDevices
29
{
30
public
:
31
32
/**
33
* Definition of a simple class combining device name and unique device id.
34
*/
35
class
Device
36
{
37
friend
class
AVFDevices
;
38
39
public
:
40
41
/**
42
* Returns the user-friendly name of this device.
43
* @return The device's readable name
44
*/
45
inline
const
std::wstring&
friendlyName
()
const
;
46
47
/**
48
* Returns the unique id of this device.
49
* @return The device's unique id
50
*/
51
inline
const
std::wstring&
uniqueId
()
const
;
52
53
protected
:
54
55
/**
56
* Creates a new device object.
57
* @param friendlyName The user-friendly name of the device
58
* @param uniqueId The unique id of the device
59
*/
60
inline
Device
(
const
std::wstring&
friendlyName
,
const
std::wstring&
uniqueId
);
61
62
protected
:
63
64
/// The user-friendly name of this device.
65
std::wstring
friendlyName_
;
66
67
/// The unique id of this device.
68
std::wstring
uniqueId_
;
69
};
70
71
/**
72
* Definition of a vector holding devices.
73
*/
74
using
Devices
= std::vector<Device>;
75
76
public
:
77
78
/**
79
* Returns the list of currently available video devices.
80
* @return The currently available video devices
81
*/
82
static
Devices
videoDevices
();
83
};
84
85
inline
AVFDevices::Device::Device
(
const
std::wstring& friendlyName,
const
std::wstring& uniqueId) :
86
friendlyName_(friendlyName),
87
uniqueId_(uniqueId)
88
{
89
// nothing to do here
90
}
91
92
inline
const
std::wstring&
AVFDevices::Device::friendlyName
()
const
93
{
94
return
friendlyName_;
95
}
96
97
inline
const
std::wstring&
AVFDevices::Device::uniqueId
()
const
98
{
99
return
uniqueId_;
100
}
101
102
}
103
104
}
105
106
}
107
108
#endif
// META_OCEAN_MEDIA_AVF_DEVICES_H
AVFoundation.h
Ocean::Media::AVFoundation::AVFDevices::Device
Definition of a simple class combining device name and unique device id.
Definition
AVFDevices.h:36
Ocean::Media::AVFoundation::AVFDevices::Device::uniqueId_
std::wstring uniqueId_
The unique id of this device.
Definition
AVFDevices.h:68
Ocean::Media::AVFoundation::AVFDevices::Device::friendlyName
const std::wstring & friendlyName() const
Returns the user-friendly name of this device.
Definition
AVFDevices.h:92
Ocean::Media::AVFoundation::AVFDevices::Device::Device
Device(const std::wstring &friendlyName, const std::wstring &uniqueId)
Creates a new device object.
Definition
AVFDevices.h:85
Ocean::Media::AVFoundation::AVFDevices::Device::friendlyName_
std::wstring friendlyName_
The user-friendly name of this device.
Definition
AVFDevices.h:65
Ocean::Media::AVFoundation::AVFDevices::Device::uniqueId
const std::wstring & uniqueId() const
Returns the unique id of this device.
Definition
AVFDevices.h:97
Ocean::Media::AVFoundation::AVFDevices
This class implements a simple enumerator for devices available via the AVFoundation library.
Definition
AVFDevices.h:29
Ocean::Media::AVFoundation::AVFDevices::Devices
std::vector< Device > Devices
Definition of a vector holding devices.
Definition
AVFDevices.h:74
Ocean::Media::AVFoundation::AVFDevices::videoDevices
static Devices videoDevices()
Returns the list of currently available video devices.
Ocean
The namespace covering the entire Ocean framework.
Definition
Accessor.h:15
impl
ocean
media
avfoundation
AVFDevices.h
Generated on Sat May 2 2026 06:43:54 for Ocean by
1.9.8