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 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } else { | 110 } else { |
111 streams.push_front(stream); | 111 streams.push_front(stream); |
112 } | 112 } |
113 } | 113 } |
114 for (auto s : streams) { | 114 for (auto s : streams) { |
115 call->DestroyAudioReceiveStream(s); | 115 call->DestroyAudioReceiveStream(s); |
116 } | 116 } |
117 streams.clear(); | 117 streams.clear(); |
118 } | 118 } |
119 } | 119 } |
| 120 |
| 121 TEST(CallTest, CreateDestroy_FlexfecReceiveStream) { |
| 122 CallHelper call; |
| 123 FlexfecReceiveStream::Config config; |
| 124 config.flexfec_payload_type = 118; |
| 125 config.flexfec_ssrc = 38837212; |
| 126 config.protected_media_ssrcs = {27273}; |
| 127 |
| 128 FlexfecReceiveStream* stream = call->CreateFlexfecReceiveStream(config); |
| 129 EXPECT_NE(stream, nullptr); |
| 130 call->DestroyFlexfecReceiveStream(stream); |
| 131 } |
| 132 |
| 133 TEST(CallTest, CreateDestroy_FlexfecReceiveStreams) { |
| 134 CallHelper call; |
| 135 FlexfecReceiveStream::Config config; |
| 136 config.flexfec_payload_type = 118; |
| 137 std::list<FlexfecReceiveStream*> streams; |
| 138 |
| 139 for (int i = 0; i < 2; ++i) { |
| 140 for (uint32_t ssrc = 0; ssrc < 1234567; ssrc += 34567) { |
| 141 config.flexfec_ssrc = ssrc; |
| 142 config.protected_media_ssrcs = {ssrc + 1}; |
| 143 FlexfecReceiveStream* stream = call->CreateFlexfecReceiveStream(config); |
| 144 EXPECT_NE(stream, nullptr); |
| 145 if (ssrc & 1) { |
| 146 streams.push_back(stream); |
| 147 } else { |
| 148 streams.push_front(stream); |
| 149 } |
| 150 } |
| 151 for (auto s : streams) { |
| 152 call->DestroyFlexfecReceiveStream(s); |
| 153 } |
| 154 streams.clear(); |
| 155 } |
| 156 } |
| 157 |
| 158 TEST(CallTest, MultipleFlexfecReceiveStreamsProtectingSingleVideoStream) { |
| 159 CallHelper call; |
| 160 FlexfecReceiveStream::Config config; |
| 161 config.flexfec_payload_type = 118; |
| 162 config.protected_media_ssrcs = {1324234}; |
| 163 FlexfecReceiveStream* stream; |
| 164 std::list<FlexfecReceiveStream*> streams; |
| 165 |
| 166 config.flexfec_ssrc = 838383; |
| 167 stream = call->CreateFlexfecReceiveStream(config); |
| 168 EXPECT_NE(stream, nullptr); |
| 169 streams.push_back(stream); |
| 170 |
| 171 config.flexfec_ssrc = 424993; |
| 172 stream = call->CreateFlexfecReceiveStream(config); |
| 173 EXPECT_NE(stream, nullptr); |
| 174 streams.push_back(stream); |
| 175 |
| 176 config.flexfec_ssrc = 99383; |
| 177 stream = call->CreateFlexfecReceiveStream(config); |
| 178 EXPECT_NE(stream, nullptr); |
| 179 streams.push_back(stream); |
| 180 |
| 181 config.flexfec_ssrc = 5548; |
| 182 stream = call->CreateFlexfecReceiveStream(config); |
| 183 EXPECT_NE(stream, nullptr); |
| 184 streams.push_back(stream); |
| 185 |
| 186 for (auto s : streams) { |
| 187 call->DestroyFlexfecReceiveStream(s); |
| 188 } |
| 189 } |
| 190 |
120 } // namespace webrtc | 191 } // namespace webrtc |
OLD | NEW |