OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "media/remoting/interstitial.h" | 5 #include "media/remoting/interstitial.h" |
6 | 6 |
7 #include <algorithm> // for std::max() | 7 #include <algorithm> // for std::max() |
8 | 8 |
9 #include "media/base/localized_strings.h" | 9 #include "media/base/localized_strings.h" |
10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 canvas.writePixels(processed_image, centered_rect.x(), centered_rect.y()); | 145 canvas.writePixels(processed_image, centered_rect.x(), centered_rect.y()); |
146 } | 146 } |
147 | 147 |
148 RenderCastMessage(canvas_size, type, &canvas); | 148 RenderCastMessage(canvas_size, type, &canvas); |
149 | 149 |
150 // Create a new VideoFrame, copy the bitmap, then return it. | 150 // Create a new VideoFrame, copy the bitmap, then return it. |
151 scoped_refptr<VideoFrame> video_frame = VideoFrame::CreateFrame( | 151 scoped_refptr<VideoFrame> video_frame = VideoFrame::CreateFrame( |
152 PIXEL_FORMAT_I420, canvas_size, gfx::Rect(canvas_size), canvas_size, | 152 PIXEL_FORMAT_I420, canvas_size, gfx::Rect(canvas_size), canvas_size, |
153 base::TimeDelta()); | 153 base::TimeDelta()); |
154 if (video_frame) { | 154 if (video_frame) { |
155 SkAutoLockPixels pixel_lock(canvas_bitmap); | |
156 CopyRGBToVideoFrame(reinterpret_cast<uint8_t*>(canvas_bitmap.getPixels()), | 155 CopyRGBToVideoFrame(reinterpret_cast<uint8_t*>(canvas_bitmap.getPixels()), |
157 canvas_bitmap.rowBytes(), | 156 canvas_bitmap.rowBytes(), |
158 gfx::Rect(canvas_size.width(), canvas_size.height()), | 157 gfx::Rect(canvas_size.width(), canvas_size.height()), |
159 video_frame.get()); | 158 video_frame.get()); |
160 } | 159 } |
161 return video_frame; | 160 return video_frame; |
162 } | 161 } |
163 | 162 |
164 } // namespace remoting | 163 } // namespace remoting |
165 } // namespace media | 164 } // namespace media |
OLD | NEW |