OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 |
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 // Stream should already be deleted. | 1056 // Stream should already be deleted. |
1057 EXPECT_FALSE(channel_->RemoveSendStream(kSsrcs4[kSsrcsSize - 1])); | 1057 EXPECT_FALSE(channel_->RemoveSendStream(kSsrcs4[kSsrcsSize - 1])); |
1058 } | 1058 } |
1059 | 1059 |
1060 // Two streams one channel tests. | 1060 // Two streams one channel tests. |
1061 | 1061 |
1062 // Tests that we can send and receive frames. | 1062 // Tests that we can send and receive frames. |
1063 void TwoStreamsSendAndReceive(const cricket::VideoCodec& codec) { | 1063 void TwoStreamsSendAndReceive(const cricket::VideoCodec& codec) { |
1064 SetUpSecondStream(); | 1064 SetUpSecondStream(); |
1065 // Test sending and receiving on first stream. | 1065 // Test sending and receiving on first stream. |
1066 SendAndReceive(codec); | 1066 EXPECT_TRUE(SetOneCodec(codec)); |
| 1067 EXPECT_TRUE(SetSend(true)); |
| 1068 EXPECT_TRUE(channel_->SetSink(kDefaultReceiveSsrc, &renderer_)); |
| 1069 EXPECT_EQ(0, renderer_.num_rendered_frames()); |
| 1070 EXPECT_TRUE(SendFrame()); |
| 1071 // Since multiple streams share this link we should be receiving smaller |
| 1072 // initial frames (start at QVGA since shared bitrate is 150k each). |
| 1073 EXPECT_FRAME_WAIT(1, codec.width / 2, codec.height / 2, kTimeout); |
| 1074 std::unique_ptr<const rtc::CopyOnWriteBuffer> p(GetRtpPacket(0)); |
| 1075 EXPECT_EQ(codec.id, GetPayloadType(p.get())); |
1067 // Test sending and receiving on second stream. | 1076 // Test sending and receiving on second stream. |
1068 EXPECT_EQ_WAIT(1, renderer2_.num_rendered_frames(), kTimeout); | 1077 EXPECT_EQ_WAIT(1, renderer2_.num_rendered_frames(), kTimeout); |
1069 EXPECT_GT(NumRtpPackets(), 0); | 1078 EXPECT_GT(NumRtpPackets(), 0); |
1070 EXPECT_EQ(1, renderer2_.num_rendered_frames()); | 1079 EXPECT_EQ(1, renderer2_.num_rendered_frames()); |
1071 } | 1080 } |
1072 | 1081 |
1073 const std::unique_ptr<webrtc::Call> call_; | 1082 const std::unique_ptr<webrtc::Call> call_; |
1074 E engine_; | 1083 E engine_; |
1075 std::unique_ptr<cricket::FakeVideoCapturer> video_capturer_; | 1084 std::unique_ptr<cricket::FakeVideoCapturer> video_capturer_; |
1076 std::unique_ptr<cricket::FakeVideoCapturer> video_capturer_2_; | 1085 std::unique_ptr<cricket::FakeVideoCapturer> video_capturer_2_; |
1077 std::unique_ptr<C> channel_; | 1086 std::unique_ptr<C> channel_; |
1078 cricket::FakeNetworkInterface network_interface_; | 1087 cricket::FakeNetworkInterface network_interface_; |
1079 cricket::FakeVideoRenderer renderer_; | 1088 cricket::FakeVideoRenderer renderer_; |
1080 cricket::VideoMediaChannel::Error media_error_; | 1089 cricket::VideoMediaChannel::Error media_error_; |
1081 | 1090 |
1082 // Used by test cases where 2 streams are run on the same channel. | 1091 // Used by test cases where 2 streams are run on the same channel. |
1083 cricket::FakeVideoRenderer renderer2_; | 1092 cricket::FakeVideoRenderer renderer2_; |
1084 }; | 1093 }; |
1085 | 1094 |
1086 #endif // WEBRTC_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_ NOLINT | 1095 #endif // WEBRTC_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_ NOLINT |
OLD | NEW |