| 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 #ifndef WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_TESTLOADGENERATOR_H_ | 11 #ifndef WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_TESTLOADGENERATOR_H_ |
| 12 #define WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_TESTLOADGENERATOR_H_ | 12 #define WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_TESTLOADGENERATOR_H_ |
| 13 | 13 |
| 14 #include <stdlib.h> | 14 #include <stdlib.h> |
| 15 | 15 |
| 16 #include "webrtc/base/platform_thread.h" |
| 16 #include "webrtc/modules/include/module_common_types.h" | 17 #include "webrtc/modules/include/module_common_types.h" |
| 17 #include "webrtc/system_wrappers/include/thread_wrapper.h" | |
| 18 #include "webrtc/typedefs.h" | 18 #include "webrtc/typedefs.h" |
| 19 | 19 |
| 20 class TestSenderReceiver; | 20 class TestSenderReceiver; |
| 21 namespace webrtc { | 21 namespace webrtc { |
| 22 class CriticalSectionWrapper; | 22 class CriticalSectionWrapper; |
| 23 class EventWrapper; | 23 class EventWrapper; |
| 24 } | 24 } |
| 25 | 25 |
| 26 class TestLoadGenerator | 26 class TestLoadGenerator |
| 27 { | 27 { |
| 28 public: | 28 public: |
| 29 TestLoadGenerator (TestSenderReceiver *sender, int32_t rtpSampleRate = 90000
); | 29 TestLoadGenerator (TestSenderReceiver *sender, int32_t rtpSampleRate = 90000
); |
| 30 virtual ~TestLoadGenerator (); | 30 virtual ~TestLoadGenerator (); |
| 31 | 31 |
| 32 int32_t SetBitrate (int32_t newBitrateKbps); | 32 int32_t SetBitrate (int32_t newBitrateKbps); |
| 33 virtual int32_t Start (const char *threadName = NULL); | 33 virtual int32_t Start (const char *threadName = NULL); |
| 34 virtual int32_t Stop (); | 34 virtual int32_t Stop (); |
| 35 virtual bool GeneratorLoop () = 0; | 35 virtual bool GeneratorLoop () = 0; |
| 36 | 36 |
| 37 protected: | 37 protected: |
| 38 virtual int generatePayload ( uint32_t timestamp ) = 0; | 38 virtual int generatePayload ( uint32_t timestamp ) = 0; |
| 39 int generatePayload (); | 39 int generatePayload (); |
| 40 int sendPayload (const uint32_t timeStamp, | 40 int sendPayload (const uint32_t timeStamp, |
| 41 const uint8_t* payloadData, | 41 const uint8_t* payloadData, |
| 42 const size_t payloadSize, | 42 const size_t payloadSize, |
| 43 const webrtc::FrameType frameType = webrtc::kVideoFrameDelta); | 43 const webrtc::FrameType frameType = webrtc::kVideoFrameDelta); |
| 44 | 44 |
| 45 webrtc::CriticalSectionWrapper* _critSect; | 45 webrtc::CriticalSectionWrapper* _critSect; |
| 46 webrtc::EventWrapper *_eventPtr; | 46 webrtc::EventWrapper *_eventPtr; |
| 47 rtc::scoped_ptr<webrtc::ThreadWrapper> _genThread; | 47 rtc::scoped_ptr<webrtc::PlatformThread> _genThread; |
| 48 int32_t _bitrateKbps; | 48 int32_t _bitrateKbps; |
| 49 TestSenderReceiver *_sender; | 49 TestSenderReceiver *_sender; |
| 50 bool _running; | 50 bool _running; |
| 51 int32_t _rtpSampleRate; | 51 int32_t _rtpSampleRate; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 | 54 |
| 55 class CBRGenerator : public TestLoadGenerator | 55 class CBRGenerator : public TestLoadGenerator |
| 56 { | 56 { |
| 57 public: | 57 public: |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 140 |
| 141 ~CBRFrameDropGenerator(); | 141 ~CBRFrameDropGenerator(); |
| 142 | 142 |
| 143 protected: | 143 protected: |
| 144 virtual size_t nextPayloadSize(); | 144 virtual size_t nextPayloadSize(); |
| 145 | 145 |
| 146 double _accBits; | 146 double _accBits; |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 #endif // WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_TESTLOADGENERATOR_H_ | 149 #endif // WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_TESTLOADGENERATOR_H_ |
| OLD | NEW |