blob: 96256113babd9a7534a90882913a2e1b5313cc9e [file] [log] [blame]
sergeyu@chromium.org85a1dab2013-04-29 20:10:571/*
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
kwiberg6bdc7fc2016-03-16 22:58:0814#include <memory>
15
sergeyu@chromium.org85a1dab2013-04-29 20:10:5716#include <windows.h>
17
18#include "webrtc/modules/desktop_capture/desktop_frame.h"
Edward Lemur76de83e2017-07-06 17:44:3419#include "webrtc/rtc_base/constructormagic.h"
sergeyu@chromium.org85a1dab2013-04-29 20:10:5720#include "webrtc/typedefs.h"
21
22namespace webrtc {
23
24// DesktopFrame implementation used by screen and window captures on Windows.
25// Frame data is stored in a GDI bitmap.
26class DesktopFrameWin : public DesktopFrame {
27 public:
sergeyuba5fedd2016-10-26 20:15:4228 ~DesktopFrameWin() override;
sergeyu4067f542016-06-07 23:41:5829
30 static std::unique_ptr<DesktopFrameWin>
31 Create(DesktopSize size, SharedMemoryFactory* shared_memory_factory, HDC hdc);
sergeyu@chromium.org85a1dab2013-04-29 20:10:5732
33 HBITMAP bitmap() { return bitmap_; }
34
35 private:
36 DesktopFrameWin(DesktopSize size,
37 int stride,
38 uint8_t* data,
kwiberg6bdc7fc2016-03-16 22:58:0839 std::unique_ptr<SharedMemory> shared_memory,
sergeyu@chromium.org85a1dab2013-04-29 20:10:5740 HBITMAP bitmap);
41
42 HBITMAP bitmap_;
kwiberg6bdc7fc2016-03-16 22:58:0843 std::unique_ptr<SharedMemory> owned_shared_memory_;
sergeyu@chromium.org85a1dab2013-04-29 20:10:5744
henrikg9199c0e2015-09-16 12:37:4445 RTC_DISALLOW_COPY_AND_ASSIGN(DesktopFrameWin);
sergeyu@chromium.org85a1dab2013-04-29 20:10:5746};
47
48} // namespace webrtc
49
50#endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_WIN_H_
51