| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "talk/media/base/mediachannel.h" | 35 #include "talk/media/base/mediachannel.h" |
| 36 #include "talk/media/base/testutils.h" | 36 #include "talk/media/base/testutils.h" |
| 37 #include "talk/media/base/videoadapter.h" | 37 #include "talk/media/base/videoadapter.h" |
| 38 #include "webrtc/base/gunit.h" | 38 #include "webrtc/base/gunit.h" |
| 39 #include "webrtc/base/logging.h" | 39 #include "webrtc/base/logging.h" |
| 40 #include "webrtc/base/sigslot.h" | 40 #include "webrtc/base/sigslot.h" |
| 41 | 41 |
| 42 namespace cricket { | 42 namespace cricket { |
| 43 | 43 |
| 44 namespace { | 44 namespace { |
| 45 static const uint32 kWaitTimeout = 3000U; // 3 seconds. | 45 static const uint32_t kWaitTimeout = 3000U; // 3 seconds. |
| 46 static const uint32 kShortWaitTimeout = 1000U; // 1 second. | 46 static const uint32_t kShortWaitTimeout = 1000U; // 1 second. |
| 47 void UpdateCpuLoad(CoordinatedVideoAdapter* adapter, | 47 void UpdateCpuLoad(CoordinatedVideoAdapter* adapter, |
| 48 int current_cpus, int max_cpus, float process_load, float system_load) { | 48 int current_cpus, int max_cpus, float process_load, float system_load) { |
| 49 adapter->set_cpu_load_min_samples(1); | 49 adapter->set_cpu_load_min_samples(1); |
| 50 adapter->OnCpuLoadUpdated(current_cpus, max_cpus, | 50 adapter->OnCpuLoadUpdated(current_cpus, max_cpus, |
| 51 process_load, system_load); | 51 process_load, system_load); |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 | 54 |
| 55 class VideoAdapterTest : public testing::Test { | 55 class VideoAdapterTest : public testing::Test { |
| 56 public: | 56 public: |
| (...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1298 // it gets all the way there. | 1298 // it gets all the way there. |
| 1299 for (size_t i = 0; i < 10; ++i) { | 1299 for (size_t i = 0; i < 10; ++i) { |
| 1300 UpdateCpuLoad(&adapter, 1, 1, 0.5f, 0.5f); | 1300 UpdateCpuLoad(&adapter, 1, 1, 0.5f, 0.5f); |
| 1301 } | 1301 } |
| 1302 EXPECT_EQ(640, adapter.output_format().width); | 1302 EXPECT_EQ(640, adapter.output_format().width); |
| 1303 EXPECT_EQ(360, adapter.output_format().height); | 1303 EXPECT_EQ(360, adapter.output_format().height); |
| 1304 } | 1304 } |
| 1305 | 1305 |
| 1306 } // namespace cricket | 1306 } // namespace cricket |
| 1307 #endif // HAVE_WEBRTC_VIDEO | 1307 #endif // HAVE_WEBRTC_VIDEO |
| OLD | NEW |