OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/base/video_frame.h" | 5 #include "media/base/video_frame.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/memory/aligned_memory.h" | 10 #include "base/memory/aligned_memory.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 media::ConvertYUVToRGB32(yv12_frame->data(VideoFrame::kYPlane), | 63 media::ConvertYUVToRGB32(yv12_frame->data(VideoFrame::kYPlane), |
64 yv12_frame->data(VideoFrame::kUPlane), | 64 yv12_frame->data(VideoFrame::kUPlane), |
65 yv12_frame->data(VideoFrame::kVPlane), | 65 yv12_frame->data(VideoFrame::kVPlane), |
66 rgb_data, | 66 rgb_data, |
67 yv12_frame->coded_size().width(), | 67 yv12_frame->coded_size().width(), |
68 yv12_frame->coded_size().height(), | 68 yv12_frame->coded_size().height(), |
69 yv12_frame->stride(VideoFrame::kYPlane), | 69 yv12_frame->stride(VideoFrame::kYPlane), |
70 yv12_frame->stride(VideoFrame::kUPlane), | 70 yv12_frame->stride(VideoFrame::kUPlane), |
71 bytes_per_row, | 71 bytes_per_row, |
72 media::YV12); | 72 media::YV12, |
| 73 media::YUV_RANGE_RESTRICTED); |
73 | 74 |
74 for (int row = 0; row < yv12_frame->coded_size().height(); ++row) { | 75 for (int row = 0; row < yv12_frame->coded_size().height(); ++row) { |
75 uint32* rgb_row_data = reinterpret_cast<uint32*>( | 76 uint32* rgb_row_data = reinterpret_cast<uint32*>( |
76 rgb_data + (bytes_per_row * row)); | 77 rgb_data + (bytes_per_row * row)); |
77 for (int col = 0; col < yv12_frame->coded_size().width(); ++col) { | 78 for (int col = 0; col < yv12_frame->coded_size().width(); ++col) { |
78 SCOPED_TRACE( | 79 SCOPED_TRACE( |
79 base::StringPrintf("Checking (%d, %d)", row, col)); | 80 base::StringPrintf("Checking (%d, %d)", row, col)); |
80 EXPECT_EQ(expect_rgb_color, rgb_row_data[col]); | 81 EXPECT_EQ(expect_rgb_color, rgb_row_data[col]); |
81 } | 82 } |
82 } | 83 } |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 | 417 |
417 EXPECT_EQ(0u, called_sync_point); | 418 EXPECT_EQ(0u, called_sync_point); |
418 | 419 |
419 // Don't use the mailbox at all and drop our ref on it. | 420 // Don't use the mailbox at all and drop our ref on it. |
420 } | 421 } |
421 // The VideoFrame is destroyed, it should call the callback. | 422 // The VideoFrame is destroyed, it should call the callback. |
422 EXPECT_EQ(sync_point, called_sync_point); | 423 EXPECT_EQ(sync_point, called_sync_point); |
423 } | 424 } |
424 | 425 |
425 } // namespace media | 426 } // namespace media |
OLD | NEW |