• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3  *
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
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #ifndef MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURE_TYPES_H_
12 #define MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURE_TYPES_H_
13 
14 #include <stdint.h>
15 
16 namespace webrtc {
17 
18 // Type used to identify windows on the desktop. Values are platform-specific:
19 //   - On Windows: HWND cast to intptr_t.
20 //   - On Linux (with X11): X11 Window (unsigned long) type cast to intptr_t.
21 //   - On OSX: integer window number.
22 typedef intptr_t WindowId;
23 
24 const WindowId kNullWindowId = 0;
25 
26 // Type used to identify screens on the desktop. Values are platform-specific:
27 //   - On Windows: integer display device index.
28 //   - On OSX: CGDirectDisplayID cast to intptr_t.
29 //   - On Linux (with X11): TBD.
30 // On Windows, ScreenId is implementation dependent: sending a ScreenId from one
31 // implementation to another usually won't work correctly.
32 typedef intptr_t ScreenId;
33 
34 // The screen id corresponds to all screen combined together.
35 const ScreenId kFullDesktopScreenId = -1;
36 
37 const ScreenId kInvalidScreenId = -2;
38 
39 // An integer to attach to each DesktopFrame to differentiate the generator of
40 // the frame.
41 namespace DesktopCapturerId {
CreateFourCC(char a,char b,char c,char d)42 constexpr uint32_t CreateFourCC(char a, char b, char c, char d) {
43   return ((static_cast<uint32_t>(a)) | (static_cast<uint32_t>(b) << 8) |
44           (static_cast<uint32_t>(c) << 16) | (static_cast<uint32_t>(d) << 24));
45 }
46 
47 constexpr uint32_t kUnknown = 0;
48 constexpr uint32_t kScreenCapturerWinGdi = CreateFourCC('G', 'D', 'I', ' ');
49 constexpr uint32_t kScreenCapturerWinDirectx = CreateFourCC('D', 'X', 'G', 'I');
50 }  // namespace DesktopCapturerId
51 
52 }  // namespace webrtc
53 
54 #endif  // MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURE_TYPES_H_
55