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/renderer_host/media/desktop_capture_device_aura.h" | 5 #include "content/browser/renderer_host/media/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/video/capture/video_capture_types.h" | 10 #include "media/video/capture/video_capture_types.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 virtual void SetUp() OVERRIDE { | 58 virtual void SetUp() OVERRIDE { |
59 helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); | 59 helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); |
60 helper_->SetUp(); | 60 helper_->SetUp(); |
61 | 61 |
62 // We need a window to cover desktop area so that DesktopCaptureDeviceAura | 62 // We need a window to cover desktop area so that DesktopCaptureDeviceAura |
63 // can use gfx::NativeWindow::GetWindowAtScreenPoint() to locate the | 63 // can use gfx::NativeWindow::GetWindowAtScreenPoint() to locate the |
64 // root window associated with the primary display. | 64 // root window associated with the primary display. |
65 gfx::Rect desktop_bounds = root_window()->bounds(); | 65 gfx::Rect desktop_bounds = root_window()->bounds(); |
66 window_delegate_.reset(new aura::test::TestWindowDelegate()); | 66 window_delegate_.reset(new aura::test::TestWindowDelegate()); |
67 desktop_window_.reset(new aura::Window(window_delegate_.get())); | 67 desktop_window_.reset(new aura::Window(window_delegate_.get())); |
68 desktop_window_->Init(ui::LAYER_TEXTURED); | 68 desktop_window_->Init(aura::WINDOW_LAYER_TEXTURED); |
69 desktop_window_->SetBounds(desktop_bounds); | 69 desktop_window_->SetBounds(desktop_bounds); |
70 aura::client::ParentWindowWithContext( | 70 aura::client::ParentWindowWithContext( |
71 desktop_window_.get(), root_window(), desktop_bounds); | 71 desktop_window_.get(), root_window(), desktop_bounds); |
72 desktop_window_->Show(); | 72 desktop_window_->Show(); |
73 } | 73 } |
74 | 74 |
75 virtual void TearDown() OVERRIDE { | 75 virtual void TearDown() OVERRIDE { |
76 helper_->RunAllPendingInMessageLoop(); | 76 helper_->RunAllPendingInMessageLoop(); |
77 root_window()->RemoveChild(desktop_window_.get()); | 77 root_window()->RemoveChild(desktop_window_.get()); |
78 desktop_window_.reset(); | 78 desktop_window_.reset(); |
(...skipping 26 matching lines...) Expand all Loading... |
105 capture_params.requested_format.frame_rate = kFrameRate; | 105 capture_params.requested_format.frame_rate = kFrameRate; |
106 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; | 106 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; |
107 capture_params.allow_resolution_change = false; | 107 capture_params.allow_resolution_change = false; |
108 capture_device->AllocateAndStart( | 108 capture_device->AllocateAndStart( |
109 capture_params, client.PassAs<media::VideoCaptureDevice::Client>()); | 109 capture_params, client.PassAs<media::VideoCaptureDevice::Client>()); |
110 capture_device->StopAndDeAllocate(); | 110 capture_device->StopAndDeAllocate(); |
111 } | 111 } |
112 | 112 |
113 } // namespace | 113 } // namespace |
114 } // namespace content | 114 } // namespace content |
OLD | NEW |