| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 const int kWidth = 2; | 163 const int kWidth = 2; |
| 164 const int kHeight = 2; | 164 const int kHeight = 2; |
| 165 const uint8 kExpectedYRow[] = { 0, 0 }; | 165 const uint8 kExpectedYRow[] = { 0, 0 }; |
| 166 const uint8 kExpectedUVRow[] = { 128 }; | 166 const uint8 kExpectedUVRow[] = { 128 }; |
| 167 | 167 |
| 168 scoped_refptr<media::VideoFrame> frame = | 168 scoped_refptr<media::VideoFrame> frame = |
| 169 VideoFrame::CreateBlackFrame(gfx::Size(kWidth, kHeight)); | 169 VideoFrame::CreateBlackFrame(gfx::Size(kWidth, kHeight)); |
| 170 ASSERT_TRUE(frame.get()); | 170 ASSERT_TRUE(frame.get()); |
| 171 | 171 |
| 172 // Test basic properties. | 172 // Test basic properties. |
| 173 EXPECT_EQ(0, frame->GetTimestamp().InMicroseconds()); | 173 EXPECT_EQ(0, frame->timestamp().InMicroseconds()); |
| 174 EXPECT_FALSE(frame->end_of_stream()); | 174 EXPECT_FALSE(frame->end_of_stream()); |
| 175 | 175 |
| 176 // Test |frame| properties. | 176 // Test |frame| properties. |
| 177 EXPECT_EQ(VideoFrame::YV12, frame->format()); | 177 EXPECT_EQ(VideoFrame::YV12, frame->format()); |
| 178 EXPECT_EQ(kWidth, frame->coded_size().width()); | 178 EXPECT_EQ(kWidth, frame->coded_size().width()); |
| 179 EXPECT_EQ(kHeight, frame->coded_size().height()); | 179 EXPECT_EQ(kHeight, frame->coded_size().height()); |
| 180 | 180 |
| 181 // Test frames themselves. | 181 // Test frames themselves. |
| 182 uint8* y_plane = frame->data(VideoFrame::kYPlane); | 182 uint8* y_plane = frame->data(VideoFrame::kYPlane); |
| 183 for (int y = 0; y < frame->coded_size().height(); ++y) { | 183 for (int y = 0; y < frame->coded_size().height(); ++y) { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 EXPECT_EQ(sync_point, mailbox_holder->sync_point); | 293 EXPECT_EQ(sync_point, mailbox_holder->sync_point); |
| 294 | 294 |
| 295 // Finish using the mailbox_holder and drop our reference. | 295 // Finish using the mailbox_holder and drop our reference. |
| 296 sync_point = 10; | 296 sync_point = 10; |
| 297 mailbox_holder->sync_point = sync_point; | 297 mailbox_holder->sync_point = sync_point; |
| 298 } | 298 } |
| 299 EXPECT_EQ(sync_point, called_sync_point); | 299 EXPECT_EQ(sync_point, called_sync_point); |
| 300 } | 300 } |
| 301 | 301 |
| 302 } // namespace media | 302 } // namespace media |
| OLD | NEW |