File: s0048.patch

package info (click to toggle)
firefox 147.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,683,484 kB
  • sloc: cpp: 7,607,246; javascript: 6,533,185; ansic: 3,775,227; python: 1,415,393; xml: 634,561; asm: 438,951; java: 186,241; sh: 62,752; makefile: 18,079; objc: 13,092; perl: 12,808; yacc: 4,583; cs: 3,846; pascal: 3,448; lex: 1,720; ruby: 1,003; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10; exp: 6
file content (73 lines) | stat: -rw-r--r-- 2,458 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
From: Michael Froman <mjfroman@mac.com>
Date: Thu, 19 May 2022 15:32:32 -0500
Subject: Bug 1772380 - Build 1766646 - (fix-c89fdd716c) fixes for the
 refactored PlatformThread API;r?mjf

---
 .../video_capture/linux/device_info_v4l2.cc   | 20 ++++++-------------
 .../video_capture/linux/device_info_v4l2.h    |  3 +--
 2 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/modules/video_capture/linux/device_info_v4l2.cc b/modules/video_capture/linux/device_info_v4l2.cc
index 0d410ed16d..87b39d794d 100644
--- a/modules/video_capture/linux/device_info_v4l2.cc
+++ b/modules/video_capture/linux/device_info_v4l2.cc
@@ -151,11 +151,6 @@ int DeviceInfoV4l2::ProcessInotifyEvents()
     return 0;
 }
 
-void DeviceInfoV4l2::InotifyEventThread(void* obj)
-{
-    static_cast<DeviceInfoLinux*> (obj)->InotifyProcess();
-}
-
 void DeviceInfoV4l2::InotifyProcess()
 {
     _fd_v4l = inotify_init();
@@ -181,16 +176,14 @@ void DeviceInfoV4l2::InotifyProcess()
 
 DeviceInfoV4l2::DeviceInfoV4l2() : DeviceInfoImpl()
 #ifdef WEBRTC_LINUX
-    , _inotifyEventThread(new rtc::PlatformThread(
-                            InotifyEventThread, this, "InotifyEventThread"))
     , _isShutdown(false)
 #endif
 {
 #ifdef WEBRTC_LINUX
-    if (_inotifyEventThread)
-    {
-        _inotifyEventThread->Start();
-    }
+  _inotifyEventThread = PlatformThread::SpawnJoinable(
+      [this] {
+        InotifyProcess();
+      }, "InotifyEventThread");
 #endif
 }
 
@@ -202,9 +195,8 @@ DeviceInfoV4l2::~DeviceInfoV4l2() {
 #ifdef WEBRTC_LINUX
     _isShutdown = true;
 
-    if (_inotifyEventThread) {
-        _inotifyEventThread->Stop();
-        _inotifyEventThread = nullptr;
+    if (!_inotifyEventThread.empty()) {
+      _inotifyEventThread.Finalize();
     }
 #endif
 }
diff --git a/modules/video_capture/linux/device_info_v4l2.h b/modules/video_capture/linux/device_info_v4l2.h
index 74dd7e5818..db98a62bcc 100644
--- a/modules/video_capture/linux/device_info_v4l2.h
+++ b/modules/video_capture/linux/device_info_v4l2.h
@@ -61,8 +61,7 @@ class DeviceInfoV4l2 : public DeviceInfoImpl {
   int EventCheck(int fd);
   int HandleEvents(int fd);
   int ProcessInotifyEvents();
-  std::unique_ptr<rtc::PlatformThread> _inotifyEventThread;
-  static void InotifyEventThread(void*);
+  PlatformThread _inotifyEventThread;
   void InotifyProcess();
   int _fd_v4l, _fd_dev, _wd_v4l, _wd_dev; /* accessed on InotifyEventThread thread */
   std::atomic<bool> _isShutdown;