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 <algorithm> | 5 #include <algorithm> |
6 #include <cmath> | 6 #include <cmath> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 video_frame->format() == media::VideoFrame::I420 || | 201 video_frame->format() == media::VideoFrame::I420 || |
202 video_frame->format() == media::VideoFrame::YV12A); | 202 video_frame->format() == media::VideoFrame::YV12A); |
203 | 203 |
204 if (done_callback_.is_null() || expected_yuv_colors_.empty()) | 204 if (done_callback_.is_null() || expected_yuv_colors_.empty()) |
205 return; // No need to waste CPU doing analysis on the frame. | 205 return; // No need to waste CPU doing analysis on the frame. |
206 | 206 |
207 // Take the median value of each plane because the test image will contain a | 207 // Take the median value of each plane because the test image will contain a |
208 // letterboxed content region of mostly a solid color plus a small piece of | 208 // letterboxed content region of mostly a solid color plus a small piece of |
209 // "something" that's animating to keep the tab capture pipeline generating | 209 // "something" that's animating to keep the tab capture pipeline generating |
210 // new frames. | 210 // new frames. |
211 const gfx::Rect region = FindLetterboxedContentRegion(video_frame); | 211 const gfx::Rect region = FindLetterboxedContentRegion(video_frame.get()); |
212 YUVColor current_color; | 212 YUVColor current_color; |
213 current_color.y = ComputeMedianIntensityInRegionInPlane( | 213 current_color.y = ComputeMedianIntensityInRegionInPlane( |
214 region, | 214 region, |
215 video_frame->stride(media::VideoFrame::kYPlane), | 215 video_frame->stride(media::VideoFrame::kYPlane), |
216 video_frame->data(media::VideoFrame::kYPlane)); | 216 video_frame->data(media::VideoFrame::kYPlane)); |
217 current_color.u = ComputeMedianIntensityInRegionInPlane( | 217 current_color.u = ComputeMedianIntensityInRegionInPlane( |
218 gfx::ScaleToEnclosedRect(region, 0.5f), | 218 gfx::ScaleToEnclosedRect(region, 0.5f), |
219 video_frame->stride(media::VideoFrame::kUPlane), | 219 video_frame->stride(media::VideoFrame::kUPlane), |
220 video_frame->data(media::VideoFrame::kUPlane)); | 220 video_frame->data(media::VideoFrame::kUPlane)); |
221 current_color.v = ComputeMedianIntensityInRegionInPlane( | 221 current_color.v = ComputeMedianIntensityInRegionInPlane( |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 | 391 |
392 delete receiver; | 392 delete receiver; |
393 cast_environment->Shutdown(); | 393 cast_environment->Shutdown(); |
394 } | 394 } |
395 | 395 |
396 IN_PROC_BROWSER_TEST_F(CastStreamingApiTestWithPixelOutput, RtpStreamError) { | 396 IN_PROC_BROWSER_TEST_F(CastStreamingApiTestWithPixelOutput, RtpStreamError) { |
397 ASSERT_TRUE(RunExtensionSubtest("cast_streaming", "rtp_stream_error.html")); | 397 ASSERT_TRUE(RunExtensionSubtest("cast_streaming", "rtp_stream_error.html")); |
398 } | 398 } |
399 | 399 |
400 } // namespace extensions | 400 } // namespace extensions |
OLD | NEW |