OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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/voice_engine/test/auto_test/fakes/conference_transport.h" | 11 #include "webrtc/voice_engine/test/auto_test/fakes/conference_transport.h" |
12 | 12 |
13 #include <string> | 13 #include <string> |
14 | 14 |
15 #include "webrtc/base/byteorder.h" | 15 #include "webrtc/base/byteorder.h" |
16 #include "webrtc/base/timeutils.h" | 16 #include "webrtc/base/timeutils.h" |
17 #include "webrtc/system_wrappers/include/sleep.h" | 17 #include "webrtc/system_wrappers/include/sleep.h" |
18 #include "webrtc/voice_engine/channel_proxy.h" | 18 #include "webrtc/voice_engine/channel_proxy.h" |
19 #include "webrtc/voice_engine/voice_engine_impl.h" | 19 #include "webrtc/voice_engine/voice_engine_impl.h" |
20 | 20 |
| 21 namespace webrtc { |
| 22 namespace voetest { |
| 23 |
21 namespace { | 24 namespace { |
22 static const unsigned int kReflectorSsrc = 0x0000; | |
23 static const unsigned int kLocalSsrc = 0x0001; | |
24 static const unsigned int kFirstRemoteSsrc = 0x0002; | |
25 static const webrtc::CodecInst kCodecInst = | |
26 {120, "opus", 48000, 960, 2, 64000}; | |
27 static const int kAudioLevelHeaderId = 1; | |
28 | 25 |
29 static unsigned int ParseRtcpSsrc(const void* data, size_t len) { | 26 static const unsigned int kReflectorSsrc = 0x0000; |
30 const size_t ssrc_pos = 4; | 27 static const unsigned int kLocalSsrc = 0x0001; |
31 unsigned int ssrc = 0; | 28 static const unsigned int kFirstRemoteSsrc = 0x0002; |
32 if (len >= (ssrc_pos + sizeof(ssrc))) { | 29 static const webrtc::CodecInst kCodecInst = {120, "opus", 48000, 960, 2, 64000}; |
33 ssrc = rtc::GetBE32(static_cast<const char*>(data) + ssrc_pos); | 30 static const int kAudioLevelHeaderId = 1; |
34 } | 31 |
35 return ssrc; | 32 static unsigned int ParseRtcpSsrc(const void* data, size_t len) { |
| 33 const size_t ssrc_pos = 4; |
| 34 unsigned int ssrc = 0; |
| 35 if (len >= (ssrc_pos + sizeof(ssrc))) { |
| 36 ssrc = rtc::GetBE32(static_cast<const char*>(data) + ssrc_pos); |
36 } | 37 } |
| 38 return ssrc; |
| 39 } |
| 40 |
37 } // namespace | 41 } // namespace |
38 | 42 |
39 namespace voetest { | |
40 | |
41 ConferenceTransport::ConferenceTransport() | 43 ConferenceTransport::ConferenceTransport() |
42 : packet_event_(webrtc::EventWrapper::Create()), | 44 : packet_event_(webrtc::EventWrapper::Create()), |
43 thread_(Run, this, "ConferenceTransport"), | 45 thread_(Run, this, "ConferenceTransport"), |
44 rtt_ms_(0), | 46 rtt_ms_(0), |
45 stream_count_(0), | 47 stream_count_(0), |
46 rtp_header_parser_(webrtc::RtpHeaderParser::Create()) { | 48 rtp_header_parser_(webrtc::RtpHeaderParser::Create()) { |
47 rtp_header_parser_-> | 49 rtp_header_parser_-> |
48 RegisterRtpHeaderExtension(webrtc::kRtpExtensionAudioLevel, | 50 RegisterRtpHeaderExtension(webrtc::kRtpExtensionAudioLevel, |
49 kAudioLevelHeaderId); | 51 kAudioLevelHeaderId); |
50 | 52 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 | 292 |
291 bool ConferenceTransport::GetReceiverStatistics(unsigned int id, | 293 bool ConferenceTransport::GetReceiverStatistics(unsigned int id, |
292 webrtc::CallStatistics* stats) { | 294 webrtc::CallStatistics* stats) { |
293 int dst = GetReceiverChannelForSsrc(id); | 295 int dst = GetReceiverChannelForSsrc(id); |
294 if (dst == -1) { | 296 if (dst == -1) { |
295 return false; | 297 return false; |
296 } | 298 } |
297 EXPECT_EQ(0, local_rtp_rtcp_->GetRTCPStatistics(dst, *stats)); | 299 EXPECT_EQ(0, local_rtp_rtcp_->GetRTCPStatistics(dst, *stats)); |
298 return true; | 300 return true; |
299 } | 301 } |
| 302 |
300 } // namespace voetest | 303 } // namespace voetest |
| 304 } // namespace webrtc |
OLD | NEW |