Chromium Code Reviews| Index: webrtc/modules/desktop_capture/fake_screen_capturer.cc |
| diff --git a/webrtc/modules/desktop_capture/fake_screen_capturer.cc b/webrtc/modules/desktop_capture/fake_screen_capturer.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9056f104e5018a83fed1fa676d95f151af1b0046 |
| --- /dev/null |
| +++ b/webrtc/modules/desktop_capture/fake_screen_capturer.cc |
| @@ -0,0 +1,34 @@ |
| +/* |
| + * Copyright (c) 2016 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 "webrtc/modules/desktop_capture/fake_screen_capturer.h" |
| + |
| +#include <stdint.h> |
| + |
| +#include <utility> |
| + |
| +namespace webrtc { |
| + |
| +FakeScreenCapturer::FakeScreenCapturer() |
| + : FakeDesktopCapturer(), |
| + // Creates a random number without using Random class. |
| + id_(static_cast<ScreenId>(reinterpret_cast<intptr_t>(this))) {} |
|
Sergey Ulanov
2016/09/01 19:27:56
just hard code some value. I don't think we really
Hzj_jie
2016/09/01 23:26:42
Done.
|
| +FakeScreenCapturer::~FakeScreenCapturer() {} |
| + |
| +bool FakeScreenCapturer::GetScreenList(ScreenList* list) { |
| + list->push_back(Screen{id_}); |
| + return true; |
| +} |
| + |
| +bool FakeScreenCapturer::SelectScreen(ScreenId id) { |
| + return id == kFullDesktopScreenId || id == id_; |
| +} |
| + |
| +} // namespace webrtc |