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 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 return _bitrateKbps; | 69 return _bitrateKbps; |
70 } | 70 } |
71 | 71 |
72 | 72 |
73 int32_t TestLoadGenerator::Start (const char *threadName) | 73 int32_t TestLoadGenerator::Start (const char *threadName) |
74 { | 74 { |
75 CriticalSectionScoped cs(_critSect); | 75 CriticalSectionScoped cs(_critSect); |
76 | 76 |
77 _eventPtr = EventWrapper::Create(); | 77 _eventPtr = EventWrapper::Create(); |
78 | 78 |
79 _genThread = ThreadWrapper::CreateThread(SenderThreadFunction, this, | 79 _genThread = |
80 threadName); | 80 PlatformThread::CreateThread(SenderThreadFunction, this, threadName); |
81 _running = true; | 81 _running = true; |
82 | 82 |
83 _genThread->Start(); | 83 _genThread->Start(); |
84 _genThread->SetPriority(kRealtimePriority); | 84 _genThread->SetPriority(kRealtimePriority); |
85 | 85 |
86 return 0; | 86 return 0; |
87 } | 87 } |
88 | 88 |
89 | 89 |
90 int32_t TestLoadGenerator::Stop () | 90 int32_t TestLoadGenerator::Stop () |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 //printf("keep\n"); | 423 //printf("keep\n"); |
424 const double periodMs = 1000.0 / _frameRateFps; | 424 const double periodMs = 1000.0 / _frameRateFps; |
425 size_t frameSize = | 425 size_t frameSize = |
426 static_cast<size_t>(_bitrateKbps * periodMs / 8 + 0.5); | 426 static_cast<size_t>(_bitrateKbps * periodMs / 8 + 0.5); |
427 frameSize = | 427 frameSize = |
428 std::max(frameSize, static_cast<size_t>(300 * periodMs / 8 + 0.5)); | 428 std::max(frameSize, static_cast<size_t>(300 * periodMs / 8 + 0.5)); |
429 _accBits += frameSize * 8; | 429 _accBits += frameSize * 8; |
430 return frameSize; | 430 return frameSize; |
431 } | 431 } |
432 } | 432 } |
OLD | NEW |