OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "remoting/host/chromeos/aura_desktop_capturer.h" | 5 #include "remoting/host/chromeos/aura_desktop_capturer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "cc/output/copy_output_request.h" | 8 #include "cc/output/copy_output_request.h" |
9 #include "cc/output/copy_output_result.h" | 9 #include "cc/output/copy_output_result.h" |
10 #include "remoting/host/chromeos/skia_bitmap_desktop_frame.h" | 10 #include "remoting/host/chromeos/skia_bitmap_desktop_frame.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 void AuraDesktopCapturer::OnFrameCaptured( | 55 void AuraDesktopCapturer::OnFrameCaptured( |
56 scoped_ptr<cc::CopyOutputResult> result) { | 56 scoped_ptr<cc::CopyOutputResult> result) { |
57 DCHECK(result->HasBitmap()); | 57 DCHECK(result->HasBitmap()); |
58 | 58 |
59 scoped_ptr<SkBitmap> bitmap = result->TakeBitmap(); | 59 scoped_ptr<SkBitmap> bitmap = result->TakeBitmap(); |
60 | 60 |
61 scoped_ptr<webrtc::DesktopFrame> frame( | 61 scoped_ptr<webrtc::DesktopFrame> frame( |
62 SkiaBitmapDesktopFrame::Create(bitmap.Pass())); | 62 SkiaBitmapDesktopFrame::Create(bitmap.Pass())); |
63 | 63 |
64 // |VideoScheduler| will not encode the frame if |updated_region| is empty. | 64 // |VideoFramePump| will not encode the frame if |updated_region| is empty. |
65 const webrtc::DesktopRect& rect = webrtc::DesktopRect::MakeWH( | 65 const webrtc::DesktopRect& rect = webrtc::DesktopRect::MakeWH( |
66 frame->size().width(), frame->size().height()); | 66 frame->size().width(), frame->size().height()); |
67 | 67 |
68 // TODO(kelvinp): Set Frame DPI according to the screen resolution. | 68 // TODO(kelvinp): Set Frame DPI according to the screen resolution. |
69 // See cc::Layer::contents_scale_(x|y)() and frame->set_depi(). | 69 // See cc::Layer::contents_scale_(x|y)() and frame->set_depi(). |
70 frame->mutable_updated_region()->SetRect(rect); | 70 frame->mutable_updated_region()->SetRect(rect); |
71 | 71 |
72 callback_->OnCaptureCompleted(frame.release()); | 72 callback_->OnCaptureCompleted(frame.release()); |
73 } | 73 } |
74 | 74 |
75 } // namespace remoting | 75 } // namespace remoting |
OLD | NEW |