OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 const size_t kTitleLength = 500; | 52 const size_t kTitleLength = 500; |
53 WCHAR window_title[kTitleLength]; | 53 WCHAR window_title[kTitleLength]; |
54 // Truncate the title if it's longer than kTitleLength. | 54 // Truncate the title if it's longer than kTitleLength. |
55 GetWindowText(hwnd, window_title, kTitleLength); | 55 GetWindowText(hwnd, window_title, kTitleLength); |
56 window.title = rtc::ToUtf8(window_title); | 56 window.title = rtc::ToUtf8(window_title); |
57 | 57 |
58 // Skip windows when we failed to convert the title or it is empty. | 58 // Skip windows when we failed to convert the title or it is empty. |
59 if (window.title.empty()) | 59 if (window.title.empty()) |
60 return TRUE; | 60 return TRUE; |
61 | 61 |
62 // Filter out windows modern apps' windows based on the observation: | |
63 // When a modern app's window is in foreground and not minimized : | |
64 // class name = ApplicationFrameWindow | |
65 // When a modern app's window is in foreground and minimized : | |
66 // class name = windows.UI.Core.coreWindow | |
67 // when a modern app's window is in background: | |
68 // It is listed as two windows with class name = ApplicationFrameWindow | |
69 // and class name = windows.UI.Core.coreWindow. | |
70 // Webrtc is not able to capture modern apps' windows on 09/30/2015. | |
mcasas
2015/10/01 17:19:04
This is a bit too verbose :) Please rephrase more
gyzhou
2015/10/02 18:30:34
Done.
| |
71 if (rtc::IsWindows8OrLater()) { | |
72 char clsName[1024]; | |
mcasas
2015/10/01 17:19:04
This needs to be WCHAR right? Like in l.53.
gyzhou
2015/10/02 18:30:34
GetClassName using WCHAR as input
GetClassNameA ca
| |
73 GetClassNameA(hwnd, clsName, 1024); | |
mcasas
2015/10/01 17:19:04
What about the return value? and what is 1024?
Su
gyzhou
2015/10/02 18:30:34
Done.
| |
74 if (strcmp(clsName, "ApplicationFrameWindow") == 0 || | |
75 strcmp(clsName, "Windows.UI.Core.CoreWindow") == 0) | |
mcasas
2015/10/01 17:19:04
Nit: I wouldn't use camlcase names ever, but if th
gyzhou
2015/10/02 18:30:34
Done.
| |
76 return true; | |
77 } | |
78 | |
62 list->push_back(window); | 79 list->push_back(window); |
63 | 80 |
64 return TRUE; | 81 return TRUE; |
65 } | 82 } |
66 | 83 |
67 class WindowCapturerWin : public WindowCapturer { | 84 class WindowCapturerWin : public WindowCapturer { |
68 public: | 85 public: |
69 WindowCapturerWin(); | 86 WindowCapturerWin(); |
70 virtual ~WindowCapturerWin(); | 87 virtual ~WindowCapturerWin(); |
71 | 88 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
234 } | 251 } |
235 | 252 |
236 } // namespace | 253 } // namespace |
237 | 254 |
238 // static | 255 // static |
239 WindowCapturer* WindowCapturer::Create(const DesktopCaptureOptions& options) { | 256 WindowCapturer* WindowCapturer::Create(const DesktopCaptureOptions& options) { |
240 return new WindowCapturerWin(); | 257 return new WindowCapturerWin(); |
241 } | 258 } |
242 | 259 |
243 } // namespace webrtc | 260 } // namespace webrtc |
OLD | NEW |