Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RTC_DISABLE_PROXY_TRACE_EVENTS define usage #109

Merged
merged 3 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build/macos-arm64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ copy: common-copy
.PHONY: patch
patch: common-patch
cd $(SRC_DIR) && \
patch -p2 < $(PATCH_DIR)/add_yuv_helper_ios_mac.patch
patch -p2 < $(PATCH_DIR)/add_yuv_helper_ios_mac.patch && \
patch -p2 < $(PATCH_DIR)/fix_disable_proxy_trace_events.patch

.PHONY: build
build: patch
Expand Down
3 changes: 2 additions & 1 deletion build/macos-x64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ copy: common-copy
.PHONY: patch
patch: common-patch
cd $(SRC_DIR) && \
patch -p2 < $(PATCH_DIR)/add_yuv_helper_ios_mac.patch
patch -p2 < $(PATCH_DIR)/add_yuv_helper_ios_mac.patch && \
patch -p2 < $(PATCH_DIR)/fix_disable_proxy_trace_events.patch

.PHONY: build
build: patch
Expand Down
24 changes: 12 additions & 12 deletions patch/add_yuv_helper_ios_mac.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/src/sdk/BUILD.gn b/src/sdk/BUILD.gn
index 4fe4bff..e3d2d44 100644
index 7620217..89498be 100644
--- a/src/sdk/BUILD.gn
+++ b/src/sdk/BUILD.gn
@@ -146,11 +146,14 @@ if (is_ios || is_mac) {
@@ -144,11 +144,14 @@ if (is_ios || is_mac) {
"objc/helpers/RTCDispatcher.h",
"objc/helpers/RTCDispatcher.m",
"objc/helpers/scoped_cftyperef.h",
Expand All @@ -17,15 +17,15 @@ index 4fe4bff..e3d2d44 100644
]

absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
@@ -1303,6 +1306,7 @@ if (is_ios || is_mac) {
@@ -1296,6 +1299,7 @@ if (is_ios || is_mac) {
"objc/components/video_frame_buffer/RTCCVPixelBuffer.h",
"objc/helpers/RTCCameraPreviewView.h",
"objc/helpers/RTCDispatcher.h",
+ "objc/helpers/RTCYUVHelper.h",
"objc/helpers/UIDevice+RTCDevice.h",
"objc/api/peerconnection/RTCAudioSource.h",
"objc/api/peerconnection/RTCAudioTrack.h",
@@ -1503,6 +1507,7 @@ if (is_ios || is_mac) {
@@ -1492,6 +1496,7 @@ if (is_ios || is_mac) {
"objc/components/video_codec/RTCVideoEncoderH264.h",
"objc/components/video_frame_buffer/RTCCVPixelBuffer.h",
"objc/helpers/RTCDispatcher.h",
Expand All @@ -35,7 +35,7 @@ index 4fe4bff..e3d2d44 100644
sources += [
diff --git a/src/sdk/objc/helpers/RTCYUVHelper.h b/src/sdk/objc/helpers/RTCYUVHelper.h
new file mode 100644
index 0000000..2e6309c
index 0000000..ec8ce48
--- /dev/null
+++ b/src/sdk/objc/helpers/RTCYUVHelper.h
@@ -0,0 +1,118 @@
Expand Down Expand Up @@ -72,7 +72,7 @@ index 0000000..2e6309c
+ dstV:(uint8_t*)dstV
+ dstStrideV:(int)dstStrideV
+ width:(int)width
+ width:(int)height
+ height:(int)height
+ mode:(RTCVideoRotation)mode;
+
++ (int)I420ToNV12:(const uint8_t*)srcY
Expand All @@ -86,7 +86,7 @@ index 0000000..2e6309c
+ dstUV:(uint8_t*)dstUV
+ dstStrideUV:(int)dstStrideUV
+ width:(int)width
+ width:(int)height;
+ height:(int)height;
+
++ (int)I420ToNV21:(const uint8_t*)srcY
+ srcStrideY:(int)srcStrideY
Expand All @@ -99,7 +99,7 @@ index 0000000..2e6309c
+ dstUV:(uint8_t*)dstUV
+ dstStrideUV:(int)dstStrideUV
+ width:(int)width
+ width:(int)height;
+ height:(int)height;
+
++ (int)I420ToARGB:(const uint8_t*)srcY
+ srcStrideY:(int)srcStrideY
Expand Down Expand Up @@ -159,7 +159,7 @@ index 0000000..2e6309c
+@end
diff --git a/src/sdk/objc/helpers/RTCYUVHelper.mm b/src/sdk/objc/helpers/RTCYUVHelper.mm
new file mode 100644
index 0000000..3f610ff
index 0000000..4a39d46
--- /dev/null
+++ b/src/sdk/objc/helpers/RTCYUVHelper.mm
@@ -0,0 +1,179 @@
Expand Down Expand Up @@ -192,7 +192,7 @@ index 0000000..3f610ff
+ dstV:(uint8_t*)dstV
+ dstStrideV:(int)dstStrideV
+ width:(int)width
+ width:(int)height
+ height:(int)height
+ mode:(RTCVideoRotation)mode {
+ libyuv::I420Rotate(srcY,
+ srcStrideY,
Expand Down Expand Up @@ -222,7 +222,7 @@ index 0000000..3f610ff
+ dstUV:(uint8_t*)dstUV
+ dstStrideUV:(int)dstStrideUV
+ width:(int)width
+ width:(int)height {
+ height:(int)height {
+ return libyuv::I420ToNV12(srcY,
+ srcStrideY,
+ srcU,
Expand All @@ -248,7 +248,7 @@ index 0000000..3f610ff
+ dstUV:(uint8_t*)dstUV
+ dstStrideUV:(int)dstStrideUV
+ width:(int)width
+ width:(int)height {
+ height:(int)height {
+ return libyuv::I420ToNV21(srcY,
+ srcStrideY,
+ srcU,
Expand Down
21 changes: 21 additions & 0 deletions patch/fix_disable_proxy_trace_events.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/src/pc/proxy.h b/src/pc/proxy.h
index eecd601..744f822 100644
--- a/src/pc/proxy.h
+++ b/src/pc/proxy.h
@@ -70,12 +70,15 @@
#include "rtc_base/string_utils.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/thread.h"
-#include "rtc_base/trace_event.h"

#if !defined(RTC_DISABLE_PROXY_TRACE_EVENTS) && !defined(WEBRTC_CHROMIUM_BUILD)
#define RTC_DISABLE_PROXY_TRACE_EVENTS
#endif

+#if !defined(RTC_DISABLE_PROXY_TRACE_EVENTS)
+#include "rtc_base/trace_event.h"
+#endif
+
namespace webrtc {

template <typename R>