OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 <algorithm> | 11 #include <algorithm> |
12 #include <memory> | 12 #include <memory> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "webrtc/base/rate_limiter.h" | 15 #include "webrtc/base/rate_limiter.h" |
16 #include "webrtc/common_types.h" | 16 #include "webrtc/common_types.h" |
17 #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" | 17 #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" |
18 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" | 18 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" |
19 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 19 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
20 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.h" | 20 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.h" |
21 #include "webrtc/modules/rtp_rtcp/test/testAPI/test_api.h" | 21 #include "webrtc/modules/rtp_rtcp/test/testAPI/test_api.h" |
22 #include "webrtc/test/gmock.h" | 22 #include "webrtc/test/gmock.h" |
23 #include "webrtc/test/gtest.h" | 23 #include "webrtc/test/gtest.h" |
24 | 24 |
25 namespace webrtc { | 25 namespace webrtc { |
26 namespace { | 26 namespace { |
27 | 27 |
28 const uint64_t kTestPictureId = 12345678; | |
29 const uint8_t kSliPictureId = 156; | |
30 | |
31 class RtcpCallback : public RtcpIntraFrameObserver { | 28 class RtcpCallback : public RtcpIntraFrameObserver { |
32 public: | 29 public: |
33 void SetModule(RtpRtcp* module) { | 30 void SetModule(RtpRtcp* module) { |
34 _rtpRtcpModule = module; | 31 _rtpRtcpModule = module; |
35 } | 32 } |
36 virtual void OnRTCPPacketTimeout(const int32_t id) { | 33 virtual void OnRTCPPacketTimeout(const int32_t id) { |
37 } | 34 } |
38 virtual void OnLipSyncUpdate(const int32_t id, | 35 virtual void OnLipSyncUpdate(const int32_t id, |
39 const int32_t audioVideoOffset) {} | 36 const int32_t audioVideoOffset) {} |
40 virtual void OnReceivedIntraFrameRequest(uint32_t ssrc) {} | 37 virtual void OnReceivedIntraFrameRequest(uint32_t ssrc) {} |
41 virtual void OnReceivedSLI(uint32_t ssrc, | |
42 uint8_t pictureId) { | |
43 EXPECT_EQ(kSliPictureId & 0x3f, pictureId); | |
44 } | |
45 virtual void OnReceivedRPSI(uint32_t ssrc, | |
46 uint64_t pictureId) { | |
47 EXPECT_EQ(kTestPictureId, pictureId); | |
48 } | |
49 | 38 |
50 private: | 39 private: |
51 RtpRtcp* _rtpRtcpModule; | 40 RtpRtcp* _rtpRtcpModule; |
52 }; | 41 }; |
53 | 42 |
54 class TestRtpFeedback : public NullRtpFeedback { | 43 class TestRtpFeedback : public NullRtpFeedback { |
55 public: | 44 public: |
56 explicit TestRtpFeedback(RtpRtcp* rtp_rtcp) : rtp_rtcp_(rtp_rtcp) {} | 45 explicit TestRtpFeedback(RtpRtcp* rtp_rtcp) : rtp_rtcp_(rtp_rtcp) {} |
57 virtual ~TestRtpFeedback() {} | 46 virtual ~TestRtpFeedback() {} |
58 | 47 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 EXPECT_EQ(test_ssrc, report_blocks[0].sourceSSRC); | 239 EXPECT_EQ(test_ssrc, report_blocks[0].sourceSSRC); |
251 | 240 |
252 EXPECT_EQ(0u, report_blocks[0].cumulativeLost); | 241 EXPECT_EQ(0u, report_blocks[0].cumulativeLost); |
253 EXPECT_LT(0u, report_blocks[0].delaySinceLastSR); | 242 EXPECT_LT(0u, report_blocks[0].delaySinceLastSR); |
254 EXPECT_EQ(test_sequence_number, report_blocks[0].extendedHighSeqNum); | 243 EXPECT_EQ(test_sequence_number, report_blocks[0].extendedHighSeqNum); |
255 EXPECT_EQ(0u, report_blocks[0].fractionLost); | 244 EXPECT_EQ(0u, report_blocks[0].fractionLost); |
256 } | 245 } |
257 | 246 |
258 } // namespace | 247 } // namespace |
259 } // namespace webrtc | 248 } // namespace webrtc |
OLD | NEW |