sergeyu@chromium.org | 85a1dab | 2013-04-29 20:10:57 | [diff] [blame] | 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 WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_WIN_H_ |
| 12 | #define WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_WIN_H_ |
| 13 | |
kwiberg | 6bdc7fc | 2016-03-16 22:58:08 | [diff] [blame] | 14 | #include <memory> |
| 15 | |
sergeyu@chromium.org | 85a1dab | 2013-04-29 20:10:57 | [diff] [blame] | 16 | #include <windows.h> |
| 17 | |
| 18 | #include "webrtc/modules/desktop_capture/desktop_frame.h" |
Edward Lemur | 76de83e | 2017-07-06 17:44:34 | [diff] [blame] | 19 | #include "webrtc/rtc_base/constructormagic.h" |
sergeyu@chromium.org | 85a1dab | 2013-04-29 20:10:57 | [diff] [blame] | 20 | #include "webrtc/typedefs.h" |
| 21 | |
| 22 | namespace webrtc { |
| 23 | |
| 24 | // DesktopFrame implementation used by screen and window captures on Windows. |
| 25 | // Frame data is stored in a GDI bitmap. |
| 26 | class DesktopFrameWin : public DesktopFrame { |
| 27 | public: |
sergeyu | ba5fedd | 2016-10-26 20:15:42 | [diff] [blame] | 28 | ~DesktopFrameWin() override; |
sergeyu | 4067f54 | 2016-06-07 23:41:58 | [diff] [blame] | 29 | |
| 30 | static std::unique_ptr<DesktopFrameWin> |
| 31 | Create(DesktopSize size, SharedMemoryFactory* shared_memory_factory, HDC hdc); |
sergeyu@chromium.org | 85a1dab | 2013-04-29 20:10:57 | [diff] [blame] | 32 | |
| 33 | HBITMAP bitmap() { return bitmap_; } |
| 34 | |
| 35 | private: |
| 36 | DesktopFrameWin(DesktopSize size, |
| 37 | int stride, |
| 38 | uint8_t* data, |
kwiberg | 6bdc7fc | 2016-03-16 22:58:08 | [diff] [blame] | 39 | std::unique_ptr<SharedMemory> shared_memory, |
sergeyu@chromium.org | 85a1dab | 2013-04-29 20:10:57 | [diff] [blame] | 40 | HBITMAP bitmap); |
| 41 | |
| 42 | HBITMAP bitmap_; |
kwiberg | 6bdc7fc | 2016-03-16 22:58:08 | [diff] [blame] | 43 | std::unique_ptr<SharedMemory> owned_shared_memory_; |
sergeyu@chromium.org | 85a1dab | 2013-04-29 20:10:57 | [diff] [blame] | 44 | |
henrikg | 9199c0e | 2015-09-16 12:37:44 | [diff] [blame] | 45 | RTC_DISALLOW_COPY_AND_ASSIGN(DesktopFrameWin); |
sergeyu@chromium.org | 85a1dab | 2013-04-29 20:10:57 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | } // namespace webrtc |
| 49 | |
| 50 | #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_WIN_H_ |
| 51 | |