OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/media/capture/desktop_capture_device_aura.h" | 5 #include "content/browser/media/capture/desktop_capture_device_aura.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 protected: | 105 protected: |
106 void SetUp() override { | 106 void SetUp() override { |
107 // The ContextFactory must exist before any Compositors are created. | 107 // The ContextFactory must exist before any Compositors are created. |
108 | 108 |
109 bool enable_pixel_output = false; | 109 bool enable_pixel_output = false; |
110 ui::ContextFactory* context_factory = nullptr; | 110 ui::ContextFactory* context_factory = nullptr; |
111 ui::ContextFactoryPrivate* context_factory_private = nullptr; | 111 ui::ContextFactoryPrivate* context_factory_private = nullptr; |
112 ui::InitializeContextFactoryForTests(enable_pixel_output, &context_factory, | 112 ui::InitializeContextFactoryForTests(enable_pixel_output, &context_factory, |
113 &context_factory_private); | 113 &context_factory_private); |
114 helper_.reset( | 114 helper_.reset(new aura::test::AuraTestHelper()); |
115 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); | |
116 helper_->SetUp(context_factory, context_factory_private); | 115 helper_->SetUp(context_factory, context_factory_private); |
117 new wm::DefaultActivationClient(helper_->root_window()); | 116 new wm::DefaultActivationClient(helper_->root_window()); |
118 // We need a window to cover desktop area so that DesktopCaptureDeviceAura | 117 // We need a window to cover desktop area so that DesktopCaptureDeviceAura |
119 // can use gfx::NativeWindow::GetWindowAtScreenPoint() to locate the | 118 // can use gfx::NativeWindow::GetWindowAtScreenPoint() to locate the |
120 // root window associated with the primary display. | 119 // root window associated with the primary display. |
121 gfx::Rect desktop_bounds = root_window()->bounds(); | 120 gfx::Rect desktop_bounds = root_window()->bounds(); |
122 window_delegate_.reset(new aura::test::TestWindowDelegate()); | 121 window_delegate_.reset(new aura::test::TestWindowDelegate()); |
123 desktop_window_.reset(new aura::Window(window_delegate_.get())); | 122 desktop_window_.reset(new aura::Window(window_delegate_.get())); |
124 desktop_window_->Init(ui::LAYER_TEXTURED); | 123 desktop_window_->Init(ui::LAYER_TEXTURED); |
125 desktop_window_->SetBounds(desktop_bounds); | 124 desktop_window_->SetBounds(desktop_bounds); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 media::VideoCaptureParams capture_params; | 163 media::VideoCaptureParams capture_params; |
165 capture_params.requested_format.frame_size.SetSize(640, 480); | 164 capture_params.requested_format.frame_size.SetSize(640, 480); |
166 capture_params.requested_format.frame_rate = kFrameRate; | 165 capture_params.requested_format.frame_rate = kFrameRate; |
167 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; | 166 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; |
168 capture_device->AllocateAndStart(capture_params, std::move(client)); | 167 capture_device->AllocateAndStart(capture_params, std::move(client)); |
169 capture_device->StopAndDeAllocate(); | 168 capture_device->StopAndDeAllocate(); |
170 } | 169 } |
171 | 170 |
172 } // namespace | 171 } // namespace |
173 } // namespace content | 172 } // namespace content |
OLD | NEW |