mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00

The given IOSurfaceRef was ignored until now. Wrap it into the new DesktopFrameIOSurface. The new DesktopFrameProvider object is there to manage them as it has to be done per display id. From initial measurement this speed-up the frame capture by 2. Disabled by default for now but it can be enabled by calling options.set_use_iosurface. This CL will allow to do some advanced tests. Bug: webrtc:8652 Change-Id: Ia9ac0b69b30098774941cb378804b45cb1710119 Reviewed-on: https://webrtc-review.googlesource.com/33014 Commit-Queue: Zijie He <zijiehe@chromium.org> Reviewed-by: Zijie He <zijiehe@chromium.org> Cr-Commit-Position: refs/heads/master@{#22801}
33 lines
984 B
Text
33 lines
984 B
Text
/*
|
|
* Copyright (c) 2018 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.
|
|
*/
|
|
|
|
#include <memory>
|
|
|
|
#include "modules/desktop_capture/mac/screen_capturer_mac.h"
|
|
|
|
namespace webrtc {
|
|
|
|
// static
|
|
std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer(
|
|
const DesktopCaptureOptions& options) {
|
|
if (!options.configuration_monitor()) {
|
|
return nullptr;
|
|
}
|
|
|
|
std::unique_ptr<ScreenCapturerMac> capturer(new ScreenCapturerMac(
|
|
options.configuration_monitor(), options.detect_updated_region(), options.allow_iosurface()));
|
|
if (!capturer.get()->Init()) {
|
|
return nullptr;
|
|
}
|
|
|
|
return capturer;
|
|
}
|
|
|
|
} // namespace webrtc
|