Chromium Code Reviews| Index: webrtc/voice_engine/test/auto_test/fakes/loudest_filter.h |
| diff --git a/webrtc/voice_engine/test/auto_test/fakes/loudest_filter.h b/webrtc/voice_engine/test/auto_test/fakes/loudest_filter.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e394a6b801f960b0e59b29bdbdd4b8b5b03bbee6 |
| --- /dev/null |
| +++ b/webrtc/voice_engine/test/auto_test/fakes/loudest_filter.h |
| @@ -0,0 +1,54 @@ |
| +/* |
| + * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| + * |
| + * Use of this source code is governed by a BSD-style license |
| + * that can be found in the LICENSE file in the root of the source |
| + * tree. An additional intellectual property rights grant can be found |
| + * in the file PATENTS. All contributing project authors may |
| + * be found in the AUTHORS file in the root of the source tree. |
| + */ |
| + |
| +#ifndef WEBRTC_VOICE_ENGINE_TEST_AUTO_TEST_FAKES_LOUDEST_FILTER_H_ |
| +#define WEBRTC_VOICE_ENGINE_TEST_AUTO_TEST_FAKES_LOUDEST_FILTER_H_ |
| + |
| +#include <map> |
| +#include "webrtc/base/timeutils.h" |
| +#include "webrtc/common_types.h" |
| + |
| +namespace voetest { |
| + |
| +class LoudestFilter { |
| + public: |
| + /* DecideForward() |
| + * Decide whether to pass a RTP packet, given its header. |
| + * |
| + * Input: |
| + * rtp_header : Header of the RTP packet of interest. |
| + */ |
| + bool IfPassRtpPacket(const webrtc::RTPHeader& rtp_header); |
|
phoglund
2015/08/12 15:01:23
Hmm. This sounds like the if statement is somehow
hlundin-webrtc
2015/08/13 07:11:12
Virtual egg thrown. I agree with phoglund, to agre
minyue-webrtc
2015/08/13 11:31:15
Done.
minyue-webrtc
2015/08/13 11:31:15
Done.
|
| + |
| + private: |
| + struct Status { |
| + void Set(int audio_level, uint32 last_time_ms) { |
| + this->audio_level = audio_level; |
| + this->last_time_ms = last_time_ms; |
| + } |
| + int audio_level; |
| + uint32 last_time_ms; |
| + }; |
| + |
| + void RemoveTimeoutStreams(uint32 time_ms); |
| + unsigned int FindQuietestStream(); |
| + |
| + // Keeps the streams being forwarded in pair<SSRC, Status>. |
| + std::map<unsigned int, Status> stream_levels_; |
| + |
| + const int32 kStreamTimeOutMs = 5000; |
| + const size_t kMaxMixSize = 3; |
| + const int kInvalidAudioLevel = 128; |
| +}; |
| + |
| + |
| +} // namespace voetest |
| + |
| +#endif // WEBRTC_VOICE_ENGINE_TEST_AUTO_TEST_FAKES_LOUDEST_FILTER_H_ |