diff --git a/media-libs/tg_owt/patches/tg_owt-0.0.20220425.patchset b/media-libs/tg_owt/patches/tg_owt-0.0.20220508.patchset similarity index 85% rename from media-libs/tg_owt/patches/tg_owt-0.0.20220425.patchset rename to media-libs/tg_owt/patches/tg_owt-0.0.20220508.patchset index 840e0efc8..b2f068a5b 100644 --- a/media-libs/tg_owt/patches/tg_owt-0.0.20220425.patchset +++ b/media-libs/tg_owt/patches/tg_owt-0.0.20220508.patchset @@ -1,14 +1,14 @@ -From d019205b25ee4228eabdff960034b35aa35bcb7b Mon Sep 17 00:00:00 2001 +From de85b0d6fd402945a8442e6568826fed8dfa0b7c Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Tue, 15 Mar 2022 00:13:15 +1000 +Date: Thu, 23 Jun 2022 22:09:18 +1000 Subject: Add Haiku support diff --git a/CMakeLists.txt b/CMakeLists.txt -index f400cfc..0aeba37 100644 +index 235f0f3..6deeced 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -188,7 +188,7 @@ endif() +@@ -189,7 +189,7 @@ endif() include(cmake/libwebrtcbuild.cmake) target_link_libraries(tg_owt PUBLIC tg_owt::libwebrtcbuild) @@ -17,7 +17,7 @@ index f400cfc..0aeba37 100644 link_x11(tg_owt) endif() -@@ -1528,6 +1528,9 @@ PRIVATE +@@ -1476,6 +1476,9 @@ PRIVATE modules/video_capture/device_info_impl.cc modules/video_capture/linux/device_info_linux.cc modules/video_capture/linux/video_capture_linux.cc @@ -27,7 +27,7 @@ index f400cfc..0aeba37 100644 modules/video_capture/windows/device_info_ds.cc modules/video_capture/windows/device_info_ds.h modules/video_capture/windows/help_functions_ds.cc -@@ -2101,6 +2104,7 @@ PRIVATE +@@ -2203,6 +2206,7 @@ PRIVATE modules/desktop_capture/mouse_cursor.h modules/desktop_capture/mouse_cursor_monitor.h modules/desktop_capture/mouse_cursor_monitor_linux.cc @@ -35,7 +35,7 @@ index f400cfc..0aeba37 100644 modules/desktop_capture/mouse_cursor_monitor_mac.mm modules/desktop_capture/mouse_cursor_monitor_win.cc modules/desktop_capture/resolution_tracker.cc -@@ -2112,8 +2116,10 @@ PRIVATE +@@ -2214,8 +2218,10 @@ PRIVATE modules/desktop_capture/screen_capturer_helper.h modules/desktop_capture/screen_capturer_darwin.mm modules/desktop_capture/screen_capturer_linux.cc @@ -46,7 +46,7 @@ index f400cfc..0aeba37 100644 modules/desktop_capture/window_capturer_mac.mm modules/desktop_capture/window_capturer_win.cc modules/desktop_capture/window_finder.cc -@@ -2128,6 +2134,10 @@ PRIVATE +@@ -2230,6 +2236,10 @@ PRIVATE modules/desktop_capture/screen_capturer_null.cc modules/desktop_capture/window_capturer_null.cc @@ -55,29 +55,13 @@ index f400cfc..0aeba37 100644 + modules/desktop_capture/haiku/screen_capturer_haiku.h + # linux specific - modules/desktop_capture/linux/base_capturer_pipewire.cc - modules/desktop_capture/linux/base_capturer_pipewire.h -diff --git a/cmake/libusrsctp.cmake b/cmake/libusrsctp.cmake -index 04f5aa9..f99e975 100644 ---- a/cmake/libusrsctp.cmake -+++ b/cmake/libusrsctp.cmake -@@ -30,6 +30,11 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") - PRIVATE - __Userspace_os_OpenBSD - ) -+elseif (HAIKU) -+ target_compile_definitions(libusrsctp -+ PRIVATE -+ __Userspace_os_Haiku -+ ) - else() - target_compile_definitions(libusrsctp - PRIVATE + modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc + modules/desktop_capture/linux/wayland/base_capturer_pipewire.h diff --git a/cmake/libwebrtcbuild.cmake b/cmake/libwebrtcbuild.cmake -index 7d955ea..608a16a 100644 +index 4d037f4..e5f1dd5 100644 --- a/cmake/libwebrtcbuild.cmake +++ b/cmake/libwebrtcbuild.cmake -@@ -53,6 +53,12 @@ if (WIN32) +@@ -54,6 +54,12 @@ if (WIN32) INTERFACE WEBRTC_WIN ) @@ -244,10 +228,10 @@ index 0000000..b6f4d24 +} // namespace webrtc diff --git a/src/modules/desktop_capture/haiku/screen_capturer_haiku.h b/src/modules/desktop_capture/haiku/screen_capturer_haiku.h new file mode 100644 -index 0000000..b541795 +index 0000000..b24160e --- /dev/null +++ b/src/modules/desktop_capture/haiku/screen_capturer_haiku.h -@@ -0,0 +1,58 @@ +@@ -0,0 +1,55 @@ +/* + * Copyright 2021 Gerasim Troeglazov + * @@ -270,7 +254,6 @@ index 0000000..b541795 +#include "modules/desktop_capture/screen_capture_frame_queue.h" +#include "modules/desktop_capture/screen_capturer_helper.h" +#include "modules/desktop_capture/shared_desktop_frame.h" -+#include "rtc_base/constructor_magic.h" + +#include +#include @@ -299,8 +282,6 @@ index 0000000..b541795 + + DesktopCaptureOptions options_; + Callback* callback_ = nullptr; -+ -+ RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerHaiku); +}; + +} @@ -385,10 +366,10 @@ index 0000000..63ceecc +} // namespace webrtc diff --git a/src/modules/desktop_capture/window_capturer_haiku.cc b/src/modules/desktop_capture/window_capturer_haiku.cc new file mode 100644 -index 0000000..dab0db5 +index 0000000..a89b4a1 --- /dev/null +++ b/src/modules/desktop_capture/window_capturer_haiku.cc -@@ -0,0 +1,66 @@ +@@ -0,0 +1,64 @@ +/* + * Copyright 2021 Gerasim Troeglazov + * @@ -401,7 +382,6 @@ index 0000000..dab0db5 + +#include "modules/desktop_capture/desktop_capturer.h" +#include "modules/desktop_capture/desktop_frame.h" -+#include "rtc_base/constructor_magic.h" + +#include + @@ -421,7 +401,6 @@ index 0000000..dab0db5 + + private: + Callback* callback_ = nullptr; -+ RTC_DISALLOW_COPY_AND_ASSIGN(WindowCapturerHaiku); +}; + +WindowCapturerHaiku::WindowCapturerHaiku() {} @@ -1542,10 +1521,10 @@ index 0000000..7308f0c + +#endif // VIDEO_CONSUMER_H diff --git a/src/rtc_base/BUILD.gn b/src/rtc_base/BUILD.gn -index 5165a3e..146c787 100644 +index 1db186c..eaa98a9 100644 --- a/src/rtc_base/BUILD.gn +++ b/src/rtc_base/BUILD.gn -@@ -508,7 +508,7 @@ rtc_source_set("rtc_operations_chain") { +@@ -513,7 +513,7 @@ rtc_source_set("rtc_operations_chain") { absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ] } @@ -1606,10 +1585,10 @@ index a5498c6..3e829bf 100644 static bool IPIsHelper(const IPAddress& ip, const in6_addr& tomatch, diff --git a/src/rtc_base/logging.cc b/src/rtc_base/logging.cc -index 4ebeebe..ce09db9 100644 +index 102c1d1..0c2963a 100644 --- a/src/rtc_base/logging.cc +++ b/src/rtc_base/logging.cc -@@ -124,7 +124,11 @@ LogMessage::LogMessage(const char* file, +@@ -127,7 +127,11 @@ LogMessage::LogMessage(const char* file, if (thread_) { PlatformThreadId id = CurrentThreadId(); @@ -1622,10 +1601,10 @@ index 4ebeebe..ce09db9 100644 if (file != nullptr) { diff --git a/src/rtc_base/network.cc b/src/rtc_base/network.cc -index 870f22a..8a6f605 100644 +index 295d39c..012e1a1 100644 --- a/src/rtc_base/network.cc +++ b/src/rtc_base/network.cc -@@ -564,7 +564,7 @@ void BasicNetworkManager::ConvertIfAddrs(struct ifaddrs* interfaces, +@@ -566,7 +566,7 @@ void BasicNetworkManager::ConvertIfAddrs(struct ifaddrs* interfaces, continue; } // Skip ones which are down. @@ -1729,165 +1708,6 @@ index 8aa67f1..5c2b6e1 100644 #elif defined(__EMSCRIPTEN__) // There is not yet a way to determine CPU count in emscripten JS environment. -diff --git a/src/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp.h b/src/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp.h -old mode 100755 -new mode 100644 -index f0dc35a..626ee9f ---- a/src/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp.h -+++ b/src/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp.h -@@ -40,7 +40,7 @@ __FBSDID("$FreeBSD: head/sys/netinet/sctp.h 366750 2020-10-16 10:44:48Z tuexen $ - #ifndef _NETINET_SCTP_H_ - #define _NETINET_SCTP_H_ - --#if defined(__APPLE__) || defined(__linux__) -+#if defined(__APPLE__) || defined(__linux__) || defined(__HAIKU__) - #include - #endif - #include -diff --git a/src/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.c b/src/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.c -old mode 100755 -new mode 100644 -index 517189f..6352509 ---- a/src/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.c -+++ b/src/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.c -@@ -6349,11 +6349,11 @@ sctp_input_with_port(struct mbuf *i_pak, int off, uint16_t port) - #if defined(_WIN32) && !defined(__Userspace__) - NTOHS(ip->ip_len); - #endif --#if defined(__linux__) || (defined(_WIN32) && defined(__Userspace__)) -+#if defined(__linux__) || defined(__HAIKU__) || (defined(_WIN32) && defined(__Userspace__)) - ip->ip_len = ntohs(ip->ip_len); - #endif - #if defined(__Userspace__) --#if defined(__linux__) || defined(_WIN32) -+#if defined(__linux__) || defined(__HAIKU__) || defined(_WIN32) - length = ip->ip_len; - #else - length = ip->ip_len + iphlen; -diff --git a/src/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_os_userspace.h b/src/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_os_userspace.h -old mode 100755 -new mode 100644 -index 1476660..6bb232e ---- a/src/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_os_userspace.h -+++ b/src/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_os_userspace.h -@@ -283,7 +283,7 @@ typedef char* caddr_t; - - #else /* !defined(Userspace_os_Windows) */ - #include --#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__linux__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__native_client__) || defined(__Fuchsia__) || defined(__EMSCRIPTEN_PTHREADS__) -+#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__linux__) || defined(__HAIKU__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__native_client__) || defined(__Fuchsia__) || defined(__EMSCRIPTEN_PTHREADS__) - #include - #endif - typedef pthread_mutex_t userland_mutex_t; -@@ -1132,7 +1132,7 @@ sctp_get_mbuf_for_msg(unsigned int space_needed, int want_header, int how, int a - - #define SCTP_IS_LISTENING(inp) ((inp->sctp_flags & SCTP_PCB_FLAGS_ACCEPTING) != 0) - --#if defined(__APPLE__) || defined(__DragonFly__) || defined(__linux__) || defined(__native_client__) || defined(__NetBSD__) || defined(_WIN32) || defined(__Fuchsia__) || defined(__EMSCRIPTEN__) -+#if defined(__APPLE__) || defined(__DragonFly__) || defined(__linux__) || defined(__HAIKU__) ||defined(__native_client__) || defined(__NetBSD__) || defined(_WIN32) || defined(__Fuchsia__) || defined(__EMSCRIPTEN__) - int - timingsafe_bcmp(const void *, const void *, size_t); - #endif -diff --git a/src/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_userspace.c b/src/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_userspace.c -old mode 100755 -new mode 100644 -index ba64aaf..b5d8cf1 ---- a/src/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_userspace.c -+++ b/src/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_userspace.c -@@ -94,7 +94,7 @@ sctp_userspace_set_threadname(const char *name) - #endif - } - --#if !defined(_WIN32) && !defined(__native_client__) -+#if !defined(_WIN32) && !defined(__HAIKU__) && !defined(__native_client__) - int - sctp_userspace_get_mtu_from_ifn(uint32_t if_index, int af) - { -@@ -118,7 +118,7 @@ sctp_userspace_get_mtu_from_ifn(uint32_t if_index, int af) - } - #endif - --#if defined(__native_client__) -+#if defined(__native_client__) || defined(__HAIKU__) - int - sctp_userspace_get_mtu_from_ifn(uint32_t if_index, int af) - { -@@ -126,7 +126,7 @@ sctp_userspace_get_mtu_from_ifn(uint32_t if_index, int af) - } - #endif - --#if defined(__APPLE__) || defined(__DragonFly__) || defined(__linux__) || defined(__native_client__) || defined(__NetBSD__) || defined(_WIN32) || defined(__Fuchsia__) || defined(__EMSCRIPTEN__) -+#if defined(__APPLE__) || defined(__DragonFly__) || defined(__linux__) || defined(__HAIKU__) || defined(__native_client__) || defined(__NetBSD__) || defined(_WIN32) || defined(__Fuchsia__) || defined(__EMSCRIPTEN__) - int - timingsafe_bcmp(const void *b1, const void *b2, size_t n) - { -diff --git a/src/third_party/usrsctp/usrsctplib/usrsctplib/user_environment.c b/src/third_party/usrsctp/usrsctplib/usrsctplib/user_environment.c -old mode 100755 -new mode 100644 -index 1887718..2e3409e ---- a/src/third_party/usrsctp/usrsctplib/usrsctplib/user_environment.c -+++ b/src/third_party/usrsctp/usrsctplib/usrsctplib/user_environment.c -@@ -172,7 +172,7 @@ finish_random(void) - { - return; - } --#elif (defined(__ANDROID__) && (__ANDROID_API__ < 28)) || defined(__EMSCRIPTEN__) -+#elif (defined(__ANDROID__) && (__ANDROID_API__ < 28)) || defined(__EMSCRIPTEN__) || defined(__HAIKU__) - #include - - static int fd = -1; -diff --git a/src/third_party/usrsctp/usrsctplib/usrsctplib/user_socket.c b/src/third_party/usrsctp/usrsctplib/usrsctplib/user_socket.c -old mode 100755 -new mode 100644 -index 513a5a9..73fd4e2 ---- a/src/third_party/usrsctp/usrsctplib/usrsctplib/user_socket.c -+++ b/src/third_party/usrsctp/usrsctplib/usrsctplib/user_socket.c -@@ -50,6 +50,9 @@ - #if defined(__linux__) - #define __FAVOR_BSD /* (on Ubuntu at least) enables UDP header field names like BSD in RFC 768 */ - #endif -+#if defined(__HAIKU__) -+#define UIO_MAXIOV _SC_IOV_MAX -+#endif - #if !defined(_WIN32) - #if defined INET || defined INET6 - #include -@@ -1035,7 +1038,7 @@ userspace_sctp_recvmsg(struct socket *so, - if (error) { - if ((auio.uio_resid != ulen) && - (error == EINTR || --#if !defined(__NetBSD__) -+#if !defined(__NetBSD__) && !defined(__HAIKU__) - error == ERESTART || - #endif - error == EWOULDBLOCK)) { -@@ -1128,7 +1131,7 @@ usrsctp_recvv(struct socket *so, - if (errno) { - if ((auio.uio_resid != ulen) && - (errno == EINTR || --#if !defined(__NetBSD__) -+#if !defined(__NetBSD__) && !defined(__HAIKU__) - errno == ERESTART || - #endif - errno == EWOULDBLOCK)) { -@@ -1944,7 +1947,7 @@ int user_connect(struct socket *so, struct sockaddr *sa) - error = pthread_cond_wait(SOCK_COND(so), SOCK_MTX(so)); - #endif - if (error) { --#if defined(__NetBSD__) -+#if defined(__NetBSD__) || defined(__HAIKU__) - if (error == EINTR) { - #else - if (error == EINTR || error == ERESTART) { -@@ -1964,7 +1967,7 @@ bad: - if (!interrupted) { - so->so_state &= ~SS_ISCONNECTING; - } --#if !defined(__NetBSD__) -+#if !defined(__NetBSD__) && !defined(__HAIKU__) - if (error == ERESTART) { - error = EINTR; - } -- -2.30.2 +2.36.1 diff --git a/media-libs/tg_owt/tg_owt-0.0.20220425.recipe b/media-libs/tg_owt/tg_owt-0.0.20220508.recipe similarity index 82% rename from media-libs/tg_owt/tg_owt-0.0.20220425.recipe rename to media-libs/tg_owt/tg_owt-0.0.20220508.recipe index e7a422cee..69bb1dcd9 100644 --- a/media-libs/tg_owt/tg_owt-0.0.20220425.recipe +++ b/media-libs/tg_owt/tg_owt-0.0.20220508.recipe @@ -4,15 +4,19 @@ HOMEPAGE="https://github.com/desktop-app/tg_owt" COPYRIGHT="2013-2022 Telegram" LICENSE="BSD (3-clause)" REVISION="1" -srcGitRev="c1aea3d142e0c1dbab80511d555a828f47dcbd8b" +srcGitRev="10d5f4bf77333ef6b43516f90d2ce13273255f41" SOURCE_URI="https://github.com/desktop-app/tg_owt/archive/$srcGitRev.tar.gz" SOURCE_DIR="tg_owt-$srcGitRev" -CHECKSUM_SHA256="a22e33d54b88600ebe6cfccaba51fb62202f7c0cfdc56ff6500052d6a5f2f62a" +CHECKSUM_SHA256="a321e99bb2453692f2d045c6a9c5feab9de07c40bdbe205937150e34bae9013b" SOURCE_FILENAME="tg_owt-$srcGitRev.tar.gz" srcGitRev_2="5b3351bd07e83f9f9a4cb6629561331ecdb7c546" SOURCE_URI_2="https://github.com/lemenkov/libyuv/archive/$srcGitRev_2.tar.gz" CHECKSUM_SHA256_2="242e3c42d2c6ff7770d62d78cfb45642541e92dea6afe2ebe07a9a04db3a98cb" SOURCE_FILENAME_2="libyuv-$srcGitRev_2.tar.gz" +srcGitRev_3="21fc8ef30415a635e7351ffa0e5d5367943d4a94" +SOURCE_URI_3="https://github.com/google/crc32c/archive/$srcGitRev_3.tar.gz" +CHECKSUM_SHA256_3="97d404992dcab9ab6be56067a37889b0cba1ea6cabcc2bc3feeb0131ee35a340" +SOURCE_FILENAME_3="crc32c-$srcGitRev_3.tar.gz" PATCHES="tg_owt-$portVersion.patchset" @@ -69,6 +73,9 @@ BUILD() rm -rf $sourceDir/src/third_party/libyuv cp -r $sourceDir2/libyuv-$srcGitRev_2 $sourceDir/src/third_party/libyuv + rm -rf $sourceDir/src/third_party/crc32c/src + cp -r $sourceDir3/crc32c-$srcGitRev_3 $sourceDir/src/third_party/crc32c/src + mkdir -p build cd build cmake .. \