• 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 WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_WIN_H_
12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_WIN_H_
13 
14 #include <windows.h>
15 
16 #include "webrtc/base/scoped_ptr.h"
17 #include "webrtc/modules/desktop_capture/desktop_frame.h"
18 #include "webrtc/typedefs.h"
19 
20 namespace webrtc {
21 
22 // DesktopFrame implementation used by screen and window captures on Windows.
23 // Frame data is stored in a GDI bitmap.
24 class DesktopFrameWin : public DesktopFrame {
25  public:
26   virtual ~DesktopFrameWin();
27   static DesktopFrameWin* Create(DesktopSize size,
28                                  SharedMemory* shared_memory,
29                                  HDC hdc);
30 
bitmap()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_;
41   rtc::scoped_ptr<SharedMemory> owned_shared_memory_;
42 
43   RTC_DISALLOW_COPY_AND_ASSIGN(DesktopFrameWin);
44 };
45 
46 }  // namespace webrtc
47 
48 #endif  // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_WIN_H_
49 
50