Ring Daemon
16.0.0
Loading...
Searching...
No Matches
iosvideo/video_device_monitor_impl.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2004-2025 Savoir-faire Linux Inc.
3
*
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16
*/
17
18
#include <mutex>
19
#include <thread>
20
21
#include "../video_device_monitor.h"
22
#include "
logger.h
"
23
#include "
noncopyable.h
"
24
25
namespace
jami
{
26
namespace
video
{
27
28
class
VideoDeviceMonitorImpl
29
{
30
public
:
31
/*
32
* This is the only restriction to the pImpl design:
33
* as the Linux implementation has a thread, it needs a way to notify
34
* devices addition and deletion.
35
*
36
* This class should maybe inherit from VideoDeviceMonitor instead of
37
* being its pImpl.
38
*/
39
VideoDeviceMonitorImpl
(
VideoDeviceMonitor
* monitor);
40
~VideoDeviceMonitorImpl
();
41
42
void
start
();
43
44
private
:
45
NON_COPYABLE
(
VideoDeviceMonitorImpl
);
46
47
VideoDeviceMonitor
* monitor_;
48
49
void
run();
50
51
mutable
std::mutex mutex_;
52
bool
probing_;
53
std::thread thread_;
54
};
55
56
VideoDeviceMonitorImpl::VideoDeviceMonitorImpl
(
VideoDeviceMonitor
* monitor)
57
: monitor_(monitor)
58
, mutex_()
59
, thread_()
60
{}
61
62
void
63
VideoDeviceMonitorImpl::start
()
64
{
65
probing_ =
true
;
66
thread_ = std::thread(&VideoDeviceMonitorImpl::run,
this
);
67
}
68
69
VideoDeviceMonitorImpl::~VideoDeviceMonitorImpl
()
70
{
71
probing_ =
false
;
72
if
(thread_.joinable())
73
thread_.join();
74
}
75
76
void
77
VideoDeviceMonitorImpl::run()
78
{}
79
80
VideoDeviceMonitor::VideoDeviceMonitor
()
81
: preferences_()
82
, devices_()
83
, monitorImpl_(
new
VideoDeviceMonitorImpl(
this
))
84
{
85
monitorImpl_->start();
86
}
87
88
VideoDeviceMonitor::~VideoDeviceMonitor
() {}
89
90
}
// namespace video
91
}
// namespace jami
jami::video::VideoDeviceMonitorImpl
Definition
androidvideo/video_device_monitor_impl.cpp:39
jami::video::VideoDeviceMonitorImpl::start
void start()
jami::video::VideoDeviceMonitorImpl::VideoDeviceMonitorImpl
VideoDeviceMonitorImpl(VideoDeviceMonitor *monitor)
jami::video::VideoDeviceMonitorImpl::~VideoDeviceMonitorImpl
~VideoDeviceMonitorImpl()
jami::video::VideoDeviceMonitor
Definition
video_device_monitor.h:41
jami::video::VideoDeviceMonitor::VideoDeviceMonitor
VideoDeviceMonitor()
Definition
androidvideo/video_device_monitor_impl.cpp:69
jami::video::VideoDeviceMonitor::~VideoDeviceMonitor
~VideoDeviceMonitor()
Definition
androidvideo/video_device_monitor_impl.cpp:75
logger.h
jami
Definition
account.cpp:61
jami::emitSignal
void emitSignal(Args... args)
Definition
ring_signal.h:64
noncopyable.h
Simple macro to hide class' copy constructor and assignment operator.
NON_COPYABLE
#define NON_COPYABLE(ClassName)
Definition
noncopyable.h:30
StreamType::video
@ video
src
media
video
iosvideo
video_device_monitor_impl.cpp
Generated on Thu Jun 19 2025 15:50:37 for Ring Daemon by
1.9.8