OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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/call/rtp_packet_sink_interface_mock.h" |
11 #include "webrtc/call/rtx_receive_stream.h" | 12 #include "webrtc/call/rtx_receive_stream.h" |
12 #include "webrtc/modules/rtp_rtcp/include/rtp_header_extension_map.h" | 13 #include "webrtc/modules/rtp_rtcp/include/rtp_header_extension_map.h" |
13 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h" | 14 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h" |
14 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h" | 15 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h" |
15 #include "webrtc/test/gmock.h" | 16 #include "webrtc/test/gmock.h" |
16 #include "webrtc/test/gtest.h" | 17 #include "webrtc/test/gtest.h" |
17 | 18 |
18 namespace webrtc { | 19 namespace webrtc { |
19 | 20 |
20 namespace { | 21 namespace { |
21 | 22 |
22 using ::testing::_; | 23 using ::testing::_; |
23 using ::testing::StrictMock; | 24 using ::testing::StrictMock; |
24 | 25 |
25 class MockRtpPacketSink : public RtpPacketSinkInterface { | |
26 public: | |
27 MOCK_METHOD1(OnRtpPacket, void(const RtpPacketReceived&)); | |
28 }; | |
29 | |
30 constexpr int kMediaPayloadType = 100; | 26 constexpr int kMediaPayloadType = 100; |
31 constexpr int kRtxPayloadType = 98; | 27 constexpr int kRtxPayloadType = 98; |
32 constexpr uint32_t kMediaSSRC = 0x3333333; | 28 constexpr uint32_t kMediaSSRC = 0x3333333; |
33 constexpr uint16_t kMediaSeqno = 0x5657; | 29 constexpr uint16_t kMediaSeqno = 0x5657; |
34 | 30 |
35 constexpr uint8_t kRtxPacket[] = { | 31 constexpr uint8_t kRtxPacket[] = { |
36 0x80, // Version 2. | 32 0x80, // Version 2. |
37 98, // Payload type. | 33 98, // Payload type. |
38 0x12, 0x34, // Seqno. | 34 0x12, 0x34, // Seqno. |
39 0x11, 0x11, 0x11, 0x11, // Timestamp. | 35 0x11, 0x11, 0x11, 0x11, // Timestamp. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 EXPECT_THAT(packet.payload(), testing::ElementsAre(0xee)); | 122 EXPECT_THAT(packet.payload(), testing::ElementsAre(0xee)); |
127 VideoRotation rotation = kVideoRotation_0; | 123 VideoRotation rotation = kVideoRotation_0; |
128 EXPECT_TRUE(packet.GetExtension<VideoOrientation>(&rotation)); | 124 EXPECT_TRUE(packet.GetExtension<VideoOrientation>(&rotation)); |
129 EXPECT_EQ(rotation, kVideoRotation_90); | 125 EXPECT_EQ(rotation, kVideoRotation_90); |
130 })); | 126 })); |
131 | 127 |
132 rtx_sink.OnRtpPacket(rtx_packet); | 128 rtx_sink.OnRtpPacket(rtx_packet); |
133 } | 129 } |
134 | 130 |
135 } // namespace webrtc | 131 } // namespace webrtc |
OLD | NEW |