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/modules/rtp_rtcp/test/BWEStandAlone/TestLoadGenerator.h" | 11 #include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/TestLoadGenerator.h" |
12 | 12 |
13 #include <stdio.h> | 13 #include <stdio.h> |
14 | 14 |
15 #include <algorithm> | 15 #include <algorithm> |
16 | 16 |
17 #include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/TestSenderReceiver.h" | 17 #include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/TestSenderReceiver.h" |
18 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" | 18 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
19 #include "webrtc/system_wrappers/interface/event_wrapper.h" | 19 #include "webrtc/system_wrappers/include/event_wrapper.h" |
20 #include "webrtc/system_wrappers/interface/tick_util.h" | 20 #include "webrtc/system_wrappers/include/tick_util.h" |
21 | 21 |
22 | 22 |
23 bool SenderThreadFunction(void *obj) | 23 bool SenderThreadFunction(void *obj) |
24 { | 24 { |
25 if (obj == NULL) | 25 if (obj == NULL) |
26 { | 26 { |
27 return false; | 27 return false; |
28 } | 28 } |
29 TestLoadGenerator *_genObj = static_cast<TestLoadGenerator *>(obj); | 29 TestLoadGenerator *_genObj = static_cast<TestLoadGenerator *>(obj); |
30 | 30 |
(...skipping 392 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 |