blob: 15b5883c36fa63642f7cf273b959fb39e6ea9425 [file] [log] [blame]
sergeyu@chromium.org15e32cc2013-04-29 20:10:57 +00001/*
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
14#include <windows.h>
15
kwiberg@webrtc.org00b8f6b2015-02-26 14:34:55 +000016#include "webrtc/base/scoped_ptr.h"
sergeyu@chromium.org15e32cc2013-04-29 20:10:57 +000017#include "webrtc/modules/desktop_capture/desktop_frame.h"
sergeyu@chromium.org15e32cc2013-04-29 20:10:57 +000018#include "webrtc/typedefs.h"
19
20namespace webrtc {
21
22// DesktopFrame implementation used by screen and window captures on Windows.
23// Frame data is stored in a GDI bitmap.
24class DesktopFrameWin : public DesktopFrame {
25 public:
26 virtual ~DesktopFrameWin();
27 static DesktopFrameWin* Create(DesktopSize size,
28 SharedMemory* shared_memory,
29 HDC hdc);
30
31 HBITMAP bitmap() { return bitmap_; }
32
33 private:
34 DesktopFrameWin(DesktopSize size,
35 int stride,
36 uint8_t* data,
37 SharedMemory* shared_memory,
38 HBITMAP bitmap);
39
40 HBITMAP bitmap_;
kwiberg@webrtc.org00b8f6b2015-02-26 14:34:55 +000041 rtc::scoped_ptr<SharedMemory> owned_shared_memory_;
sergeyu@chromium.org15e32cc2013-04-29 20:10:57 +000042
henrikg3c089d72015-09-16 05:37:44 -070043 RTC_DISALLOW_COPY_AND_ASSIGN(DesktopFrameWin);
sergeyu@chromium.org15e32cc2013-04-29 20:10:57 +000044};
45
46} // namespace webrtc
47
48#endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_WIN_H_
49