blob: 89c5cfc30846ab56391aecd647375e880aa29752 [file] [log] [blame]
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +00001/*
2 * libjingle
3 * Copyright 2004 Google Inc.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 * 3. The name of the author may not be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#include <map>
pbos@webrtc.org86f613d2014-06-10 08:53:05 +000029#include <vector>
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +000030
31#include "talk/base/gunit.h"
32#include "talk/media/base/testutils.h"
33#include "talk/media/base/videoengine_unittest.h"
34#include "talk/media/webrtc/webrtcvideoengine2.h"
pbos@webrtc.org86f613d2014-06-10 08:53:05 +000035#include "talk/media/webrtc/webrtcvideoengine2_unittest.h"
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +000036#include "talk/media/webrtc/webrtcvideochannelfactory.h"
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +000037
38namespace {
39static const cricket::VideoCodec kVp8Codec720p(100, "VP8", 1280, 720, 30, 0);
40static const cricket::VideoCodec kVp8Codec360p(100, "VP8", 640, 360, 30, 0);
41static const cricket::VideoCodec kVp8Codec270p(100, "VP8", 480, 270, 30, 0);
42static const cricket::VideoCodec kVp8Codec180p(100, "VP8", 320, 180, 30, 0);
43
44static const cricket::VideoCodec kVp8Codec(100, "VP8", 640, 400, 30, 0);
45static const cricket::VideoCodec kVp9Codec(101, "VP9", 640, 400, 30, 0);
46static const cricket::VideoCodec kRedCodec(116, "red", 0, 0, 0, 0);
47static const cricket::VideoCodec kUlpfecCodec(117, "ulpfec", 0, 0, 0, 0);
48
49static const uint32 kSsrcs1[] = {1};
50static const uint32 kRtxSsrcs1[] = {4};
pbos@webrtc.orgf99c2f22014-06-13 12:27:38 +000051
52void VerifyCodecHasDefaultFeedbackParams(const cricket::VideoCodec& codec) {
53 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam(
54 cricket::kRtcpFbParamNack, cricket::kParamValueEmpty)));
55 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam(
56 cricket::kRtcpFbParamNack, cricket::kRtcpFbNackParamPli)));
57 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam(
58 cricket::kRtcpFbParamRemb, cricket::kParamValueEmpty)));
59 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam(
60 cricket::kRtcpFbParamCcm, cricket::kRtcpFbCcmParamFir)));
61}
62
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +000063} // namespace
64
65namespace cricket {
pbos@webrtc.org86f613d2014-06-10 08:53:05 +000066FakeVideoSendStream::FakeVideoSendStream(
67 const webrtc::VideoSendStream::Config& config,
68 const std::vector<webrtc::VideoStream>& video_streams)
69 : sending_(false), config_(config), video_streams_(video_streams) {
70}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +000071
pbos@webrtc.org86f613d2014-06-10 08:53:05 +000072webrtc::VideoSendStream::Config FakeVideoSendStream::GetConfig() {
73 return config_;
74}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +000075
pbos@webrtc.org86f613d2014-06-10 08:53:05 +000076std::vector<webrtc::VideoStream> FakeVideoSendStream::GetVideoStreams() {
77 return video_streams_;
78}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +000079
pbos@webrtc.org86f613d2014-06-10 08:53:05 +000080bool FakeVideoSendStream::IsSending() {
81 return sending_;
82}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +000083
pbos@webrtc.org86f613d2014-06-10 08:53:05 +000084webrtc::VideoSendStream::Stats FakeVideoSendStream::GetStats() const {
85 return webrtc::VideoSendStream::Stats();
86}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +000087
pbos@webrtc.org86f613d2014-06-10 08:53:05 +000088bool FakeVideoSendStream::ReconfigureVideoEncoder(
89 const std::vector<webrtc::VideoStream>& streams,
90 const void* encoder_specific) {
91 video_streams_ = streams;
92 return true;
93}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +000094
pbos@webrtc.org86f613d2014-06-10 08:53:05 +000095webrtc::VideoSendStreamInput* FakeVideoSendStream::Input() {
96 // TODO(pbos): Fix.
97 return NULL;
98}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +000099
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000100void FakeVideoSendStream::Start() {
101 sending_ = true;
102}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000103
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000104void FakeVideoSendStream::Stop() {
105 sending_ = false;
106}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000107
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000108FakeVideoReceiveStream::FakeVideoReceiveStream(
109 const webrtc::VideoReceiveStream::Config& config)
110 : config_(config), receiving_(false) {
111}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000112
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000113webrtc::VideoReceiveStream::Config FakeVideoReceiveStream::GetConfig() {
114 return config_;
115}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000116
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000117webrtc::VideoReceiveStream::Stats FakeVideoReceiveStream::GetStats() const {
118 return webrtc::VideoReceiveStream::Stats();
119}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000120
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000121void FakeVideoReceiveStream::Start() {
122 receiving_ = true;
123}
124void FakeVideoReceiveStream::Stop() {
125 receiving_ = false;
126}
127void FakeVideoReceiveStream::GetCurrentReceiveCodec(webrtc::VideoCodec* codec) {
128}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000129
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000130FakeCall::FakeCall() { SetVideoCodecs(GetDefaultVideoCodecs()); }
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000131
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000132FakeCall::~FakeCall() {
133 EXPECT_EQ(0u, video_send_streams_.size());
134 EXPECT_EQ(0u, video_receive_streams_.size());
135}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000136
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000137void FakeCall::SetVideoCodecs(const std::vector<webrtc::VideoCodec> codecs) {
138 codecs_ = codecs;
139}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000140
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000141std::vector<FakeVideoSendStream*> FakeCall::GetVideoSendStreams() {
142 return video_send_streams_;
143}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000144
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000145std::vector<FakeVideoReceiveStream*> FakeCall::GetVideoReceiveStreams() {
146 return video_receive_streams_;
147}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000148
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000149webrtc::VideoCodec FakeCall::GetEmptyVideoCodec() {
150 webrtc::VideoCodec codec;
151 codec.minBitrate = 300;
152 codec.startBitrate = 800;
153 codec.maxBitrate = 1500;
154 codec.maxFramerate = 10;
155 codec.width = 640;
156 codec.height = 480;
157 codec.qpMax = 56;
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000158
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000159 return codec;
160}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000161
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000162webrtc::VideoCodec FakeCall::GetVideoCodecVp8() {
163 webrtc::VideoCodec vp8_codec = GetEmptyVideoCodec();
164 vp8_codec.codecType = webrtc::kVideoCodecVP8;
165 strcpy(vp8_codec.plName, kVp8Codec.name.c_str());
166 vp8_codec.plType = kVp8Codec.id;
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000167
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000168 return vp8_codec;
169}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000170
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000171webrtc::VideoCodec FakeCall::GetVideoCodecVp9() {
172 webrtc::VideoCodec vp9_codec = GetEmptyVideoCodec();
173 // TODO(pbos): Add a correct codecType when webrtc has one.
174 vp9_codec.codecType = webrtc::kVideoCodecVP8;
175 strcpy(vp9_codec.plName, kVp9Codec.name.c_str());
176 vp9_codec.plType = kVp9Codec.id;
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000177
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000178 return vp9_codec;
179}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000180
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000181std::vector<webrtc::VideoCodec> FakeCall::GetDefaultVideoCodecs() {
182 std::vector<webrtc::VideoCodec> codecs;
183 codecs.push_back(GetVideoCodecVp8());
184 // codecs.push_back(GetVideoCodecVp9());
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000185
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000186 return codecs;
187}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000188
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000189webrtc::VideoSendStream* FakeCall::CreateVideoSendStream(
190 const webrtc::VideoSendStream::Config& config,
191 const std::vector<webrtc::VideoStream>& video_streams,
192 const void* encoder_settings) {
193 FakeVideoSendStream* fake_stream =
194 new FakeVideoSendStream(config, video_streams);
195 video_send_streams_.push_back(fake_stream);
196 return fake_stream;
197}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000198
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000199void FakeCall::DestroyVideoSendStream(webrtc::VideoSendStream* send_stream) {
200 FakeVideoSendStream* fake_stream =
201 static_cast<FakeVideoSendStream*>(send_stream);
202 for (size_t i = 0; i < video_send_streams_.size(); ++i) {
203 if (video_send_streams_[i] == fake_stream) {
204 delete video_send_streams_[i];
205 video_send_streams_.erase(video_send_streams_.begin() + i);
206 return;
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000207 }
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000208 }
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000209 ADD_FAILURE() << "DestroyVideoSendStream called with unknown paramter.";
210}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000211
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000212webrtc::VideoReceiveStream* FakeCall::CreateVideoReceiveStream(
213 const webrtc::VideoReceiveStream::Config& config) {
214 video_receive_streams_.push_back(new FakeVideoReceiveStream(config));
215 return video_receive_streams_[video_receive_streams_.size() - 1];
216}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000217
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000218void FakeCall::DestroyVideoReceiveStream(
219 webrtc::VideoReceiveStream* receive_stream) {
220 FakeVideoReceiveStream* fake_stream =
221 static_cast<FakeVideoReceiveStream*>(receive_stream);
222 for (size_t i = 0; i < video_receive_streams_.size(); ++i) {
223 if (video_receive_streams_[i] == fake_stream) {
224 delete video_receive_streams_[i];
225 video_receive_streams_.erase(video_receive_streams_.begin() + i);
226 return;
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000227 }
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000228 }
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000229 ADD_FAILURE() << "DestroyVideoReceiveStream called with unknown paramter.";
230}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000231
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000232webrtc::PacketReceiver* FakeCall::Receiver() {
233 // TODO(pbos): Fix this.
234 return NULL;
235}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000236
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000237uint32_t FakeCall::SendBitrateEstimate() {
238 return 0;
239}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000240
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000241uint32_t FakeCall::ReceiveBitrateEstimate() {
242 return 0;
243}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000244
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000245FakeWebRtcVideoChannel2::FakeWebRtcVideoChannel2(
246 FakeCall* call,
247 WebRtcVideoEngine2* engine,
248 VoiceMediaChannel* voice_channel)
249 : WebRtcVideoChannel2(call, engine, engine->GetVideoEncoderFactory()),
250 fake_call_(call),
251 voice_channel_(voice_channel) {
252}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000253
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000254FakeWebRtcVideoChannel2::~FakeWebRtcVideoChannel2() {
255}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000256
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000257VoiceMediaChannel* FakeWebRtcVideoChannel2::GetVoiceChannel() {
258 return voice_channel_;
259}
260FakeCall* FakeWebRtcVideoChannel2::GetFakeCall() {
261 return fake_call_;
262}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000263
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000264FakeWebRtcVideoChannel2* FakeWebRtcVideoMediaChannelFactory::GetFakeChannel(
265 VideoMediaChannel* channel) {
266 return channel_map_[channel];
267}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000268
pbos@webrtc.org86f613d2014-06-10 08:53:05 +0000269WebRtcVideoChannel2* FakeWebRtcVideoMediaChannelFactory::Create(
270 WebRtcVideoEngine2* engine,
271 VoiceMediaChannel* voice_channel) {
272 FakeWebRtcVideoChannel2* channel =
273 new FakeWebRtcVideoChannel2(new FakeCall(), engine, voice_channel);
274 channel_map_[channel] = channel;
275 return channel;
276}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000277
278class WebRtcVideoEngine2Test : public testing::Test {
279 public:
pbos@webrtc.org9fbb7172014-06-13 09:34:13 +0000280 WebRtcVideoEngine2Test() : engine_(&factory_) {
281 std::vector<VideoCodec> engine_codecs = engine_.codecs();
282 assert(!engine_codecs.empty());
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000283 bool codec_set = false;
pbos@webrtc.org9fbb7172014-06-13 09:34:13 +0000284 for (size_t i = 0; i < engine_codecs.size(); ++i) {
285 if (engine_codecs[i].name == "red") {
286 default_red_codec_ = engine_codecs[i];
287 } else if (engine_codecs[i].name == "ulpfec") {
288 default_ulpfec_codec_ = engine_codecs[i];
289 } else if (engine_codecs[i].name == "rtx") {
290 default_rtx_codec_ = engine_codecs[i];
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000291 } else if (!codec_set) {
pbos@webrtc.org9fbb7172014-06-13 09:34:13 +0000292 default_codec_ = engine_codecs[i];
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000293 codec_set = true;
294 }
295 }
296
297 assert(codec_set);
298 }
299
300 protected:
301 FakeWebRtcVideoMediaChannelFactory factory_;
302 WebRtcVideoEngine2 engine_;
303 VideoCodec default_codec_;
304 VideoCodec default_red_codec_;
305 VideoCodec default_ulpfec_codec_;
306 VideoCodec default_rtx_codec_;
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000307};
308
309TEST_F(WebRtcVideoEngine2Test, CreateChannel) {
310 talk_base::scoped_ptr<VideoMediaChannel> channel(engine_.CreateChannel(NULL));
311 ASSERT_TRUE(channel.get() != NULL) << "Could not create channel.";
312 EXPECT_TRUE(factory_.GetFakeChannel(channel.get()) != NULL)
313 << "Channel not created through factory.";
314}
315
316TEST_F(WebRtcVideoEngine2Test, CreateChannelWithVoiceEngine) {
317 VoiceMediaChannel* voice_channel = reinterpret_cast<VoiceMediaChannel*>(0x42);
318 talk_base::scoped_ptr<VideoMediaChannel> channel(
319 engine_.CreateChannel(voice_channel));
320 ASSERT_TRUE(channel.get() != NULL) << "Could not create channel.";
321
322 FakeWebRtcVideoChannel2* fake_channel =
323 factory_.GetFakeChannel(channel.get());
324 ASSERT_TRUE(fake_channel != NULL) << "Channel not created through factory.";
325
326 EXPECT_TRUE(fake_channel->GetVoiceChannel() != NULL)
327 << "VoiceChannel not set.";
328 EXPECT_EQ(voice_channel, fake_channel->GetVoiceChannel())
329 << "Different VoiceChannel set than the provided one.";
330}
331
pbos@webrtc.orge322a172014-06-13 11:47:28 +0000332TEST_F(WebRtcVideoEngine2Test, FindCodec) {
333 const std::vector<cricket::VideoCodec>& c = engine_.codecs();
334 EXPECT_EQ(4U, c.size());
335
336 cricket::VideoCodec vp8(104, "VP8", 320, 200, 30, 0);
337 EXPECT_TRUE(engine_.FindCodec(vp8));
338
339 cricket::VideoCodec vp8_ci(104, "vp8", 320, 200, 30, 0);
340 EXPECT_TRUE(engine_.FindCodec(vp8));
341
342 cricket::VideoCodec vp8_diff_fr_diff_pref(104, "VP8", 320, 200, 50, 50);
343 EXPECT_TRUE(engine_.FindCodec(vp8_diff_fr_diff_pref));
344
345 cricket::VideoCodec vp8_diff_id(95, "VP8", 320, 200, 30, 0);
346 EXPECT_FALSE(engine_.FindCodec(vp8_diff_id));
347 vp8_diff_id.id = 97;
348 EXPECT_TRUE(engine_.FindCodec(vp8_diff_id));
349
350 cricket::VideoCodec vp8_diff_res(104, "VP8", 320, 111, 30, 0);
351 EXPECT_FALSE(engine_.FindCodec(vp8_diff_res));
352
353 // PeerConnection doesn't negotiate the resolution at this point.
354 // Test that FindCodec can handle the case when width/height is 0.
355 cricket::VideoCodec vp8_zero_res(104, "VP8", 0, 0, 30, 0);
356 EXPECT_TRUE(engine_.FindCodec(vp8_zero_res));
357
358 cricket::VideoCodec red(101, "RED", 0, 0, 30, 0);
359 EXPECT_TRUE(engine_.FindCodec(red));
360
361 cricket::VideoCodec red_ci(101, "red", 0, 0, 30, 0);
362 EXPECT_TRUE(engine_.FindCodec(red));
363
364 cricket::VideoCodec fec(102, "ULPFEC", 0, 0, 30, 0);
365 EXPECT_TRUE(engine_.FindCodec(fec));
366
367 cricket::VideoCodec fec_ci(102, "ulpfec", 0, 0, 30, 0);
368 EXPECT_TRUE(engine_.FindCodec(fec));
369
370 cricket::VideoCodec rtx(96, "rtx", 0, 0, 30, 0);
371 EXPECT_TRUE(engine_.FindCodec(rtx));
372}
373
374TEST_F(WebRtcVideoEngine2Test, DefaultRtxCodecHasAssociatedPayloadTypeSet) {
375 std::vector<VideoCodec> engine_codecs = engine_.codecs();
376 for (size_t i = 0; i < engine_codecs.size(); ++i) {
377 if (engine_codecs[i].name != kRtxCodecName)
378 continue;
379 int associated_payload_type;
380 EXPECT_TRUE(engine_codecs[i].GetParam(kCodecParamAssociatedPayloadType,
381 &associated_payload_type));
382 EXPECT_EQ(default_codec_.id, associated_payload_type);
383 return;
384 }
385 FAIL() << "No RTX codec found among default codecs.";
386}
387
pbos@webrtc.org587ef602014-06-16 17:32:02 +0000388TEST_F(WebRtcVideoEngine2Test, SupportsTimestampOffsetHeaderExtension) {
389 std::vector<RtpHeaderExtension> extensions = engine_.rtp_header_extensions();
390 ASSERT_FALSE(extensions.empty());
391 for (size_t i = 0; i < extensions.size(); ++i) {
392 if (extensions[i].uri == kRtpTimestampOffsetHeaderExtension) {
393 EXPECT_EQ(kRtpTimestampOffsetHeaderExtensionDefaultId, extensions[i].id);
394 return;
395 }
396 }
397 FAIL() << "Timestamp offset extension not in header-extension list.";
398}
399
400TEST_F(WebRtcVideoEngine2Test, SupportsAbsoluteSenderTimeHeaderExtension) {
401 std::vector<RtpHeaderExtension> extensions = engine_.rtp_header_extensions();
402 ASSERT_FALSE(extensions.empty());
403 for (size_t i = 0; i < extensions.size(); ++i) {
404 if (extensions[i].uri == kRtpAbsoluteSenderTimeHeaderExtension) {
405 EXPECT_EQ(kRtpAbsoluteSenderTimeHeaderExtensionDefaultId,
406 extensions[i].id);
407 return;
408 }
409 }
410 FAIL() << "Absolute Sender Time extension not in header-extension list.";
411}
412
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000413class WebRtcVideoChannel2BaseTest
414 : public VideoMediaChannelTest<WebRtcVideoEngine2, WebRtcVideoChannel2> {
415 protected:
416 virtual cricket::VideoCodec DefaultCodec() OVERRIDE { return kVp8Codec; }
417 typedef VideoMediaChannelTest<WebRtcVideoEngine2, WebRtcVideoChannel2> Base;
418};
419
420// TODO(pbos): Fix WebRtcVideoEngine2BaseTest, where we want CheckCoInitialize.
421#if 0
422// TODO(juberti): Figure out why ViE is munging the COM refcount.
423#ifdef WIN32
424TEST_F(WebRtcVideoChannel2BaseTest, DISABLED_CheckCoInitialize) {
425 Base::CheckCoInitialize();
426}
427#endif
428#endif
429
430TEST_F(WebRtcVideoChannel2BaseTest, SetSend) { Base::SetSend(); }
431
432TEST_F(WebRtcVideoChannel2BaseTest, SetSendWithoutCodecs) {
433 Base::SetSendWithoutCodecs();
434}
435
436TEST_F(WebRtcVideoChannel2BaseTest, SetSendSetsTransportBufferSizes) {
437 Base::SetSendSetsTransportBufferSizes();
438}
439
440// TODO(juberti): Fix this test to tolerate missing stats.
441TEST_F(WebRtcVideoChannel2BaseTest, DISABLED_GetStats) { Base::GetStats(); }
442
443// TODO(juberti): Fix this test to tolerate missing stats.
444TEST_F(WebRtcVideoChannel2BaseTest, DISABLED_GetStatsMultipleRecvStreams) {
445 Base::GetStatsMultipleRecvStreams();
446}
447
448TEST_F(WebRtcVideoChannel2BaseTest, DISABLED_GetStatsMultipleSendStreams) {
449 Base::GetStatsMultipleSendStreams();
450}
451
452TEST_F(WebRtcVideoChannel2BaseTest, SetSendBandwidth) {
453 Base::SetSendBandwidth();
454}
455TEST_F(WebRtcVideoChannel2BaseTest, SetSendSsrc) { Base::SetSendSsrc(); }
456TEST_F(WebRtcVideoChannel2BaseTest, SetSendSsrcAfterSetCodecs) {
457 Base::SetSendSsrcAfterSetCodecs();
458}
459
460TEST_F(WebRtcVideoChannel2BaseTest, SetRenderer) { Base::SetRenderer(); }
461
462TEST_F(WebRtcVideoChannel2BaseTest, AddRemoveRecvStreams) {
463 Base::AddRemoveRecvStreams();
464}
465
466TEST_F(WebRtcVideoChannel2BaseTest, DISABLED_AddRemoveRecvStreamAndRender) {
467 Base::AddRemoveRecvStreamAndRender();
468}
469
470TEST_F(WebRtcVideoChannel2BaseTest, AddRemoveRecvStreamsNoConference) {
471 Base::AddRemoveRecvStreamsNoConference();
472}
473
474TEST_F(WebRtcVideoChannel2BaseTest, AddRemoveSendStreams) {
475 Base::AddRemoveSendStreams();
476}
477
478TEST_F(WebRtcVideoChannel2BaseTest, SimulateConference) {
479 Base::SimulateConference();
480}
481
482TEST_F(WebRtcVideoChannel2BaseTest, AddRemoveCapturer) {
483 Base::AddRemoveCapturer();
484}
485
486TEST_F(WebRtcVideoChannel2BaseTest, RemoveCapturerWithoutAdd) {
487 Base::RemoveCapturerWithoutAdd();
488}
489
490TEST_F(WebRtcVideoChannel2BaseTest, AddRemoveCapturerMultipleSources) {
491 Base::AddRemoveCapturerMultipleSources();
492}
493
494// TODO(pbos): Figure out why this fails so often.
495TEST_F(WebRtcVideoChannel2BaseTest, DISABLED_HighAspectHighHeightCapturer) {
496 Base::HighAspectHighHeightCapturer();
497}
498
499TEST_F(WebRtcVideoChannel2BaseTest, RejectEmptyStreamParams) {
500 Base::RejectEmptyStreamParams();
501}
502
503TEST_F(WebRtcVideoChannel2BaseTest, AdaptResolution16x10) {
504 Base::AdaptResolution16x10();
505}
506
507TEST_F(WebRtcVideoChannel2BaseTest, AdaptResolution4x3) {
508 Base::AdaptResolution4x3();
509}
510
511TEST_F(WebRtcVideoChannel2BaseTest, MuteStream) { Base::MuteStream(); }
512
513TEST_F(WebRtcVideoChannel2BaseTest, MultipleSendStreams) {
514 Base::MultipleSendStreams();
515}
516
517// TODO(juberti): Restore this test once we support sending 0 fps.
518TEST_F(WebRtcVideoChannel2BaseTest, DISABLED_AdaptDropAllFrames) {
519 Base::AdaptDropAllFrames();
520}
521// TODO(juberti): Understand why we get decode errors on this test.
522TEST_F(WebRtcVideoChannel2BaseTest, DISABLED_AdaptFramerate) {
523 Base::AdaptFramerate();
524}
525
526TEST_F(WebRtcVideoChannel2BaseTest, SetSendStreamFormat0x0) {
527 Base::SetSendStreamFormat0x0();
528}
529
530// TODO(zhurunz): Fix the flakey test.
531TEST_F(WebRtcVideoChannel2BaseTest, DISABLED_SetSendStreamFormat) {
532 Base::SetSendStreamFormat();
533}
534
535TEST_F(WebRtcVideoChannel2BaseTest, TwoStreamsSendAndReceive) {
536 Base::TwoStreamsSendAndReceive(kVp8Codec);
537}
538
539TEST_F(WebRtcVideoChannel2BaseTest, TwoStreamsReUseFirstStream) {
540 Base::TwoStreamsReUseFirstStream(kVp8Codec);
541}
542
543class WebRtcVideoChannel2Test : public WebRtcVideoEngine2Test {
544 public:
545 virtual void SetUp() OVERRIDE {
546 channel_.reset(engine_.CreateChannel(NULL));
547 fake_channel_ = factory_.GetFakeChannel(channel_.get());
548 last_ssrc_ = 123;
549 ASSERT_TRUE(fake_channel_ != NULL)
550 << "Channel not created through factory.";
551 }
552
553 protected:
554 FakeVideoSendStream* AddSendStream() {
555 return AddSendStream(StreamParams::CreateLegacy(last_ssrc_++));
556 }
557
558 FakeVideoSendStream* AddSendStream(const StreamParams& sp) {
559 size_t num_streams =
560 fake_channel_->GetFakeCall()->GetVideoSendStreams().size();
561 EXPECT_TRUE(channel_->AddSendStream(sp));
562 std::vector<FakeVideoSendStream*> streams =
563 fake_channel_->GetFakeCall()->GetVideoSendStreams();
564 EXPECT_EQ(num_streams + 1, streams.size());
565 return streams[streams.size() - 1];
566 }
567
568 std::vector<FakeVideoSendStream*> GetFakeSendStreams() {
569 return fake_channel_->GetFakeCall()->GetVideoSendStreams();
570 }
571
572 FakeVideoReceiveStream* AddRecvStream() {
573 return AddRecvStream(StreamParams::CreateLegacy(last_ssrc_++));
574 }
575
576 FakeVideoReceiveStream* AddRecvStream(const StreamParams& sp) {
577 size_t num_streams =
578 fake_channel_->GetFakeCall()->GetVideoReceiveStreams().size();
579 EXPECT_TRUE(channel_->AddRecvStream(sp));
580 std::vector<FakeVideoReceiveStream*> streams =
581 fake_channel_->GetFakeCall()->GetVideoReceiveStreams();
582 EXPECT_EQ(num_streams + 1, streams.size());
583 return streams[streams.size() - 1];
584 }
585
586 void SetSendCodecsShouldWorkForBitrates(const char* min_bitrate,
587 const char* max_bitrate) {
588 std::vector<VideoCodec> codecs;
589 codecs.push_back(kVp8Codec);
590 codecs[0].params[kCodecParamMinBitrate] = min_bitrate;
591 codecs[0].params[kCodecParamMaxBitrate] = max_bitrate;
592 EXPECT_TRUE(channel_->SetSendCodecs(codecs));
593
594 FakeVideoSendStream* stream = AddSendStream();
595
pbos@webrtc.org6ae48c62014-06-06 10:49:19 +0000596 std::vector<webrtc::VideoStream> video_streams = stream->GetVideoStreams();
597 ASSERT_EQ(1u, video_streams.size());
598 EXPECT_EQ(atoi(min_bitrate), video_streams.back().min_bitrate_bps / 1000);
599 EXPECT_EQ(atoi(max_bitrate), video_streams.back().max_bitrate_bps / 1000);
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000600
601 VideoCodec codec;
602 EXPECT_TRUE(channel_->GetSendCodec(&codec));
603 EXPECT_EQ(min_bitrate, codec.params[kCodecParamMinBitrate]);
604 EXPECT_EQ(max_bitrate, codec.params[kCodecParamMaxBitrate]);
605 }
606
pbos@webrtc.org587ef602014-06-16 17:32:02 +0000607 void TestSetSendRtpHeaderExtensions(const std::string& cricket_ext,
608 const std::string& webrtc_ext) {
609 // Enable extension.
610 const int id = 1;
611 std::vector<cricket::RtpHeaderExtension> extensions;
612 extensions.push_back(cricket::RtpHeaderExtension(cricket_ext, id));
613 EXPECT_TRUE(channel_->SetSendRtpHeaderExtensions(extensions));
614
615 FakeVideoSendStream* send_stream =
616 AddSendStream(cricket::StreamParams::CreateLegacy(123));
617
618 // Verify the send extension id.
619 ASSERT_EQ(1u, send_stream->GetConfig().rtp.extensions.size());
620 EXPECT_EQ(id, send_stream->GetConfig().rtp.extensions[0].id);
621 EXPECT_EQ(webrtc_ext, send_stream->GetConfig().rtp.extensions[0].name);
622 // Verify call with same set of extensions returns true.
623 EXPECT_TRUE(channel_->SetSendRtpHeaderExtensions(extensions));
624 // Verify that SetSendRtpHeaderExtensions doesn't implicitly add them for
625 // receivers.
626 EXPECT_TRUE(AddRecvStream(cricket::StreamParams::CreateLegacy(123))
627 ->GetConfig()
628 .rtp.extensions.empty());
629
630 // Remove the extension id, verify that this doesn't reset extensions as
631 // they should be set before creating channels.
632 std::vector<cricket::RtpHeaderExtension> empty_extensions;
633 EXPECT_TRUE(channel_->SetSendRtpHeaderExtensions(empty_extensions));
634 EXPECT_FALSE(send_stream->GetConfig().rtp.extensions.empty());
635 }
636
637 void TestSetRecvRtpHeaderExtensions(const std::string& cricket_ext,
638 const std::string& webrtc_ext) {
639 // Enable extension.
640 const int id = 1;
641 std::vector<cricket::RtpHeaderExtension> extensions;
642 extensions.push_back(cricket::RtpHeaderExtension(cricket_ext, id));
643 EXPECT_TRUE(channel_->SetRecvRtpHeaderExtensions(extensions));
644
645 FakeVideoReceiveStream* recv_stream =
646 AddRecvStream(cricket::StreamParams::CreateLegacy(123));
647
648 // Verify the recv extension id.
649 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.extensions.size());
650 EXPECT_EQ(id, recv_stream->GetConfig().rtp.extensions[0].id);
651 EXPECT_EQ(webrtc_ext, recv_stream->GetConfig().rtp.extensions[0].name);
652 // Verify call with same set of extensions returns true.
653 EXPECT_TRUE(channel_->SetRecvRtpHeaderExtensions(extensions));
654 // Verify that SetRecvRtpHeaderExtensions doesn't implicitly add them for
655 // senders.
656 EXPECT_TRUE(AddSendStream(cricket::StreamParams::CreateLegacy(123))
657 ->GetConfig()
658 .rtp.extensions.empty());
659
660 // Remove the extension id, verify that this doesn't reset extensions as
661 // they should be set before creating channels.
662 std::vector<cricket::RtpHeaderExtension> empty_extensions;
663 EXPECT_TRUE(channel_->SetSendRtpHeaderExtensions(empty_extensions));
664 EXPECT_FALSE(recv_stream->GetConfig().rtp.extensions.empty());
665 }
666
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000667 talk_base::scoped_ptr<VideoMediaChannel> channel_;
668 FakeWebRtcVideoChannel2* fake_channel_;
669 uint32 last_ssrc_;
670};
671
672TEST_F(WebRtcVideoChannel2Test, DISABLED_MaxBitrateResetsWithConferenceMode) {
673 FAIL() << "Not implemented."; // TODO(pbos): Implement.
674}
675
676TEST_F(WebRtcVideoChannel2Test, DISABLED_StartSendBitrate) {
677 // TODO(pbos): Is this test testing vie_ ? this is confusing. No API to set
678 // start send bitrate from outside? Add defaults here that should be kept?
679 std::vector<cricket::VideoCodec> codec_list;
680 codec_list.push_back(kVp8Codec);
681 EXPECT_TRUE(channel_->SetSendCodecs(codec_list));
682 const unsigned int kVideoMinSendBitrateKbps = 50;
683 const unsigned int kVideoTargetSendBitrateKbps = 300;
684 const unsigned int kVideoMaxSendBitrateKbps = 2000;
685 FakeVideoSendStream* stream = AddSendStream();
pbos@webrtc.org6ae48c62014-06-06 10:49:19 +0000686 std::vector<webrtc::VideoStream> video_streams = stream->GetVideoStreams();
687 ASSERT_EQ(1u, video_streams.size());
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000688 EXPECT_EQ(kVideoMinSendBitrateKbps,
pbos@webrtc.org6ae48c62014-06-06 10:49:19 +0000689 video_streams.back().min_bitrate_bps / 1000);
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000690 EXPECT_EQ(kVideoTargetSendBitrateKbps,
pbos@webrtc.org6ae48c62014-06-06 10:49:19 +0000691 video_streams.back().target_bitrate_bps / 1000);
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000692 EXPECT_EQ(kVideoMaxSendBitrateKbps,
pbos@webrtc.org6ae48c62014-06-06 10:49:19 +0000693 video_streams.back().max_bitrate_bps / 1000);
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000694#if 0
695 // TODO(pbos): un-#if
696 VerifyVP8SendCodec(send_channel, kVP8Codec.width, kVP8Codec.height, 0,
697 kVideoMaxSendBitrateKbps, kVideoMinSendBitrateKbps,
698 kVideoDefaultStartSendBitrateKbps);
699 EXPECT_EQ(0, vie_.StartSend(send_channel));
700
701 // Increase the send bitrate and verify it is used as start bitrate.
702 const unsigned int kVideoSendBitrateBps = 768000;
703 vie_.SetSendBitrates(send_channel, kVideoSendBitrateBps, 0, 0);
704 EXPECT_TRUE(channel_->SetSendCodecs(codec_list));
705 VerifyVP8SendCodec(send_channel, kVP8Codec.width, kVP8Codec.height, 0,
706 kVideoMaxSendBitrateKbps, kVideoMinSendBitrateKbps,
707 kVideoSendBitrateBps / 1000);
708
709 // Never set a start bitrate higher than the max bitrate.
710 vie_.SetSendBitrates(send_channel, kVideoMaxSendBitrateKbps + 500, 0, 0);
711 EXPECT_TRUE(channel_->SetSendCodecs(codec_list));
712 VerifyVP8SendCodec(send_channel, kVP8Codec.width, kVP8Codec.height, 0,
713 kVideoMaxSendBitrateKbps, kVideoMinSendBitrateKbps,
714 kVideoDefaultStartSendBitrateKbps);
715
716 // Use the default start bitrate if the send bitrate is lower.
717 vie_.SetSendBitrates(send_channel, kVideoDefaultStartSendBitrateKbps - 50, 0,
718 0);
719 EXPECT_TRUE(channel_->SetSendCodecs(codec_list));
720 VerifyVP8SendCodec(send_channel, kVP8Codec.width, kVP8Codec.height, 0,
721 kVideoMaxSendBitrateKbps, kVideoMinSendBitrateKbps,
722 kVideoDefaultStartSendBitrateKbps);
723#endif
724}
725
726TEST_F(WebRtcVideoChannel2Test, DISABLED_RtcpEnabled) {
727 // Note(pbos): This is a receiver-side setting, dumbo.
728 FAIL() << "Not implemented."; // TODO(pbos): Implement.
729}
730
731TEST_F(WebRtcVideoChannel2Test, DISABLED_KeyFrameRequestEnabled) {
732 FAIL() << "Not implemented."; // TODO(pbos): Implement.
733}
734
735TEST_F(WebRtcVideoChannel2Test, RembIsEnabledByDefault) {
736 FakeVideoReceiveStream* stream = AddRecvStream();
737 EXPECT_TRUE(stream->GetConfig().rtp.remb);
738}
739
740TEST_F(WebRtcVideoChannel2Test, DISABLED_RembEnabledOnReceiveChannels) {
741 FAIL() << "Not implemented."; // TODO(pbos): Implement.
742}
743
pbos@webrtc.orge322a172014-06-13 11:47:28 +0000744TEST_F(WebRtcVideoChannel2Test, RecvStreamWithSimAndRtx) {
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000745 EXPECT_TRUE(channel_->SetSendCodecs(engine_.codecs()));
746 EXPECT_TRUE(channel_->SetSend(true));
747 cricket::VideoOptions options;
748 options.conference_mode.Set(true);
749 EXPECT_TRUE(channel_->SetOptions(options));
750
751 // Send side.
752 const std::vector<uint32> ssrcs = MAKE_VECTOR(kSsrcs1);
753 const std::vector<uint32> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1);
754 FakeVideoSendStream* send_stream = AddSendStream(
755 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs));
756
757 ASSERT_EQ(rtx_ssrcs.size(), send_stream->GetConfig().rtp.rtx.ssrcs.size());
758 for (size_t i = 0; i < rtx_ssrcs.size(); ++i)
759 EXPECT_EQ(rtx_ssrcs[i], send_stream->GetConfig().rtp.rtx.ssrcs[i]);
760
761 // Receiver side.
762 FakeVideoReceiveStream* recv_stream = AddRecvStream(
763 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs));
764 ASSERT_GT(recv_stream->GetConfig().rtp.rtx.size(), 0u)
765 << "No SSRCs for RTX configured by AddRecvStream.";
766 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.rtx.size())
767 << "This test only works with one receive codec. Please update the test.";
768 EXPECT_EQ(rtx_ssrcs[0],
769 recv_stream->GetConfig().rtp.rtx.begin()->second.ssrc);
770 // TODO(pbos): Make sure we set the RTX for correct payloads etc.
771}
772
pbos@webrtc.orge322a172014-06-13 11:47:28 +0000773TEST_F(WebRtcVideoChannel2Test, RecvStreamWithRtx) {
774 // Setup one channel with an associated RTX stream.
775 cricket::StreamParams params =
776 cricket::StreamParams::CreateLegacy(kSsrcs1[0]);
777 params.AddFidSsrc(kSsrcs1[0], kRtxSsrcs1[0]);
778 FakeVideoReceiveStream* recv_stream = AddRecvStream(params);
779 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.rtx.size());
780 EXPECT_EQ(kRtxSsrcs1[0],
781 recv_stream->GetConfig().rtp.rtx.begin()->second.ssrc);
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000782}
783
pbos@webrtc.orge322a172014-06-13 11:47:28 +0000784TEST_F(WebRtcVideoChannel2Test, RecvStreamNoRtx) {
785 // Setup one channel without an associated RTX stream.
786 cricket::StreamParams params =
787 cricket::StreamParams::CreateLegacy(kSsrcs1[0]);
788 FakeVideoReceiveStream* recv_stream = AddRecvStream(params);
789 ASSERT_TRUE(recv_stream->GetConfig().rtp.rtx.empty());
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000790}
791
pbos@webrtc.org587ef602014-06-16 17:32:02 +0000792TEST_F(WebRtcVideoChannel2Test, NoHeaderExtesionsByDefault) {
793 FakeVideoSendStream* send_stream =
794 AddSendStream(cricket::StreamParams::CreateLegacy(kSsrcs1[0]));
795 ASSERT_TRUE(send_stream->GetConfig().rtp.extensions.empty());
796
797 FakeVideoReceiveStream* recv_stream =
798 AddRecvStream(cricket::StreamParams::CreateLegacy(kSsrcs1[0]));
799 ASSERT_TRUE(recv_stream->GetConfig().rtp.extensions.empty());
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000800}
801
pbos@webrtc.org587ef602014-06-16 17:32:02 +0000802// Test support for RTP timestamp offset header extension.
803TEST_F(WebRtcVideoChannel2Test, SendRtpTimestampOffsetHeaderExtensions) {
804 TestSetSendRtpHeaderExtensions(kRtpTimestampOffsetHeaderExtension,
805 webrtc::RtpExtension::kTOffset);
806}
807TEST_F(WebRtcVideoChannel2Test, RecvRtpTimestampOffsetHeaderExtensions) {
808 TestSetRecvRtpHeaderExtensions(kRtpTimestampOffsetHeaderExtension,
809 webrtc::RtpExtension::kTOffset);
810}
811
812// Test support for absolute send time header extension.
813TEST_F(WebRtcVideoChannel2Test, SendAbsoluteSendTimeHeaderExtensions) {
814 TestSetSendRtpHeaderExtensions(kRtpAbsoluteSenderTimeHeaderExtension,
815 webrtc::RtpExtension::kAbsSendTime);
816}
817TEST_F(WebRtcVideoChannel2Test, RecvAbsoluteSendTimeHeaderExtensions) {
818 TestSetRecvRtpHeaderExtensions(kRtpAbsoluteSenderTimeHeaderExtension,
819 webrtc::RtpExtension::kAbsSendTime);
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000820}
821
822TEST_F(WebRtcVideoChannel2Test, DISABLED_LeakyBucketTest) {
823 FAIL() << "Not implemented."; // TODO(pbos): Implement.
824}
825
826TEST_F(WebRtcVideoChannel2Test, DISABLED_BufferedModeLatency) {
827 FAIL() << "Not implemented."; // TODO(pbos): Implement.
828}
829
830TEST_F(WebRtcVideoChannel2Test, DISABLED_AdditiveVideoOptions) {
831 FAIL() << "Not implemented."; // TODO(pbos): Implement.
832}
833
834TEST_F(WebRtcVideoChannel2Test, AddRecvStreamOnlyUsesOneReceiveStream) {
835 EXPECT_TRUE(channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(1)));
836 EXPECT_EQ(1u, fake_channel_->GetFakeCall()->GetVideoReceiveStreams().size());
837}
838
839TEST_F(WebRtcVideoChannel2Test, DISABLED_NoRembChangeAfterAddRecvStream) {
840 FAIL() << "Not implemented."; // TODO(pbos): Implement.
841}
842
843TEST_F(WebRtcVideoChannel2Test, DISABLED_RembOnOff) {
844 FAIL() << "Not implemented."; // TODO(pbos): Implement.
845}
846
pbos@webrtc.orgf99c2f22014-06-13 12:27:38 +0000847TEST_F(WebRtcVideoChannel2Test, NackIsEnabledByDefault) {
848 VerifyCodecHasDefaultFeedbackParams(default_codec_);
849
pbos@webrtc.org19864742014-05-30 07:35:47 +0000850 EXPECT_TRUE(channel_->SetSendCodecs(engine_.codecs()));
851 EXPECT_TRUE(channel_->SetSend(true));
852
853 // Send side.
854 FakeVideoSendStream* send_stream =
855 AddSendStream(cricket::StreamParams::CreateLegacy(1));
856 EXPECT_GT(send_stream->GetConfig().rtp.nack.rtp_history_ms, 0);
857
858 // Receiver side.
859 FakeVideoReceiveStream* recv_stream =
860 AddRecvStream(cricket::StreamParams::CreateLegacy(1));
861 EXPECT_GT(recv_stream->GetConfig().rtp.nack.rtp_history_ms, 0);
862
863 // Nack history size should match between sender and receiver.
864 EXPECT_EQ(send_stream->GetConfig().rtp.nack.rtp_history_ms,
865 recv_stream->GetConfig().rtp.nack.rtp_history_ms);
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000866}
867
pbos@webrtc.orgf99c2f22014-06-13 12:27:38 +0000868TEST_F(WebRtcVideoChannel2Test, NackCanBeDisabled) {
869 std::vector<VideoCodec> codecs;
870 codecs.push_back(kVp8Codec);
871
872 // Send side.
873 ASSERT_TRUE(channel_->SetSendCodecs(codecs));
874 FakeVideoSendStream* send_stream =
875 AddSendStream(cricket::StreamParams::CreateLegacy(1));
876 EXPECT_EQ(0, send_stream->GetConfig().rtp.nack.rtp_history_ms);
877
878 // Receiver side.
879 ASSERT_TRUE(channel_->SetRecvCodecs(codecs));
880 FakeVideoReceiveStream* recv_stream =
881 AddRecvStream(cricket::StreamParams::CreateLegacy(1));
882 EXPECT_EQ(0, recv_stream->GetConfig().rtp.nack.rtp_history_ms);
883}
884
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000885TEST_F(WebRtcVideoChannel2Test, DISABLED_VideoProtectionInterop) {
886 FAIL() << "Not implemented."; // TODO(pbos): Implement.
887}
888
889TEST_F(WebRtcVideoChannel2Test, DISABLED_VideoProtectionInteropReversed) {
890 FAIL() << "Not implemented."; // TODO(pbos): Implement.
891}
892
893TEST_F(WebRtcVideoChannel2Test, DISABLED_HybridNackFecConference) {
894 FAIL() << "Not implemented."; // TODO(pbos): Implement.
895}
896
897TEST_F(WebRtcVideoChannel2Test, DISABLED_AddRemoveRecvStreamConference) {
898 FAIL() << "Not implemented."; // TODO(pbos): Implement.
899}
900
901TEST_F(WebRtcVideoChannel2Test, DISABLED_SetRender) {
902 FAIL() << "Not implemented."; // TODO(pbos): Implement.
903}
904
905TEST_F(WebRtcVideoChannel2Test, DISABLED_SetBandwidthAuto) {
906 FAIL() << "Not implemented."; // TODO(pbos): Implement.
907}
908
909TEST_F(WebRtcVideoChannel2Test, DISABLED_SetBandwidthAutoCapped) {
910 FAIL() << "Not implemented."; // TODO(pbos): Implement.
911}
912
913TEST_F(WebRtcVideoChannel2Test, DISABLED_SetBandwidthFixed) {
914 FAIL() << "Not implemented."; // TODO(pbos): Implement.
915}
916
917TEST_F(WebRtcVideoChannel2Test, DISABLED_SetBandwidthInConference) {
918 FAIL() << "Not implemented."; // TODO(pbos): Implement.
919}
920
921TEST_F(WebRtcVideoChannel2Test, DISABLED_SetBandwidthScreencast) {
922 FAIL() << "Not implemented."; // TODO(pbos): Implement.
923}
924
925TEST_F(WebRtcVideoChannel2Test, DISABLED_SetSendSsrcAndCname) {
926 FAIL() << "Not implemented."; // TODO(pbos): Implement.
927}
928
929TEST_F(WebRtcVideoChannel2Test,
930 DISABLED_SetSendSsrcAfterCreatingReceiveChannel) {
931 FAIL() << "Not implemented."; // TODO(pbos): Implement.
932}
933
934TEST_F(WebRtcVideoChannel2Test, DISABLED_SetOptionsWithDenoising) {
935 FAIL() << "Not implemented."; // TODO(pbos): Implement.
936}
937
938TEST_F(WebRtcVideoChannel2Test, DISABLED_MultipleSendStreamsWithOneCapturer) {
939 FAIL() << "Not implemented."; // TODO(pbos): Implement.
940}
941
942TEST_F(WebRtcVideoChannel2Test, DISABLED_DISABLED_SendReceiveBitratesStats) {
943 FAIL() << "Not implemented."; // TODO(pbos): Implement.
944}
945
946TEST_F(WebRtcVideoChannel2Test, DISABLED_TestSetAdaptInputToCpuUsage) {
947 FAIL() << "Not implemented."; // TODO(pbos): Implement.
948}
949
950TEST_F(WebRtcVideoChannel2Test, DISABLED_TestSetCpuThreshold) {
951 FAIL() << "Not implemented."; // TODO(pbos): Implement.
952}
953
954TEST_F(WebRtcVideoChannel2Test, DISABLED_TestSetInvalidCpuThreshold) {
955 FAIL() << "Not implemented."; // TODO(pbos): Implement.
956}
957
958TEST_F(WebRtcVideoChannel2Test, DISABLED_WebRtcShouldLog) {
959 FAIL() << "Not implemented."; // TODO(pbos): Implement.
960}
961
962TEST_F(WebRtcVideoChannel2Test, DISABLED_WebRtcShouldNotLog) {
963 FAIL() << "Not implemented."; // TODO(pbos): Implement.
964}
965
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000966TEST_F(WebRtcVideoChannel2Test, SetDefaultSendCodecs) {
pbos@webrtc.org9fbb7172014-06-13 09:34:13 +0000967 ASSERT_TRUE(channel_->SetSendCodecs(engine_.codecs()));
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000968
969 VideoCodec codec;
970 EXPECT_TRUE(channel_->GetSendCodec(&codec));
pbos@webrtc.org9fbb7172014-06-13 09:34:13 +0000971 EXPECT_TRUE(codec.Matches(engine_.codecs()[0]));
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000972
973 // Using a RTX setup to verify that the default RTX payload type is good.
974 const std::vector<uint32> ssrcs = MAKE_VECTOR(kSsrcs1);
975 const std::vector<uint32> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1);
976 FakeVideoSendStream* stream = AddSendStream(
977 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs));
978 webrtc::VideoSendStream::Config config = stream->GetConfig();
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000979
980 // Make sure NACK and FEC are enabled on the correct payload types.
981 EXPECT_EQ(1000, config.rtp.nack.rtp_history_ms);
982 EXPECT_EQ(default_ulpfec_codec_.id, config.rtp.fec.ulpfec_payload_type);
983 EXPECT_EQ(default_red_codec_.id, config.rtp.fec.red_payload_type);
pbos@webrtc.org269605c2014-06-26 08:49:03 +0000984
985 EXPECT_EQ(1u, config.rtp.rtx.ssrcs.size());
986 EXPECT_EQ(kRtxSsrcs1[0], config.rtp.rtx.ssrcs[0]);
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000987 EXPECT_EQ(static_cast<int>(default_rtx_codec_.id),
988 config.rtp.rtx.payload_type);
989 // TODO(juberti): Check RTCP, PLI, TMMBR.
990}
991
992TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithoutFec) {
993 std::vector<VideoCodec> codecs;
994 codecs.push_back(kVp8Codec);
995 ASSERT_TRUE(channel_->SetSendCodecs(codecs));
996
997 FakeVideoSendStream* stream = AddSendStream();
998 webrtc::VideoSendStream::Config config = stream->GetConfig();
999
1000 EXPECT_EQ(-1, config.rtp.fec.ulpfec_payload_type);
1001 EXPECT_EQ(-1, config.rtp.fec.red_payload_type);
1002}
1003
1004TEST_F(WebRtcVideoChannel2Test,
pbos@webrtc.org269605c2014-06-26 08:49:03 +00001005 SetSendCodecRejectsRtxWithoutAssociatedPayloadType) {
1006 std::vector<VideoCodec> codecs;
1007 cricket::VideoCodec rtx_codec(96, "rtx", 0, 0, 0, 0);
1008 codecs.push_back(rtx_codec);
1009 EXPECT_FALSE(channel_->SetSendCodecs(codecs))
1010 << "RTX codec without associated payload type should be rejected.";
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +00001011}
1012
1013TEST_F(WebRtcVideoChannel2Test,
pbos@webrtc.org269605c2014-06-26 08:49:03 +00001014 SetSendCodecRejectsRtxWithoutMatchingVideoCodec) {
1015 std::vector<VideoCodec> codecs;
1016 cricket::VideoCodec rtx_codec =
1017 cricket::VideoCodec::CreateRtxCodec(96, kVp8Codec.id);
1018 codecs.push_back(kVp8Codec);
1019 codecs.push_back(rtx_codec);
1020 ASSERT_TRUE(channel_->SetSendCodecs(codecs));
1021
1022 cricket::VideoCodec rtx_codec2 =
1023 cricket::VideoCodec::CreateRtxCodec(96, kVp8Codec.id + 1);
1024 codecs.pop_back();
1025 codecs.push_back(rtx_codec2);
1026 EXPECT_FALSE(channel_->SetSendCodecs(codecs))
1027 << "RTX without matching video codec should be rejected.";
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +00001028}
1029
pbos@webrtc.org269605c2014-06-26 08:49:03 +00001030TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithoutFecDisablesFec) {
1031 std::vector<VideoCodec> codecs;
1032 codecs.push_back(kVp8Codec);
1033 codecs.push_back(kUlpfecCodec);
1034 ASSERT_TRUE(channel_->SetSendCodecs(codecs));
1035
1036 FakeVideoSendStream* stream = AddSendStream();
1037 webrtc::VideoSendStream::Config config = stream->GetConfig();
1038
1039 EXPECT_EQ(kUlpfecCodec.id, config.rtp.fec.ulpfec_payload_type);
1040
1041 codecs.pop_back();
1042 ASSERT_TRUE(channel_->SetSendCodecs(codecs));
1043 stream = fake_channel_->GetFakeCall()->GetVideoSendStreams()[0];
1044 ASSERT_TRUE(stream != NULL);
1045 config = stream->GetConfig();
1046 EXPECT_EQ(-1, config.rtp.fec.ulpfec_payload_type)
1047 << "SetSendCodec without FEC should disable current FEC.";
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +00001048}
1049
1050TEST_F(WebRtcVideoChannel2Test, DISABLED_SetSendCodecsChangesExistingStreams) {
1051 FAIL(); // TODO(pbos): Implement, make sure that it's changing running
1052 // streams. Should it?
1053}
1054
1055TEST_F(WebRtcVideoChannel2Test,
1056 DISABLED_ConstrainsSetCodecsAccordingToEncoderConfig) {
1057 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1058}
1059
1060TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithMinMaxBitrate) {
1061 SetSendCodecsShouldWorkForBitrates("10", "20");
1062}
1063
1064TEST_F(WebRtcVideoChannel2Test, SetSendCodecsRejectsMaxLessThanMinBitrate) {
pbos@webrtc.org9fbb7172014-06-13 09:34:13 +00001065 std::vector<VideoCodec> video_codecs = engine_.codecs();
1066 video_codecs[0].params[kCodecParamMinBitrate] = "30";
1067 video_codecs[0].params[kCodecParamMaxBitrate] = "20";
1068 EXPECT_FALSE(channel_->SetSendCodecs(video_codecs));
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +00001069}
1070
1071TEST_F(WebRtcVideoChannel2Test, SetSendCodecsAcceptLargeMinMaxBitrate) {
1072 SetSendCodecsShouldWorkForBitrates("1000", "2000");
1073}
1074
1075TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithMaxQuantization) {
1076 static const char* kMaxQuantization = "21";
1077 std::vector<VideoCodec> codecs;
1078 codecs.push_back(kVp8Codec);
1079 codecs[0].params[kCodecParamMaxQuantization] = kMaxQuantization;
1080 EXPECT_TRUE(channel_->SetSendCodecs(codecs));
pbos@webrtc.org6ae48c62014-06-06 10:49:19 +00001081 EXPECT_EQ(static_cast<unsigned int>(atoi(kMaxQuantization)),
1082 AddSendStream()->GetVideoStreams().back().max_qp);
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +00001083
1084 VideoCodec codec;
1085 EXPECT_TRUE(channel_->GetSendCodec(&codec));
1086 EXPECT_EQ(kMaxQuantization, codec.params[kCodecParamMaxQuantization]);
1087}
1088
1089TEST_F(WebRtcVideoChannel2Test, SetSendCodecsRejectBadDimensions) {
1090 std::vector<cricket::VideoCodec> codecs;
1091 codecs.push_back(kVp8Codec);
1092
1093 codecs[0].width = 0;
1094 EXPECT_FALSE(channel_->SetSendCodecs(codecs))
1095 << "Codec set though codec width is zero.";
1096
1097 codecs[0].width = kVp8Codec.width;
1098 codecs[0].height = 0;
1099 EXPECT_FALSE(channel_->SetSendCodecs(codecs))
1100 << "Codec set though codec height is zero.";
1101}
1102
1103TEST_F(WebRtcVideoChannel2Test, SetSendCodecsRejectBadPayloadTypes) {
1104 // TODO(pbos): Should we only allow the dynamic range?
1105 static const size_t kNumIncorrectPayloads = 4;
1106 static const int kIncorrectPayloads[kNumIncorrectPayloads] = {-2, -1, 128,
1107 129};
1108 std::vector<cricket::VideoCodec> codecs;
1109 codecs.push_back(kVp8Codec);
1110 for (size_t i = 0; i < kNumIncorrectPayloads; ++i) {
1111 int payload_type = kIncorrectPayloads[i];
1112 codecs[0].id = payload_type;
1113 EXPECT_FALSE(channel_->SetSendCodecs(codecs))
1114 << "Bad payload type '" << payload_type << "' accepted.";
1115 }
1116}
1117
1118TEST_F(WebRtcVideoChannel2Test, SetSendCodecsAcceptAllValidPayloadTypes) {
1119 std::vector<cricket::VideoCodec> codecs;
1120 codecs.push_back(kVp8Codec);
1121 for (int payload_type = 0; payload_type <= 127; ++payload_type) {
1122 codecs[0].id = payload_type;
1123 EXPECT_TRUE(channel_->SetSendCodecs(codecs))
1124 << "Payload type '" << payload_type << "' rejected.";
1125 }
1126}
1127
1128TEST_F(WebRtcVideoChannel2Test, DISABLED_ResetVieSendCodecOnNewFrameSize) {
1129 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1130}
1131
1132TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithOnlyVp8) {
1133 std::vector<cricket::VideoCodec> codecs;
1134 codecs.push_back(kVp8Codec);
1135 EXPECT_TRUE(channel_->SetRecvCodecs(codecs));
1136}
1137
pbos@webrtc.orge322a172014-06-13 11:47:28 +00001138// Test that we set our inbound RTX codecs properly.
1139TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithRtx) {
1140 std::vector<cricket::VideoCodec> codecs;
1141 codecs.push_back(kVp8Codec);
1142 cricket::VideoCodec rtx_codec(96, "rtx", 0, 0, 0, 0);
1143 codecs.push_back(rtx_codec);
1144 EXPECT_FALSE(channel_->SetRecvCodecs(codecs))
1145 << "RTX codec without associated payload should be rejected.";
1146
1147 codecs[1].SetParam("apt", kVp8Codec.id + 1);
1148 EXPECT_FALSE(channel_->SetRecvCodecs(codecs))
1149 << "RTX codec with invalid associated payload type should be rejected.";
1150
1151 codecs[1].SetParam("apt", kVp8Codec.id);
1152 EXPECT_TRUE(channel_->SetRecvCodecs(codecs));
1153
1154 cricket::VideoCodec rtx_codec2(97, "rtx", 0, 0, 0, 0);
1155 rtx_codec2.SetParam("apt", rtx_codec.id);
1156 codecs.push_back(rtx_codec2);
1157
1158 EXPECT_FALSE(channel_->SetRecvCodecs(codecs)) << "RTX codec with another RTX "
1159 "as associated payload type "
1160 "should be rejected.";
1161}
1162
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +00001163TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsDifferentPayloadType) {
1164 std::vector<cricket::VideoCodec> codecs;
1165 codecs.push_back(kVp8Codec);
1166 codecs[0].id = 99;
1167 EXPECT_TRUE(channel_->SetRecvCodecs(codecs));
1168}
1169
pbos@webrtc.orgccbed3b2014-07-11 13:02:54 +00001170TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsAcceptDefaultCodecs) {
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +00001171 EXPECT_TRUE(channel_->SetRecvCodecs(engine_.codecs()));
pbos@webrtc.orgccbed3b2014-07-11 13:02:54 +00001172
1173 FakeVideoReceiveStream* stream = AddRecvStream();
1174 webrtc::VideoReceiveStream::Config config = stream->GetConfig();
1175 EXPECT_STREQ(engine_.codecs()[0].name.c_str(), config.codecs[0].plName);
1176 EXPECT_EQ(engine_.codecs()[0].id, config.codecs[0].plType);
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +00001177}
1178
1179TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsRejectUnsupportedCodec) {
1180 std::vector<VideoCodec> codecs;
1181 codecs.push_back(kVp8Codec);
1182 codecs.push_back(VideoCodec(101, "WTF3", 640, 400, 30, 0));
1183 EXPECT_FALSE(channel_->SetRecvCodecs(codecs));
1184}
1185
1186// TODO(pbos): Enable VP9 through external codec support
1187TEST_F(WebRtcVideoChannel2Test,
1188 DISABLED_SetRecvCodecsAcceptsMultipleVideoCodecs) {
1189 std::vector<VideoCodec> codecs;
1190 codecs.push_back(kVp8Codec);
1191 codecs.push_back(kVp9Codec);
1192 EXPECT_TRUE(channel_->SetRecvCodecs(codecs));
1193}
1194
1195TEST_F(WebRtcVideoChannel2Test,
1196 DISABLED_SetRecvCodecsSetsFecForAllVideoCodecs) {
1197 std::vector<VideoCodec> codecs;
1198 codecs.push_back(kVp8Codec);
1199 codecs.push_back(kVp9Codec);
1200 EXPECT_TRUE(channel_->SetRecvCodecs(codecs));
1201 FAIL(); // TODO(pbos): Verify that the FEC parameters are set for all codecs.
1202}
1203
pbos@webrtc.org269605c2014-06-26 08:49:03 +00001204TEST_F(WebRtcVideoChannel2Test, DISABLED_SetRecvCodecsWithoutFecDisablesFec) {
1205 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1206}
1207
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +00001208TEST_F(WebRtcVideoChannel2Test, SetSendCodecsRejectDuplicateFecPayloads) {
1209 std::vector<VideoCodec> codecs;
1210 codecs.push_back(kVp8Codec);
1211 codecs.push_back(kRedCodec);
1212 codecs[1].id = codecs[0].id;
1213 EXPECT_FALSE(channel_->SetRecvCodecs(codecs));
1214}
1215
1216TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsRejectDuplicateCodecPayloads) {
1217 std::vector<VideoCodec> codecs;
1218 codecs.push_back(kVp8Codec);
1219 codecs.push_back(kVp9Codec);
1220 codecs[1].id = codecs[0].id;
1221 EXPECT_FALSE(channel_->SetRecvCodecs(codecs));
1222}
1223
1224TEST_F(WebRtcVideoChannel2Test,
1225 SetRecvCodecsAcceptSameCodecOnMultiplePayloadTypes) {
1226 std::vector<VideoCodec> codecs;
1227 codecs.push_back(kVp8Codec);
1228 codecs.push_back(kVp8Codec);
1229 codecs[1].id += 1;
1230 EXPECT_TRUE(channel_->SetRecvCodecs(codecs));
1231}
1232
1233TEST_F(WebRtcVideoChannel2Test, SendStreamNotSendingByDefault) {
1234 EXPECT_FALSE(AddSendStream()->IsSending());
1235}
1236
1237TEST_F(WebRtcVideoChannel2Test, DISABLED_ReceiveStreamReceivingByDefault) {
1238 // Is this test correct though? Auto-receive? Enable receive on first packet?
1239 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1240}
1241
1242TEST_F(WebRtcVideoChannel2Test, SetSend) {
1243 AddSendStream();
1244 EXPECT_FALSE(channel_->SetSend(true))
1245 << "Channel should not start without codecs.";
1246 EXPECT_TRUE(channel_->SetSend(false))
1247 << "Channel should be stoppable even without set codecs.";
1248
1249 std::vector<cricket::VideoCodec> codecs;
1250 codecs.push_back(kVp8Codec);
1251 channel_->SetSendCodecs(codecs);
1252 std::vector<FakeVideoSendStream*> streams = GetFakeSendStreams();
1253 ASSERT_EQ(1u, streams.size());
1254 FakeVideoSendStream* stream = streams.back();
1255
1256 EXPECT_FALSE(stream->IsSending());
1257
1258 // false->true
1259 EXPECT_TRUE(channel_->SetSend(true));
1260 EXPECT_TRUE(stream->IsSending());
1261 // true->true
1262 EXPECT_TRUE(channel_->SetSend(true));
1263 EXPECT_TRUE(stream->IsSending());
1264 // true->false
1265 EXPECT_TRUE(channel_->SetSend(false));
1266 EXPECT_FALSE(stream->IsSending());
1267 // false->false
1268 EXPECT_TRUE(channel_->SetSend(false));
1269 EXPECT_FALSE(stream->IsSending());
1270
1271 EXPECT_TRUE(channel_->SetSend(true));
1272 FakeVideoSendStream* new_stream = AddSendStream();
1273 EXPECT_TRUE(new_stream->IsSending())
1274 << "Send stream created after SetSend(true) not sending initially.";
1275}
1276
1277TEST_F(WebRtcVideoChannel2Test, DISABLED_SendAndReceiveVp8Vga) {
1278 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1279}
1280
1281TEST_F(WebRtcVideoChannel2Test, DISABLED_SendAndReceiveVp8Qvga) {
1282 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1283}
1284
1285TEST_F(WebRtcVideoChannel2Test, DISABLED_SendAndReceiveH264SvcQqvga) {
1286 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1287}
1288
1289TEST_F(WebRtcVideoChannel2Test, DISABLED_SendManyResizeOnce) {
1290 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1291}
1292
1293TEST_F(WebRtcVideoChannel2Test, DISABLED_SendVp8HdAndReceiveAdaptedVp8Vga) {
1294 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1295}
1296
1297TEST_F(WebRtcVideoChannel2Test, DISABLED_TestSetDscpOptions) {
1298 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1299}
1300
1301TEST_F(WebRtcVideoChannel2Test, DISABLED_SetOptionsWithMaxBitrate) {
1302 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1303}
1304
1305TEST_F(WebRtcVideoChannel2Test, DISABLED_SetOptionsWithLoweredBitrate) {
1306 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1307}
1308
1309TEST_F(WebRtcVideoChannel2Test, DISABLED_SetOptionsSucceedsWhenSending) {
1310 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1311}
1312
1313TEST_F(WebRtcVideoChannel2Test, DISABLED_ResetCodecOnScreencast) {
1314 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1315}
1316
1317TEST_F(WebRtcVideoChannel2Test, DISABLED_DontResetCodecOnSendFrame) {
1318 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1319}
1320
1321TEST_F(WebRtcVideoChannel2Test,
1322 DISABLED_DontRegisterDecoderIfFactoryIsNotGiven) {
1323 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1324}
1325
1326TEST_F(WebRtcVideoChannel2Test, DISABLED_RegisterDecoderIfFactoryIsGiven) {
1327 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1328}
1329
1330TEST_F(WebRtcVideoChannel2Test, DISABLED_DontRegisterDecoderMultipleTimes) {
1331 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1332}
1333
1334TEST_F(WebRtcVideoChannel2Test, DISABLED_DontRegisterDecoderForNonVP8) {
1335 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1336}
1337
1338TEST_F(WebRtcVideoChannel2Test,
1339 DISABLED_DontRegisterEncoderIfFactoryIsNotGiven) {
1340 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1341}
1342
1343TEST_F(WebRtcVideoChannel2Test, DISABLED_RegisterEncoderIfFactoryIsGiven) {
1344 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1345}
1346
1347TEST_F(WebRtcVideoChannel2Test, DISABLED_DontRegisterEncoderMultipleTimes) {
1348 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1349}
1350
1351TEST_F(WebRtcVideoChannel2Test,
1352 DISABLED_RegisterEncoderWithMultipleSendStreams) {
1353 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1354}
1355
1356TEST_F(WebRtcVideoChannel2Test, DISABLED_DontRegisterEncoderForNonVP8) {
1357 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1358}
1359
1360TEST_F(WebRtcVideoChannel2Test, DISABLED_FeedbackParamsForNonVP8) {
1361 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1362}
1363
1364TEST_F(WebRtcVideoChannel2Test, DISABLED_ExternalCodecAddedToTheEnd) {
1365 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1366}
1367
1368TEST_F(WebRtcVideoChannel2Test, DISABLED_ExternalCodecIgnored) {
1369 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1370}
1371
1372TEST_F(WebRtcVideoChannel2Test, DISABLED_UpdateEncoderCodecsAfterSetFactory) {
1373 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1374}
1375
1376TEST_F(WebRtcVideoChannel2Test, DISABLED_OnReadyToSend) {
1377 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1378}
1379
1380TEST_F(WebRtcVideoChannel2Test, DISABLED_CaptureFrameTimestampToNtpTimestamp) {
1381 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1382}
1383} // namespace cricket