Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(699)

Side by Side Diff: webrtc/modules/desktop_capture/screen_capturer_x11.cc

Issue 1418423003: Use webrtc/base/checks.h in desktop_capture. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 #include "webrtc/modules/desktop_capture/screen_capturer.h" 11 #include "webrtc/modules/desktop_capture/screen_capturer.h"
12 12
13 #include <string.h> 13 #include <string.h>
14 #include <set> 14 #include <set>
15 15
16 #include <X11/extensions/Xdamage.h> 16 #include <X11/extensions/Xdamage.h>
17 #include <X11/extensions/Xfixes.h> 17 #include <X11/extensions/Xfixes.h>
18 #include <X11/Xlib.h> 18 #include <X11/Xlib.h>
19 #include <X11/Xutil.h> 19 #include <X11/Xutil.h>
20 20
21 #include "webrtc/base/checks.h"
21 #include "webrtc/base/scoped_ptr.h" 22 #include "webrtc/base/scoped_ptr.h"
22 #include "webrtc/modules/desktop_capture/desktop_capture_options.h" 23 #include "webrtc/modules/desktop_capture/desktop_capture_options.h"
23 #include "webrtc/modules/desktop_capture/desktop_frame.h" 24 #include "webrtc/modules/desktop_capture/desktop_frame.h"
24 #include "webrtc/modules/desktop_capture/differ.h" 25 #include "webrtc/modules/desktop_capture/differ.h"
25 #include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h" 26 #include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h"
26 #include "webrtc/modules/desktop_capture/screen_capturer_helper.h" 27 #include "webrtc/modules/desktop_capture/screen_capturer_helper.h"
27 #include "webrtc/modules/desktop_capture/x11/x_server_pixel_buffer.h" 28 #include "webrtc/modules/desktop_capture/x11/x_server_pixel_buffer.h"
28 #include "webrtc/system_wrappers/interface/logging.h" 29 #include "webrtc/system_wrappers/interface/logging.h"
29 #include "webrtc/system_wrappers/interface/tick_util.h" 30 #include "webrtc/system_wrappers/interface/tick_util.h"
30 31
31 // TODO(sergeyu): Move this to a header where it can be shared.
32 #if defined(NDEBUG)
33 #define RTC_DCHECK(condition) (void)(condition)
34 #else // NDEBUG
35 #define RTC_DCHECK(condition) \
36 if (!(condition)) { \
37 abort(); \
38 }
39 #endif
40
41 namespace webrtc { 32 namespace webrtc {
42
43 namespace { 33 namespace {
44 34
45 // A class to perform video frame capturing for Linux. 35 // A class to perform video frame capturing for Linux.
46 class ScreenCapturerLinux : public ScreenCapturer, 36 class ScreenCapturerLinux : public ScreenCapturer,
47 public SharedXDisplay::XEventHandler { 37 public SharedXDisplay::XEventHandler {
48 public: 38 public:
49 ScreenCapturerLinux(); 39 ScreenCapturerLinux();
50 virtual ~ScreenCapturerLinux(); 40 virtual ~ScreenCapturerLinux();
51 41
52 // TODO(ajwong): Do we really want this to be synchronous? 42 // TODO(ajwong): Do we really want this to be synchronous?
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 if (!options.x_display()) 435 if (!options.x_display())
446 return NULL; 436 return NULL;
447 437
448 rtc::scoped_ptr<ScreenCapturerLinux> capturer(new ScreenCapturerLinux()); 438 rtc::scoped_ptr<ScreenCapturerLinux> capturer(new ScreenCapturerLinux());
449 if (!capturer->Init(options)) 439 if (!capturer->Init(options))
450 capturer.reset(); 440 capturer.reset();
451 return capturer.release(); 441 return capturer.release();
452 } 442 }
453 443
454 } // namespace webrtc 444 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698