summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/moz-patch-stack/0012.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /third_party/libwebrtc/moz-patch-stack/0012.patch
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/moz-patch-stack/0012.patch')
-rw-r--r--third_party/libwebrtc/moz-patch-stack/0012.patch150
1 files changed, 150 insertions, 0 deletions
diff --git a/third_party/libwebrtc/moz-patch-stack/0012.patch b/third_party/libwebrtc/moz-patch-stack/0012.patch
new file mode 100644
index 0000000000..9a7e0c365c
--- /dev/null
+++ b/third_party/libwebrtc/moz-patch-stack/0012.patch
@@ -0,0 +1,150 @@
+From: Jan Beich <jbeich@FreeBSD.org>
+Date: Fri, 12 Oct 2018 12:56:00 -0400
+Subject: Bug 1376873 - Unbreak WebRTC 64 build on BSDs. r=dminor f=gaston
+
+Also includes:
+Bug 1554949 - Fix WebRTC build failure with newer linux kernel. r=dminor
+
+Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/a636ecdcb91afb1c5d436bbcbd87da4f10f7df78
+---
+ modules/video_capture/linux/device_info_linux.cc | 6 ++++++
+ modules/video_capture/linux/device_info_v4l2.cc | 8 +++++++-
+ modules/video_capture/linux/video_capture_linux.cc | 9 ++++++++-
+ rtc_base/byte_order.h | 2 ++
+ rtc_base/physical_socket_server.cc | 7 +++++--
+ system_wrappers/source/cpu_info.cc | 4 ++--
+ 6 files changed, 30 insertions(+), 6 deletions(-)
+
+diff --git a/modules/video_capture/linux/device_info_linux.cc b/modules/video_capture/linux/device_info_linux.cc
+index 4f8b7c059b..56da475bf3 100644
+--- a/modules/video_capture/linux/device_info_linux.cc
++++ b/modules/video_capture/linux/device_info_linux.cc
+@@ -16,7 +16,13 @@
+ #include <sys/ioctl.h>
+ #include <unistd.h>
+ // v4l includes
++#if defined(__NetBSD__) || defined(__OpenBSD__) // WEBRTC_BSD
++#include <sys/videoio.h>
++#elif defined(__sun)
++#include <sys/videodev2.h>
++#else
+ #include <linux/videodev2.h>
++#endif
+
+ #include <vector>
+
+diff --git a/modules/video_capture/linux/device_info_v4l2.cc b/modules/video_capture/linux/device_info_v4l2.cc
+index 7397a10625..19b32f16b9 100644
+--- a/modules/video_capture/linux/device_info_v4l2.cc
++++ b/modules/video_capture/linux/device_info_v4l2.cc
+@@ -18,7 +18,13 @@
+ #include <sys/ioctl.h>
+ #include <unistd.h>
+ // v4l includes
++#if defined(__NetBSD__) || defined(__OpenBSD__) // WEBRTC_BSD
++#include <sys/videoio.h>
++#elif defined(__sun)
++#include <sys/videodev2.h>
++#else
+ #include <linux/videodev2.h>
++#endif
+
+ #include <vector>
+
+@@ -209,8 +215,8 @@ DeviceInfoV4l2::DeviceInfoV4l2() : DeviceInfoImpl()
+ {
+ _inotifyEventThread->Start();
+ }
+-}
+ #endif
++}
+
+ int32_t DeviceInfoV4l2::Init() {
+ return 0;
+diff --git a/modules/video_capture/linux/video_capture_linux.cc b/modules/video_capture/linux/video_capture_linux.cc
+index a2ea218a8b..23a8f4f3f3 100644
+--- a/modules/video_capture/linux/video_capture_linux.cc
++++ b/modules/video_capture/linux/video_capture_linux.cc
+@@ -10,7 +10,6 @@
+
+ #include <errno.h>
+ #include <fcntl.h>
+-#include <linux/videodev2.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+@@ -18,6 +17,14 @@
+ #include <sys/select.h>
+ #include <time.h>
+ #include <unistd.h>
++// v4l includes
++#if defined(__NetBSD__) || defined(__OpenBSD__) // WEBRTC_BSD
++#include <sys/videoio.h>
++#elif defined(__sun)
++#include <sys/videodev2.h>
++#else
++#include <linux/videodev2.h>
++#endif
+
+ #include <new>
+ #include <string>
+diff --git a/rtc_base/byte_order.h b/rtc_base/byte_order.h
+index b8f8ae9f7a..382511daeb 100644
+--- a/rtc_base/byte_order.h
++++ b/rtc_base/byte_order.h
+@@ -90,6 +90,8 @@
+ #error WEBRTC_ARCH_BIG_ENDIAN or WEBRTC_ARCH_LITTLE_ENDIAN must be defined.
+ #endif // defined(WEBRTC_ARCH_LITTLE_ENDIAN)
+
++#elif defined(WEBRTC_BSD) && !defined(__OpenBSD__)
++#include <sys/endian.h>
+ #elif defined(WEBRTC_POSIX)
+ #include <endian.h>
+ #else
+diff --git a/rtc_base/physical_socket_server.cc b/rtc_base/physical_socket_server.cc
+index b0af1c20ce..b13d1aa21b 100644
+--- a/rtc_base/physical_socket_server.cc
++++ b/rtc_base/physical_socket_server.cc
+@@ -73,7 +73,10 @@ typedef void* SockOptArg;
+
+ #endif // WEBRTC_POSIX
+
+-#if defined(WEBRTC_POSIX) && !defined(WEBRTC_MAC) && !defined(__native_client__)
++#if defined(WEBRTC_POSIX) && !defined(WEBRTC_MAC) && !defined(WEBRTC_BSD) && !defined(__native_client__)
++#if defined(WEBRTC_LINUX)
++#include <linux/sockios.h>
++#endif
+
+ int64_t GetSocketRecvTimestamp(int socket) {
+ struct timeval tv_ioctl;
+@@ -641,7 +644,7 @@ int PhysicalSocket::TranslateOption(Option opt, int* slevel, int* sopt) {
+ *slevel = IPPROTO_IP;
+ *sopt = IP_DONTFRAGMENT;
+ break;
+-#elif defined(WEBRTC_MAC) || defined(BSD) || defined(__native_client__)
++#elif defined(WEBRTC_MAC) || defined(WEBRTC_BSD) || defined(__native_client__)
+ RTC_LOG(LS_WARNING) << "Socket::OPT_DONTFRAGMENT not supported.";
+ return -1;
+ #elif defined(WEBRTC_POSIX)
+diff --git a/system_wrappers/source/cpu_info.cc b/system_wrappers/source/cpu_info.cc
+index eff720371a..94aed09c48 100644
+--- a/system_wrappers/source/cpu_info.cc
++++ b/system_wrappers/source/cpu_info.cc
+@@ -12,7 +12,7 @@
+
+ #if defined(WEBRTC_WIN)
+ #include <windows.h>
+-#elif defined(WEBRTC_LINUX)
++#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
+ #include <unistd.h>
+ #elif defined(WEBRTC_MAC)
+ #include <sys/sysctl.h>
+@@ -30,7 +30,7 @@ static int DetectNumberOfCores() {
+ SYSTEM_INFO si;
+ GetNativeSystemInfo(&si);
+ number_of_cores = static_cast<int>(si.dwNumberOfProcessors);
+-#elif defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID)
++#elif defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID) || defined(WEBRTC_BSD)
+ number_of_cores = static_cast<int>(sysconf(_SC_NPROCESSORS_ONLN));
+ if (number_of_cores <= 0) {
+ RTC_LOG(LS_ERROR) << "Failed to get number of cores";