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 "base/synchronization/waitable_event.h" | 7 #include "base/synchronization/waitable_event.h" |
8 #include "content/browser/browser_thread_impl.h" | 8 #include "content/browser/browser_thread_impl.h" |
9 #include "content/public/browser/desktop_media_id.h" | 9 #include "content/public/browser/desktop_media_id.h" |
10 #include "media/base/video_capture_types.h" | 10 #include "media/base/video_capture_types.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); | 77 helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); |
78 helper_->SetUp(context_factory); | 78 helper_->SetUp(context_factory); |
79 new wm::DefaultActivationClient(helper_->root_window()); | 79 new wm::DefaultActivationClient(helper_->root_window()); |
80 | 80 |
81 // We need a window to cover desktop area so that DesktopCaptureDeviceAura | 81 // We need a window to cover desktop area so that DesktopCaptureDeviceAura |
82 // can use gfx::NativeWindow::GetWindowAtScreenPoint() to locate the | 82 // can use gfx::NativeWindow::GetWindowAtScreenPoint() to locate the |
83 // root window associated with the primary display. | 83 // root window associated with the primary display. |
84 gfx::Rect desktop_bounds = root_window()->bounds(); | 84 gfx::Rect desktop_bounds = root_window()->bounds(); |
85 window_delegate_.reset(new aura::test::TestWindowDelegate()); | 85 window_delegate_.reset(new aura::test::TestWindowDelegate()); |
86 desktop_window_.reset(new aura::Window(window_delegate_.get())); | 86 desktop_window_.reset(new aura::Window(window_delegate_.get())); |
87 desktop_window_->Init(aura::WINDOW_LAYER_TEXTURED); | 87 desktop_window_->Init(ui::LAYER_TEXTURED); |
88 desktop_window_->SetBounds(desktop_bounds); | 88 desktop_window_->SetBounds(desktop_bounds); |
89 aura::client::ParentWindowWithContext( | 89 aura::client::ParentWindowWithContext( |
90 desktop_window_.get(), root_window(), desktop_bounds); | 90 desktop_window_.get(), root_window(), desktop_bounds); |
91 desktop_window_->Show(); | 91 desktop_window_->Show(); |
92 } | 92 } |
93 | 93 |
94 void TearDown() override { | 94 void TearDown() override { |
95 helper_->RunAllPendingInMessageLoop(); | 95 helper_->RunAllPendingInMessageLoop(); |
96 root_window()->RemoveChild(desktop_window_.get()); | 96 root_window()->RemoveChild(desktop_window_.get()); |
97 desktop_window_.reset(); | 97 desktop_window_.reset(); |
(...skipping 25 matching lines...) Expand all Loading... |
123 media::VideoCaptureParams capture_params; | 123 media::VideoCaptureParams capture_params; |
124 capture_params.requested_format.frame_size.SetSize(640, 480); | 124 capture_params.requested_format.frame_size.SetSize(640, 480); |
125 capture_params.requested_format.frame_rate = kFrameRate; | 125 capture_params.requested_format.frame_rate = kFrameRate; |
126 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; | 126 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; |
127 capture_device->AllocateAndStart(capture_params, client.Pass()); | 127 capture_device->AllocateAndStart(capture_params, client.Pass()); |
128 capture_device->StopAndDeAllocate(); | 128 capture_device->StopAndDeAllocate(); |
129 } | 129 } |
130 | 130 |
131 } // namespace | 131 } // namespace |
132 } // namespace content | 132 } // namespace content |
OLD | NEW |