From 060987699b281a1a5d2339ba0da0f2bd88b81a6e Mon Sep 17 00:00:00 2001 From: henrikg Date: Wed, 22 Mar 2017 01:13:39 -0700 Subject: [PATCH] Revert of Add DesktopCapturerId and attach it to DesktopFrame (patchset #4 id:100002 of https://codereview.webrtc.org/2759493002/ ) Reason for revert: I suspect that this CL breaks Chromium WebRTC FYI bots. (Thanks kjellander@ for spotting.) The added dep in BUILD.gn would be the problem. Example: https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.webrtc.fyi%2FLinux_Builder%2F15058%2F%2B%2Frecipes%2Fsteps%2Fcompile%2F0%2Fstdout FAILED: newlib_pnacl/obj/third_party/webrtc/api/libjingle_peerconnection_api/mediaconstraintsinterface.o /b/c/goma_client/gomacc ../../native_client/toolchain/linux_x86/pnacl_newlib/bin/pnacl-clang++ -MMD -MF newlib_pnacl/obj/third_party/webrtc/api/libjingle_peerconnection_api/mediaconstraintsinterface.o.d -DNACL_TC_REV=5dfe030a71ca66e72c5719ef5034c2ed24706c43 -DV8_DEPRECATION_WARNINGS -DUSE_OPENSSL_CERTS=1 -DNO_TCMALLOC -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DENABLE_MEDIA_ROUTER=1 -DFIELDTRIAL_TESTING_ENABLED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -DNDEBUG -DNVALGRIND -DWEBRTC_RESTRICT_LOGGING -DEXPAT_RELATIVE_PATH -DHAVE_SCTP -DENABLE_EXTERNAL_AUTH -DHAVE_WEBRTC_VIDEO -DHAVE_WEBRTC_VOICE -DLOGGING_INSIDE_WEBRTC -DUSE_WEBRTC_DEV_BRANCH -DFEATURE_ENABLE_VOICEMAIL -DEXPAT_RELATIVE_PATH -DGTEST_RELATIVE_PATH -DNO_MAIN_THREAD_WRAPPING -DNO_SOUND_SYSTEM -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -I../.. -Inewlib_pnacl/gen -I../../third_party/webrtc_overrides -I../../third_party -fno-strict-aliasing -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -fcolor-diagnostics -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-deprecated-register -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -O2 -fno-ident -fdata-sections -ffunction-sections -g0 -fvisibility=hidden -fvisibility-inlines-hidden -std=gnu++11 -fno-rtti -fno-exceptions -c ../../third_party/webrtc/api/mediaconstraintsinterface.cc -o newlib_pnacl/obj/third_party/webrtc/api/libjingle_peerconnection_api/mediaconstraintsinterface.o In file included from ../../third_party/webrtc/api/mediaconstraintsinterface.cc:11: In file included from ../../third_party/webrtc/api/mediaconstraintsinterface.h:27: In file included from ../../third_party/webrtc/api/peerconnectioninterface.h:77: In file included from ../../third_party/webrtc/api/dtmfsenderinterface.h:16: In file included from ../../third_party/webrtc/api/mediastreaminterface.h:33: In file included from ../../third_party/webrtc/media/base/mediachannel.h:28: ../../third_party/webrtc/base/socket.h:18:10: fatal error: 'sys/socket.h' file not found #include ^ 1 error generated. Original issue's description: > Add DesktopCapturerId and attach it to DesktopFrame > > This change adds a DesktopCapturerId namespace, and attaches an int to each > DesktopFrame. ScreenCapturerWinGdi and ScreenCapturerWinDirectx now actively set > this field to differentiate themselves. > > BUG=679523, 650926 > > Review-Url: https://codereview.webrtc.org/2759493002 > Cr-Commit-Position: refs/heads/master@{#17329} > Committed: https://chromium.googlesource.com/external/webrtc/+/41e3d9ff3bf7a7364b643f851f14062fd43fcc11 TBR=sergeyu@chromium.org,zijiehe@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=679523, 650926 Review-Url: https://codereview.webrtc.org/2767003002 Cr-Commit-Position: refs/heads/master@{#17336} --- webrtc/modules/desktop_capture/BUILD.gn | 1 - webrtc/modules/desktop_capture/DEPS | 1 - webrtc/modules/desktop_capture/desktop_capture_types.h | 9 --------- webrtc/modules/desktop_capture/desktop_frame.cc | 4 ++-- webrtc/modules/desktop_capture/desktop_frame.h | 10 ---------- .../desktop_capture/win/screen_capturer_win_directx.cc | 1 - .../desktop_capture/win/screen_capturer_win_gdi.cc | 1 - 7 files changed, 2 insertions(+), 25 deletions(-) diff --git a/webrtc/modules/desktop_capture/BUILD.gn b/webrtc/modules/desktop_capture/BUILD.gn index 1a94223bdf..f8d5293405 100644 --- a/webrtc/modules/desktop_capture/BUILD.gn +++ b/webrtc/modules/desktop_capture/BUILD.gn @@ -29,7 +29,6 @@ rtc_static_library("primitives") { deps = [ "../..:webrtc_common", "../../base:rtc_base", # TODO(kjellander): Cleanup in bugs.webrtc.org/3806. - "../../media:rtc_media_base", ] } diff --git a/webrtc/modules/desktop_capture/DEPS b/webrtc/modules/desktop_capture/DEPS index fe372fdeaf..9229e7f19b 100644 --- a/webrtc/modules/desktop_capture/DEPS +++ b/webrtc/modules/desktop_capture/DEPS @@ -1,6 +1,5 @@ include_rules = [ "+webrtc/base", - "+webrtc/media", "+webrtc/system_wrappers", "+third_party/libyuv", ] diff --git a/webrtc/modules/desktop_capture/desktop_capture_types.h b/webrtc/modules/desktop_capture/desktop_capture_types.h index 64a3fe4c4e..9a6162a766 100644 --- a/webrtc/modules/desktop_capture/desktop_capture_types.h +++ b/webrtc/modules/desktop_capture/desktop_capture_types.h @@ -13,7 +13,6 @@ #include -#include "webrtc/media/base/videocommon.h" #include "webrtc/typedefs.h" namespace webrtc { @@ -37,14 +36,6 @@ const ScreenId kFullDesktopScreenId = -1; const ScreenId kInvalidScreenId = -2; -// An integer to attach to each DesktopFrame to differentiate the generator of -// the frame. -namespace DesktopCapturerId { - constexpr uint32_t kUnknown = 0; - constexpr uint32_t kScreenCapturerWinGdi = FOURCC('G', 'D', 'I', ' '); - constexpr uint32_t kScreenCapturerWinDirectx = FOURCC('D', 'X', 'G', 'I'); -} // namespace DesktopCapturerId - } // namespace webrtc #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURE_TYPES_H_ diff --git a/webrtc/modules/desktop_capture/desktop_frame.cc b/webrtc/modules/desktop_capture/desktop_frame.cc index 12e4ed8a09..dfc0928b66 100644 --- a/webrtc/modules/desktop_capture/desktop_frame.cc +++ b/webrtc/modules/desktop_capture/desktop_frame.cc @@ -26,8 +26,8 @@ DesktopFrame::DesktopFrame(DesktopSize size, shared_memory_(shared_memory), size_(size), stride_(stride), - capture_time_ms_(0), - capturer_id_(DesktopCapturerId::kUnknown) {} + capture_time_ms_(0) { +} DesktopFrame::~DesktopFrame() {} diff --git a/webrtc/modules/desktop_capture/desktop_frame.h b/webrtc/modules/desktop_capture/desktop_frame.h index c0eaf03aa6..d491135029 100644 --- a/webrtc/modules/desktop_capture/desktop_frame.h +++ b/webrtc/modules/desktop_capture/desktop_frame.h @@ -14,7 +14,6 @@ #include #include "webrtc/base/constructormagic.h" -#include "webrtc/modules/desktop_capture/desktop_capture_types.h" #include "webrtc/modules/desktop_capture/desktop_geometry.h" #include "webrtc/modules/desktop_capture/desktop_region.h" #include "webrtc/modules/desktop_capture/shared_memory.h" @@ -69,14 +68,6 @@ class DesktopFrame { // A helper to return the data pointer of a frame at the specified position. uint8_t* GetFrameDataAtPos(const DesktopVector& pos) const; - // The DesktopCapturer implementation which generates current DesktopFrame. - // Not all DesktopCapturer implementations set this field; it's set to - // kUnknown by default. - uint32_t capturer_id() const { return capturer_id_; } - void set_capturer_id(uint32_t capturer_id) { - capturer_id_ = capturer_id; - } - protected: DesktopFrame(DesktopSize size, int stride, @@ -96,7 +87,6 @@ class DesktopFrame { DesktopRegion updated_region_; DesktopVector dpi_; int64_t capture_time_ms_; - uint32_t capturer_id_; RTC_DISALLOW_COPY_AND_ASSIGN(DesktopFrame); }; diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc b/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc index 90bdeb6124..f6222d0d1a 100644 --- a/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc +++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc @@ -137,7 +137,6 @@ void ScreenCapturerWinDirectx::CaptureFrame() { result->set_capture_time_ms( (rtc::TimeNanos() - capture_start_time_nanos) / rtc::kNumNanosecsPerMillisec); - result->set_capturer_id(DesktopCapturerId::kScreenCapturerWinDirectx); callback_->OnCaptureResult(Result::SUCCESS, std::move(result)); } diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc b/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc index 591adca26f..87bc195ce4 100644 --- a/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc +++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc @@ -94,7 +94,6 @@ void ScreenCapturerWinGdi::CaptureFrame() { frame->set_capture_time_ms( (rtc::TimeNanos() - capture_start_time_nanos) / rtc::kNumNanosecsPerMillisec); - frame->set_capturer_id(DesktopCapturerId::kScreenCapturerWinGdi); callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); }