|
@@ -19,8 +19,7 @@
|
|
|
#include "third_party/libyuv/include/libyuv/scale_argb.h"
|
|
|
#include "third_party/skia/include/core/SkBitmap.h"
|
|
|
#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
|
|
|
-#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
|
|
|
-#include "third_party/webrtc/modules/desktop_capture/window_capturer.h"
|
|
|
+#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
|
|
|
#include "ui/base/l10n/l10n_util.h"
|
|
|
#include "ui/gfx/skia_util.h"
|
|
|
|
|
@@ -86,8 +85,8 @@ class NativeDesktopMediaList::Worker
|
|
|
: public webrtc::DesktopCapturer::Callback {
|
|
|
public:
|
|
|
Worker(base::WeakPtr<NativeDesktopMediaList> media_list,
|
|
|
- std::unique_ptr<webrtc::ScreenCapturer> screen_capturer,
|
|
|
- std::unique_ptr<webrtc::WindowCapturer> window_capturer);
|
|
|
+ std::unique_ptr<webrtc::DesktopCapturer> screen_capturer,
|
|
|
+ std::unique_ptr<webrtc::DesktopCapturer> window_capturer);
|
|
|
~Worker() override;
|
|
|
|
|
|
void Refresh(const gfx::Size& thumbnail_size,
|
|
@@ -102,8 +101,8 @@ class NativeDesktopMediaList::Worker
|
|
|
|
|
|
base::WeakPtr<NativeDesktopMediaList> media_list_;
|
|
|
|
|
|
- std::unique_ptr<webrtc::ScreenCapturer> screen_capturer_;
|
|
|
- std::unique_ptr<webrtc::WindowCapturer> window_capturer_;
|
|
|
+ std::unique_ptr<webrtc::DesktopCapturer> screen_capturer_;
|
|
|
+ std::unique_ptr<webrtc::DesktopCapturer> window_capturer_;
|
|
|
|
|
|
std::unique_ptr<webrtc::DesktopFrame> current_frame_;
|
|
|
|
|
@@ -114,8 +113,8 @@ class NativeDesktopMediaList::Worker
|
|
|
|
|
|
NativeDesktopMediaList::Worker::Worker(
|
|
|
base::WeakPtr<NativeDesktopMediaList> media_list,
|
|
|
- std::unique_ptr<webrtc::ScreenCapturer> screen_capturer,
|
|
|
- std::unique_ptr<webrtc::WindowCapturer> window_capturer)
|
|
|
+ std::unique_ptr<webrtc::DesktopCapturer> screen_capturer,
|
|
|
+ std::unique_ptr<webrtc::DesktopCapturer> window_capturer)
|
|
|
: media_list_(media_list),
|
|
|
screen_capturer_(std::move(screen_capturer)),
|
|
|
window_capturer_(std::move(window_capturer)) {
|
|
@@ -133,8 +132,8 @@ void NativeDesktopMediaList::Worker::Refresh(
|
|
|
std::vector<SourceDescription> sources;
|
|
|
|
|
|
if (screen_capturer_) {
|
|
|
- webrtc::ScreenCapturer::ScreenList screens;
|
|
|
- if (screen_capturer_->GetScreenList(&screens)) {
|
|
|
+ webrtc::DesktopCapturer::SourceList screens;
|
|
|
+ if (screen_capturer_->GetSourceList(&screens)) {
|
|
|
bool mutiple_screens = screens.size() > 1;
|
|
|
base::string16 title;
|
|
|
for (size_t i = 0; i < screens.size(); ++i) {
|
|
@@ -150,10 +149,9 @@ void NativeDesktopMediaList::Worker::Refresh(
|
|
|
}
|
|
|
|
|
|
if (window_capturer_) {
|
|
|
- webrtc::WindowCapturer::WindowList windows;
|
|
|
- if (window_capturer_->GetWindowList(&windows)) {
|
|
|
- for (webrtc::WindowCapturer::WindowList::iterator it = windows.begin();
|
|
|
- it != windows.end(); ++it) {
|
|
|
+ webrtc::DesktopCapturer::SourceList windows;
|
|
|
+ if (window_capturer_->GetSourceList(&windows)) {
|
|
|
+ for (auto it = windows.begin(); it != windows.end(); ++it) {
|
|
|
// Skip the picker dialog window.
|
|
|
if (it->id != view_dialog_id) {
|
|
|
sources.push_back(SourceDescription(
|
|
@@ -176,15 +174,15 @@ void NativeDesktopMediaList::Worker::Refresh(
|
|
|
SourceDescription& source = sources[i];
|
|
|
switch (source.id.type) {
|
|
|
case DesktopMediaID::TYPE_SCREEN:
|
|
|
- if (!screen_capturer_->SelectScreen(source.id.id))
|
|
|
+ if (!screen_capturer_->SelectSource(source.id.id))
|
|
|
continue;
|
|
|
- screen_capturer_->Capture(webrtc::DesktopRegion());
|
|
|
+ screen_capturer_->CaptureFrame();
|
|
|
break;
|
|
|
|
|
|
case DesktopMediaID::TYPE_WINDOW:
|
|
|
- if (!window_capturer_->SelectWindow(source.id.id))
|
|
|
+ if (!window_capturer_->SelectSource(source.id.id))
|
|
|
continue;
|
|
|
- window_capturer_->Capture(webrtc::DesktopRegion());
|
|
|
+ window_capturer_->CaptureFrame();
|
|
|
break;
|
|
|
|
|
|
default:
|
|
@@ -225,8 +223,8 @@ void NativeDesktopMediaList::Worker::OnCaptureResult(
|
|
|
}
|
|
|
|
|
|
NativeDesktopMediaList::NativeDesktopMediaList(
|
|
|
- std::unique_ptr<webrtc::ScreenCapturer> screen_capturer,
|
|
|
- std::unique_ptr<webrtc::WindowCapturer> window_capturer)
|
|
|
+ std::unique_ptr<webrtc::DesktopCapturer> screen_capturer,
|
|
|
+ std::unique_ptr<webrtc::DesktopCapturer> window_capturer)
|
|
|
: screen_capturer_(std::move(screen_capturer)),
|
|
|
window_capturer_(std::move(window_capturer)),
|
|
|
update_period_(base::TimeDelta::FromMilliseconds(kDefaultUpdatePeriod)),
|