blob: 1181bfe488ec7620df4128ee59655b541fd91274 [file] [log] [blame]
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +00001/*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10#include <stdio.h>
11
12#include <deque>
13#include <map>
14
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000015#include "gflags/gflags.h"
pbos@webrtc.org69215d82013-07-10 15:02:02 +000016#include "testing/gtest/include/gtest/gtest.h"
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000017
pbos@webrtc.org16e03b72013-10-28 16:32:01 +000018#include "webrtc/call.h"
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000019#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
20#include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h"
21#include "webrtc/system_wrappers/interface/clock.h"
22#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
23#include "webrtc/system_wrappers/interface/event_wrapper.h"
24#include "webrtc/system_wrappers/interface/scoped_ptr.h"
pbos@webrtc.org94015242013-10-16 11:05:37 +000025#include "webrtc/system_wrappers/interface/sleep.h"
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000026#include "webrtc/test/testsupport/fileutils.h"
pbos@webrtc.org16e03b72013-10-28 16:32:01 +000027#include "webrtc/test/direct_transport.h"
28#include "webrtc/test/frame_generator_capturer.h"
pbos@webrtc.org16e03b72013-10-28 16:32:01 +000029#include "webrtc/test/statistics.h"
30#include "webrtc/test/video_renderer.h"
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000031#include "webrtc/typedefs.h"
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000032
33DEFINE_int32(seconds, 10, "Seconds to run each clip.");
34
35namespace webrtc {
36
pbos@webrtc.orgb613b5a2013-12-03 10:13:04 +000037static const uint32_t kSendSsrc = 0x654321;
38
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000039struct FullStackTestParams {
40 const char* test_label;
41 struct {
42 const char* name;
pbos@webrtc.orgf3f13582013-07-09 14:04:46 +000043 size_t width, height;
44 int fps;
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000045 } clip;
pbos@webrtc.orgf3f13582013-07-09 14:04:46 +000046 unsigned int bitrate;
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000047 double avg_psnr_threshold;
48 double avg_ssim_threshold;
49};
50
pbos@webrtc.org841c8a42013-09-09 15:04:25 +000051FullStackTestParams paris_qcif = {
52 "net_delay_0_0_plr_0", {"paris_qcif", 176, 144, 30}, 300, 36.0, 0.96};
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000053
54// TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif.
pbos@webrtc.org841c8a42013-09-09 15:04:25 +000055FullStackTestParams foreman_cif = {
56 "foreman_cif_net_delay_0_0_plr_0",
57 {"foreman_cif", 352, 288, 30},
58 700,
59 0.0,
60 0.0};
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000061
62class FullStackTest : public ::testing::TestWithParam<FullStackTestParams> {
63 protected:
64 std::map<uint32_t, bool> reserved_ssrcs_;
65};
66
pbos@webrtc.org74fa4892013-08-23 09:19:30 +000067class VideoAnalyzer : public PacketReceiver,
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000068 public newapi::Transport,
pbos@webrtc.org74fa4892013-08-23 09:19:30 +000069 public VideoRenderer,
70 public VideoSendStreamInput {
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000071 public:
pbos@webrtc.org74fa4892013-08-23 09:19:30 +000072 VideoAnalyzer(VideoSendStreamInput* input,
73 Transport* transport,
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000074 const char* test_label,
75 double avg_psnr_threshold,
76 double avg_ssim_threshold,
pbos@webrtc.org94015242013-10-16 11:05:37 +000077 int duration_frames)
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000078 : input_(input),
79 transport_(transport),
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000080 receiver_(NULL),
81 test_label_(test_label),
pbos@webrtc.org94015242013-10-16 11:05:37 +000082 dropped_frames_(0),
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000083 rtp_timestamp_delta_(0),
84 first_send_frame_(NULL),
85 last_render_time_(0),
86 avg_psnr_threshold_(avg_psnr_threshold),
87 avg_ssim_threshold_(avg_ssim_threshold),
88 frames_left_(duration_frames),
89 crit_(CriticalSectionWrapper::CreateCriticalSection()),
pbos@webrtc.org94015242013-10-16 11:05:37 +000090 comparison_lock_(CriticalSectionWrapper::CreateCriticalSection()),
91 comparison_thread_(ThreadWrapper::CreateThread(&FrameComparisonThread,
92 this)),
93 trigger_(EventWrapper::Create()) {
94 unsigned int id;
95 EXPECT_TRUE(comparison_thread_->Start(id));
96 }
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000097
98 ~VideoAnalyzer() {
pbos@webrtc.org94015242013-10-16 11:05:37 +000099 EXPECT_TRUE(comparison_thread_->Stop());
100
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000101 while (!frames_.empty()) {
102 delete frames_.back();
103 frames_.pop_back();
104 }
105 while (!frame_pool_.empty()) {
106 delete frame_pool_.back();
107 frame_pool_.pop_back();
108 }
109 }
110
pbos@webrtc.org94015242013-10-16 11:05:37 +0000111 virtual void SetReceiver(PacketReceiver* receiver) { receiver_ = receiver; }
112
pbos@webrtc.org40523702013-08-05 12:49:22 +0000113 virtual bool DeliverPacket(const uint8_t* packet, size_t length) OVERRIDE {
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000114 scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
115 RTPHeader header;
pbos@webrtc.org40523702013-08-05 12:49:22 +0000116 parser->Parse(packet, static_cast<int>(length), &header);
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000117 {
118 CriticalSectionScoped cs(crit_.get());
119 recv_times_[header.timestamp - rtp_timestamp_delta_] =
120 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds();
121 }
122
123 return receiver_->DeliverPacket(packet, length);
124 }
125
pbos@webrtc.org724947b2013-12-11 16:26:16 +0000126 virtual void PutFrame(const I420VideoFrame& video_frame) OVERRIDE {
127 ADD_FAILURE() << "PutFrame() should not have been called in this test.";
128 }
129
130 virtual void SwapFrame(I420VideoFrame* video_frame) OVERRIDE {
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000131 I420VideoFrame* copy = NULL;
132 {
133 CriticalSectionScoped cs(crit_.get());
134 if (frame_pool_.size() > 0) {
135 copy = frame_pool_.front();
136 frame_pool_.pop_front();
137 }
138 }
139 if (copy == NULL)
140 copy = new I420VideoFrame();
141
pbos@webrtc.org724947b2013-12-11 16:26:16 +0000142 copy->CopyFrame(*video_frame);
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000143 copy->set_timestamp(copy->render_time_ms() * 90);
144
145 {
146 CriticalSectionScoped cs(crit_.get());
147 if (first_send_frame_ == NULL && rtp_timestamp_delta_ == 0)
148 first_send_frame_ = copy;
149
150 frames_.push_back(copy);
151 }
152
pbos@webrtc.org724947b2013-12-11 16:26:16 +0000153 input_->SwapFrame(video_frame);
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000154 }
155
pbos@webrtc.org27326b62013-11-20 12:17:04 +0000156 virtual bool SendRtp(const uint8_t* packet, size_t length) OVERRIDE {
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000157 scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
158 RTPHeader header;
159 parser->Parse(packet, static_cast<int>(length), &header);
160
161 {
162 CriticalSectionScoped cs(crit_.get());
163 if (rtp_timestamp_delta_ == 0) {
164 rtp_timestamp_delta_ =
165 header.timestamp - first_send_frame_->timestamp();
166 first_send_frame_ = NULL;
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000167 }
pbos@webrtc.org7fb9ce02013-08-05 09:29:50 +0000168 send_times_[header.timestamp - rtp_timestamp_delta_] =
169 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds();
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000170 }
171
pbos@webrtc.org27326b62013-11-20 12:17:04 +0000172 return transport_->SendRtp(packet, length);
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000173 }
174
pbos@webrtc.org27326b62013-11-20 12:17:04 +0000175 virtual bool SendRtcp(const uint8_t* packet, size_t length) OVERRIDE {
176 return transport_->SendRtcp(packet, length);
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000177 }
178
179 virtual void RenderFrame(const I420VideoFrame& video_frame,
180 int time_to_render_ms) OVERRIDE {
pbos@webrtc.org94015242013-10-16 11:05:37 +0000181 int64_t render_time_ms =
182 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds();
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000183 uint32_t send_timestamp = video_frame.timestamp() - rtp_timestamp_delta_;
184
185 {
186 CriticalSectionScoped cs(crit_.get());
187 while (frames_.front()->timestamp() < send_timestamp) {
pbos@webrtc.org94015242013-10-16 11:05:37 +0000188 AddFrameComparison(
189 frames_.front(), &last_rendered_frame_, true, render_time_ms);
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000190 frame_pool_.push_back(frames_.front());
191 frames_.pop_front();
192 }
193
194 I420VideoFrame* reference_frame = frames_.front();
195 frames_.pop_front();
196 assert(reference_frame != NULL);
pbos@webrtc.org94015242013-10-16 11:05:37 +0000197 EXPECT_EQ(reference_frame->timestamp(), send_timestamp);
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000198 assert(reference_frame->timestamp() == send_timestamp);
199
pbos@webrtc.org94015242013-10-16 11:05:37 +0000200 AddFrameComparison(reference_frame, &video_frame, false, render_time_ms);
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000201 frame_pool_.push_back(reference_frame);
pbos@webrtc.org94015242013-10-16 11:05:37 +0000202 }
203
204 last_rendered_frame_.CopyFrame(video_frame);
205 }
206
207 void Wait() { trigger_->Wait(120 * 1000); }
208
209 VideoSendStreamInput* input_;
210 Transport* transport_;
211 PacketReceiver* receiver_;
212
213 private:
214 struct FrameComparison {
215 FrameComparison(const I420VideoFrame* reference,
216 const I420VideoFrame* render,
217 bool dropped,
218 int64_t send_time_ms,
219 int64_t recv_time_ms,
220 int64_t render_time_ms)
221 : dropped(dropped),
222 send_time_ms(send_time_ms),
223 recv_time_ms(recv_time_ms),
224 render_time_ms(render_time_ms) {
225 this->reference.CopyFrame(*reference);
226 this->render.CopyFrame(*render);
227 }
228
229 FrameComparison(const FrameComparison& compare)
230 : dropped(compare.dropped),
231 send_time_ms(compare.send_time_ms),
232 recv_time_ms(compare.recv_time_ms),
233 render_time_ms(compare.render_time_ms) {
234 this->reference.CopyFrame(compare.reference);
235 this->render.CopyFrame(compare.render);
236 }
237
238 ~FrameComparison() {}
239
240 I420VideoFrame reference;
241 I420VideoFrame render;
242 bool dropped;
243 int64_t send_time_ms;
244 int64_t recv_time_ms;
245 int64_t render_time_ms;
246 };
247
248 void AddFrameComparison(const I420VideoFrame* reference,
249 const I420VideoFrame* render,
250 bool dropped,
251 int64_t render_time_ms) {
252 int64_t send_time_ms = send_times_[reference->timestamp()];
253 send_times_.erase(reference->timestamp());
254 int64_t recv_time_ms = recv_times_[reference->timestamp()];
255 recv_times_.erase(reference->timestamp());
256
257 CriticalSectionScoped crit(comparison_lock_.get());
258 comparisons_.push_back(FrameComparison(reference,
259 render,
260 dropped,
261 send_time_ms,
262 recv_time_ms,
263 render_time_ms));
264 }
265
266 static bool FrameComparisonThread(void* obj) {
267 return static_cast<VideoAnalyzer*>(obj)->CompareFrames();
268 }
269
270 bool CompareFrames() {
271 assert(frames_left_ > 0);
272
273 I420VideoFrame reference;
274 I420VideoFrame render;
275 bool dropped;
276 int64_t send_time_ms;
277 int64_t recv_time_ms;
278 int64_t render_time_ms;
279
280 SleepMs(10);
281
282 while (true) {
283 {
284 CriticalSectionScoped crit(comparison_lock_.get());
285 if (comparisons_.empty())
286 return true;
287 reference.SwapFrame(&comparisons_.front().reference);
288 render.SwapFrame(&comparisons_.front().render);
289 dropped = comparisons_.front().dropped;
290 send_time_ms = comparisons_.front().send_time_ms;
291 recv_time_ms = comparisons_.front().recv_time_ms;
292 render_time_ms = comparisons_.front().render_time_ms;
293 comparisons_.pop_front();
294 }
295
296 PerformFrameComparison(&reference,
297 &render,
298 dropped,
299 send_time_ms,
300 recv_time_ms,
301 render_time_ms);
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000302
303 if (--frames_left_ == 0) {
304 PrintResult("psnr", psnr_, " dB");
305 PrintResult("ssim", ssim_, "");
306 PrintResult("sender_time", sender_time_, " ms");
pbos@webrtc.org94015242013-10-16 11:05:37 +0000307 printf(
308 "RESULT dropped_frames: %s = %d\n", test_label_, dropped_frames_);
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000309 PrintResult("receiver_time", receiver_time_, " ms");
310 PrintResult("total_delay_incl_network", end_to_end_, " ms");
311 PrintResult("time_between_rendered_frames", rendered_delta_, " ms");
312 EXPECT_GT(psnr_.Mean(), avg_psnr_threshold_);
313 EXPECT_GT(ssim_.Mean(), avg_ssim_threshold_);
314 trigger_->Set();
pbos@webrtc.org94015242013-10-16 11:05:37 +0000315
316 return false;
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000317 }
318 }
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000319 }
320
pbos@webrtc.org94015242013-10-16 11:05:37 +0000321 void PerformFrameComparison(const I420VideoFrame* reference,
322 const I420VideoFrame* render,
323 bool dropped,
324 int64_t send_time_ms,
325 int64_t recv_time_ms,
326 int64_t render_time_ms) {
327 psnr_.AddSample(I420PSNR(reference, render));
328 ssim_.AddSample(I420SSIM(reference, render));
329 if (dropped) {
330 ++dropped_frames_;
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000331 return;
pbos@webrtc.org94015242013-10-16 11:05:37 +0000332 }
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000333 if (last_render_time_ != 0)
pbos@webrtc.org94015242013-10-16 11:05:37 +0000334 rendered_delta_.AddSample(render_time_ms - last_render_time_);
335 last_render_time_ = render_time_ms;
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000336
pbos@webrtc.org94015242013-10-16 11:05:37 +0000337 int64_t input_time_ms = reference->render_time_ms();
338 sender_time_.AddSample(send_time_ms - input_time_ms);
339 receiver_time_.AddSample(render_time_ms - recv_time_ms);
340 end_to_end_.AddSample(render_time_ms - input_time_ms);
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000341 }
342
343 void PrintResult(const char* result_type,
344 test::Statistics stats,
345 const char* unit) {
346 printf("RESULT %s: %s = {%f, %f}%s\n",
347 result_type,
348 test_label_,
349 stats.Mean(),
350 stats.StandardDeviation(),
351 unit);
352 }
353
354 const char* test_label_;
355 test::Statistics sender_time_;
356 test::Statistics receiver_time_;
357 test::Statistics psnr_;
358 test::Statistics ssim_;
359 test::Statistics end_to_end_;
360 test::Statistics rendered_delta_;
361
pbos@webrtc.org94015242013-10-16 11:05:37 +0000362 int dropped_frames_;
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000363 std::deque<I420VideoFrame*> frames_;
364 std::deque<I420VideoFrame*> frame_pool_;
365 I420VideoFrame last_rendered_frame_;
366 std::map<uint32_t, int64_t> send_times_;
367 std::map<uint32_t, int64_t> recv_times_;
368 uint32_t rtp_timestamp_delta_;
369 I420VideoFrame* first_send_frame_;
370 int64_t last_render_time_;
371 double avg_psnr_threshold_;
372 double avg_ssim_threshold_;
pbos@webrtc.org94015242013-10-16 11:05:37 +0000373 int frames_left_;
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000374 scoped_ptr<CriticalSectionWrapper> crit_;
pbos@webrtc.org94015242013-10-16 11:05:37 +0000375 scoped_ptr<CriticalSectionWrapper> comparison_lock_;
376 scoped_ptr<ThreadWrapper> comparison_thread_;
377 std::deque<FrameComparison> comparisons_;
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000378 scoped_ptr<EventWrapper> trigger_;
379};
380
pbos@webrtc.org94015242013-10-16 11:05:37 +0000381TEST_P(FullStackTest, NoPacketLoss) {
pbos@webrtc.orgb613b5a2013-12-03 10:13:04 +0000382 static const uint32_t kReceiverLocalSsrc = 0x123456;
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000383 FullStackTestParams params = GetParam();
384
pbos@webrtc.org96684672013-08-12 12:59:04 +0000385 test::DirectTransport transport;
pbos@webrtc.org94015242013-10-16 11:05:37 +0000386 VideoAnalyzer analyzer(NULL,
387 &transport,
388 params.test_label,
389 params.avg_psnr_threshold,
390 params.avg_ssim_threshold,
391 FLAGS_seconds * params.clip.fps);
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000392
pbos@webrtc.org841c8a42013-09-09 15:04:25 +0000393 Call::Config call_config(&analyzer);
mflodman@webrtc.org6879c8a2013-07-23 11:35:00 +0000394
pbos@webrtc.org841c8a42013-09-09 15:04:25 +0000395 scoped_ptr<Call> call(Call::Create(call_config));
pbos@webrtc.org94015242013-10-16 11:05:37 +0000396 analyzer.SetReceiver(call->Receiver());
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000397 transport.SetReceiver(&analyzer);
398
pbos@webrtc.org74fa4892013-08-23 09:19:30 +0000399 VideoSendStream::Config send_config = call->GetDefaultSendConfig();
pbos@webrtc.orgb613b5a2013-12-03 10:13:04 +0000400 send_config.rtp.ssrcs.push_back(kSendSsrc);
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000401
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000402 // TODO(pbos): static_cast shouldn't be required after mflodman refactors the
403 // VideoCodec struct.
404 send_config.codec.width = static_cast<uint16_t>(params.clip.width);
405 send_config.codec.height = static_cast<uint16_t>(params.clip.height);
406 send_config.codec.minBitrate = params.bitrate;
407 send_config.codec.startBitrate = params.bitrate;
408 send_config.codec.maxBitrate = params.bitrate;
409
pbos@webrtc.org5a636552013-11-20 10:40:25 +0000410 VideoSendStream* send_stream = call->CreateVideoSendStream(send_config);
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000411 analyzer.input_ = send_stream->Input();
412
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000413 scoped_ptr<test::FrameGeneratorCapturer> file_capturer(
andresp@webrtc.orgab654952013-09-19 12:14:03 +0000414 test::FrameGeneratorCapturer::CreateFromYuvFile(
pbos@webrtc.org4c966012013-08-21 12:07:37 +0000415 &analyzer,
andresp@webrtc.orgab654952013-09-19 12:14:03 +0000416 test::ResourcePath(params.clip.name, "yuv").c_str(),
417 params.clip.width,
418 params.clip.height,
419 params.clip.fps,
420 Clock::GetRealTimeClock()));
pbos@webrtc.org94015242013-10-16 11:05:37 +0000421 ASSERT_TRUE(file_capturer.get() != NULL)
422 << "Could not create capturer for " << params.clip.name
423 << ".yuv. Is this resource file present?";
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000424
pbos@webrtc.org841c8a42013-09-09 15:04:25 +0000425 VideoReceiveStream::Config receive_config = call->GetDefaultReceiveConfig();
pbos@webrtc.orgb613b5a2013-12-03 10:13:04 +0000426 receive_config.rtp.remote_ssrc = send_config.rtp.ssrcs[0];
427 receive_config.rtp.local_ssrc = kReceiverLocalSsrc;
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000428 receive_config.renderer = &analyzer;
429
pbos@webrtc.org74fa4892013-08-23 09:19:30 +0000430 VideoReceiveStream* receive_stream =
pbos@webrtc.org5a636552013-11-20 10:40:25 +0000431 call->CreateVideoReceiveStream(receive_config);
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000432
pbos@webrtc.org53c85732013-11-20 11:36:47 +0000433 receive_stream->StartReceiving();
434 send_stream->StartSending();
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000435
436 file_capturer->Start();
437
438 analyzer.Wait();
439
440 file_capturer->Stop();
pbos@webrtc.org53c85732013-11-20 11:36:47 +0000441 send_stream->StopSending();
442 receive_stream->StopReceiving();
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000443
pbos@webrtc.org2c46f8d2013-11-21 13:49:43 +0000444 call->DestroyVideoReceiveStream(receive_stream);
445 call->DestroyVideoSendStream(send_stream);
pbos@webrtc.org96684672013-08-12 12:59:04 +0000446
447 transport.StopSending();
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000448}
449
450INSTANTIATE_TEST_CASE_P(FullStack,
451 FullStackTest,
452 ::testing::Values(paris_qcif, foreman_cif));
453
454} // namespace webrtc