2013-04-29 20:10:57 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_WIN_H_
|
|
|
|
|
#define WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_WIN_H_
|
|
|
|
|
|
2016-03-16 15:58:08 -07:00
|
|
|
#include <memory>
|
|
|
|
|
|
2013-04-29 20:10:57 +00:00
|
|
|
#include <windows.h>
|
|
|
|
|
|
2016-04-26 08:14:39 -07:00
|
|
|
#include "webrtc/base/constructormagic.h"
|
2013-04-29 20:10:57 +00:00
|
|
|
#include "webrtc/modules/desktop_capture/desktop_frame.h"
|
|
|
|
|
#include "webrtc/typedefs.h"
|
|
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
|
|
|
|
// DesktopFrame implementation used by screen and window captures on Windows.
|
|
|
|
|
// Frame data is stored in a GDI bitmap.
|
|
|
|
|
class DesktopFrameWin : public DesktopFrame {
|
|
|
|
|
public:
|
2016-10-26 13:15:42 -07:00
|
|
|
~DesktopFrameWin() override;
|
2016-06-07 16:41:58 -07:00
|
|
|
|
|
|
|
|
static std::unique_ptr<DesktopFrameWin>
|
|
|
|
|
Create(DesktopSize size, SharedMemoryFactory* shared_memory_factory, HDC hdc);
|
2013-04-29 20:10:57 +00:00
|
|
|
|
|
|
|
|
HBITMAP bitmap() { return bitmap_; }
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
DesktopFrameWin(DesktopSize size,
|
|
|
|
|
int stride,
|
|
|
|
|
uint8_t* data,
|
2016-03-16 15:58:08 -07:00
|
|
|
std::unique_ptr<SharedMemory> shared_memory,
|
2013-04-29 20:10:57 +00:00
|
|
|
HBITMAP bitmap);
|
|
|
|
|
|
|
|
|
|
HBITMAP bitmap_;
|
2016-03-16 15:58:08 -07:00
|
|
|
std::unique_ptr<SharedMemory> owned_shared_memory_;
|
2013-04-29 20:10:57 +00:00
|
|
|
|
2015-09-16 05:37:44 -07:00
|
|
|
RTC_DISALLOW_COPY_AND_ASSIGN(DesktopFrameWin);
|
2013-04-29 20:10:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
|
|
|
|
#endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_WIN_H_
|
|
|
|
|
|