OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 |
11 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 11 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
12 #include "webrtc/modules/video_processing/include/video_processing.h" | 12 #include "webrtc/modules/video_processing/include/video_processing.h" |
13 #include "webrtc/modules/video_processing/test/video_processing_unittest.h" | 13 #include "webrtc/modules/video_processing/test/video_processing_unittest.h" |
14 #include "webrtc/test/testsupport/gtest_disable.h" | |
15 | 14 |
16 namespace webrtc { | 15 namespace webrtc { |
17 | 16 |
18 TEST_F(VideoProcessingTest, DISABLED_ON_IOS(BrightnessDetection)) { | 17 #if defined(WEBRTC_IOS) |
| 18 #define MAYBE_BrightnessDetection DISABLED_BrightnessDetection |
| 19 #else |
| 20 #define MAYBE_BrightnessDetection BrightnessDetection |
| 21 #endif |
| 22 TEST_F(VideoProcessingTest, MAYBE_BrightnessDetection) { |
19 uint32_t frameNum = 0; | 23 uint32_t frameNum = 0; |
20 int32_t brightnessWarning = 0; | 24 int32_t brightnessWarning = 0; |
21 uint32_t warningCount = 0; | 25 uint32_t warningCount = 0; |
22 rtc::scoped_ptr<uint8_t[]> video_buffer(new uint8_t[frame_length_]); | 26 rtc::scoped_ptr<uint8_t[]> video_buffer(new uint8_t[frame_length_]); |
23 while (fread(video_buffer.get(), 1, frame_length_, source_file_) == | 27 while (fread(video_buffer.get(), 1, frame_length_, source_file_) == |
24 frame_length_) { | 28 frame_length_) { |
25 EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0, width_, height_, | 29 EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0, width_, height_, |
26 0, kVideoRotation_0, &video_frame_)); | 30 0, kVideoRotation_0, &video_frame_)); |
27 frameNum++; | 31 frameNum++; |
28 VideoProcessing::FrameStats stats; | 32 VideoProcessing::FrameStats stats; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 111 } |
108 } | 112 } |
109 ASSERT_NE(0, feof(source_file_)) << "Error reading source file"; | 113 ASSERT_NE(0, feof(source_file_)) << "Error reading source file"; |
110 | 114 |
111 // Expect many darkness warnings | 115 // Expect many darkness warnings |
112 warningProportion = static_cast<float>(warningCount) / frameNum * 100; | 116 warningProportion = static_cast<float>(warningCount) / frameNum * 100; |
113 printf("Dark foreman: %.1f %%\n\n", warningProportion); | 117 printf("Dark foreman: %.1f %%\n\n", warningProportion); |
114 EXPECT_GT(warningProportion, 90); | 118 EXPECT_GT(warningProportion, 90); |
115 } | 119 } |
116 } // namespace webrtc | 120 } // namespace webrtc |
OLD | NEW |