Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Side by Side Diff: webrtc/common_video/libyuv/libyuv_unittest.cc

Issue 2772033002: Add content type information to encoded images and corresponding rtp extension header (Closed)
Patch Set: Fix Mac CE Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 void TestLibYuv::SetUp() { 58 void TestLibYuv::SetUp() {
59 const std::string input_file_name = webrtc::test::ResourcePath("foreman_cif", 59 const std::string input_file_name = webrtc::test::ResourcePath("foreman_cif",
60 "yuv"); 60 "yuv");
61 source_file_ = fopen(input_file_name.c_str(), "rb"); 61 source_file_ = fopen(input_file_name.c_str(), "rb");
62 ASSERT_TRUE(source_file_ != NULL) << "Cannot read file: "<< 62 ASSERT_TRUE(source_file_ != NULL) << "Cannot read file: "<<
63 input_file_name << "\n"; 63 input_file_name << "\n";
64 64
65 rtc::scoped_refptr<VideoFrameBuffer> buffer( 65 rtc::scoped_refptr<VideoFrameBuffer> buffer(
66 test::ReadI420Buffer(width_, height_, source_file_)); 66 test::ReadI420Buffer(width_, height_, source_file_));
67 67
68 orig_frame_.reset(new VideoFrame(buffer, kVideoRotation_0, 0)); 68 orig_frame_.reset(
69 new VideoFrame(buffer, kVideoRotation_0, VideoContentType::kDefault, 0));
69 } 70 }
70 71
71 void TestLibYuv::TearDown() { 72 void TestLibYuv::TearDown() {
72 if (source_file_ != NULL) { 73 if (source_file_ != NULL) {
73 ASSERT_EQ(0, fclose(source_file_)); 74 ASSERT_EQ(0, fclose(source_file_));
74 } 75 }
75 source_file_ = NULL; 76 source_file_ = NULL;
76 } 77 }
77 78
78 TEST_F(TestLibYuv, ConvertSanityTest) { 79 TEST_F(TestLibYuv, ConvertSanityTest) {
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 2, 2); 300 2, 2);
300 301
301 EXPECT_THAT(dst_y, ::testing::ElementsAre( 302 EXPECT_THAT(dst_y, ::testing::ElementsAre(
302 Average(0, 1, 4, 5), Average(2, 3, 6, 7), 303 Average(0, 1, 4, 5), Average(2, 3, 6, 7),
303 Average(8, 9, 12, 13), Average(10, 11, 14, 15))); 304 Average(8, 9, 12, 13), Average(10, 11, 14, 15)));
304 EXPECT_THAT(dst_uv, 305 EXPECT_THAT(dst_uv,
305 ::testing::ElementsAre(Average(0, 2, 4, 6), Average(1, 3, 5, 7))); 306 ::testing::ElementsAre(Average(0, 2, 4, 6), Average(1, 3, 5, 7)));
306 } 307 }
307 308
308 } // namespace webrtc 309 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698