Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: webrtc/video/end_to_end_tests.cc

Issue 1839603002: Remove webrtc::ScopedVector (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/test/call_test.cc ('k') | webrtc/video/video_capture_input_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 #include <algorithm> 10 #include <algorithm>
11 #include <list> 11 #include <list>
12 #include <map> 12 #include <map>
13 #include <memory> 13 #include <memory>
14 #include <sstream> 14 #include <sstream>
15 #include <string> 15 #include <string>
16 #include <vector>
16 17
17 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
18 19
19 #include "webrtc/base/checks.h" 20 #include "webrtc/base/checks.h"
20 #include "webrtc/base/event.h" 21 #include "webrtc/base/event.h"
21 #include "webrtc/base/timeutils.h" 22 #include "webrtc/base/timeutils.h"
22 #include "webrtc/call.h" 23 #include "webrtc/call.h"
23 #include "webrtc/call/transport_adapter.h" 24 #include "webrtc/call/transport_adapter.h"
24 #include "webrtc/frame_callback.h" 25 #include "webrtc/frame_callback.h"
25 #include "webrtc/modules/include/module_common_types.h" 26 #include "webrtc/modules/include/module_common_types.h"
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1239 receiver_transport->SetReceiver(sender_call->Receiver()); 1240 receiver_transport->SetReceiver(sender_call->Receiver());
1240 1241
1241 std::unique_ptr<VideoEncoder> encoders[kNumStreams]; 1242 std::unique_ptr<VideoEncoder> encoders[kNumStreams];
1242 for (size_t i = 0; i < kNumStreams; ++i) 1243 for (size_t i = 0; i < kNumStreams; ++i)
1243 encoders[i].reset(VideoEncoder::Create(VideoEncoder::kVp8)); 1244 encoders[i].reset(VideoEncoder::Create(VideoEncoder::kVp8));
1244 1245
1245 VideoSendStream* send_streams[kNumStreams]; 1246 VideoSendStream* send_streams[kNumStreams];
1246 VideoReceiveStream* receive_streams[kNumStreams]; 1247 VideoReceiveStream* receive_streams[kNumStreams];
1247 1248
1248 test::FrameGeneratorCapturer* frame_generators[kNumStreams]; 1249 test::FrameGeneratorCapturer* frame_generators[kNumStreams];
1249 ScopedVector<VideoDecoder> allocated_decoders; 1250 std::vector<std::unique_ptr<VideoDecoder>> allocated_decoders;
1250 for (size_t i = 0; i < kNumStreams; ++i) { 1251 for (size_t i = 0; i < kNumStreams; ++i) {
1251 uint32_t ssrc = codec_settings[i].ssrc; 1252 uint32_t ssrc = codec_settings[i].ssrc;
1252 int width = codec_settings[i].width; 1253 int width = codec_settings[i].width;
1253 int height = codec_settings[i].height; 1254 int height = codec_settings[i].height;
1254 1255
1255 VideoSendStream::Config send_config(sender_transport.get()); 1256 VideoSendStream::Config send_config(sender_transport.get());
1256 send_config.rtp.ssrcs.push_back(ssrc); 1257 send_config.rtp.ssrcs.push_back(ssrc);
1257 send_config.encoder_settings.encoder = encoders[i].get(); 1258 send_config.encoder_settings.encoder = encoders[i].get();
1258 send_config.encoder_settings.payload_name = "VP8"; 1259 send_config.encoder_settings.payload_name = "VP8";
1259 send_config.encoder_settings.payload_type = 124; 1260 send_config.encoder_settings.payload_type = 124;
(...skipping 10 matching lines...) Expand all
1270 1271
1271 send_streams[i] = 1272 send_streams[i] =
1272 sender_call->CreateVideoSendStream(send_config, encoder_config); 1273 sender_call->CreateVideoSendStream(send_config, encoder_config);
1273 send_streams[i]->Start(); 1274 send_streams[i]->Start();
1274 1275
1275 VideoReceiveStream::Config receive_config(receiver_transport.get()); 1276 VideoReceiveStream::Config receive_config(receiver_transport.get());
1276 receive_config.rtp.remote_ssrc = ssrc; 1277 receive_config.rtp.remote_ssrc = ssrc;
1277 receive_config.rtp.local_ssrc = test::CallTest::kReceiverLocalVideoSsrc; 1278 receive_config.rtp.local_ssrc = test::CallTest::kReceiverLocalVideoSsrc;
1278 VideoReceiveStream::Decoder decoder = 1279 VideoReceiveStream::Decoder decoder =
1279 test::CreateMatchingDecoder(send_config.encoder_settings); 1280 test::CreateMatchingDecoder(send_config.encoder_settings);
1280 allocated_decoders.push_back(decoder.decoder); 1281 allocated_decoders.push_back(
1282 std::unique_ptr<VideoDecoder>(decoder.decoder));
1281 receive_config.decoders.push_back(decoder); 1283 receive_config.decoders.push_back(decoder);
1282 1284
1283 UpdateReceiveConfig(i, &receive_config); 1285 UpdateReceiveConfig(i, &receive_config);
1284 1286
1285 receive_streams[i] = 1287 receive_streams[i] =
1286 receiver_call->CreateVideoReceiveStream(receive_config); 1288 receiver_call->CreateVideoReceiveStream(receive_config);
1287 receive_streams[i]->Start(); 1289 receive_streams[i]->Start();
1288 1290
1289 frame_generators[i] = test::FrameGeneratorCapturer::Create( 1291 frame_generators[i] = test::FrameGeneratorCapturer::Create(
1290 send_streams[i]->Input(), width, height, 30, 1292 send_streams[i]->Input(), width, height, 30,
(...skipping 2315 matching lines...) Expand 10 before | Expand all | Expand 10 after
3606 private: 3608 private:
3607 bool video_observed_; 3609 bool video_observed_;
3608 bool audio_observed_; 3610 bool audio_observed_;
3609 SequenceNumberUnwrapper unwrapper_; 3611 SequenceNumberUnwrapper unwrapper_;
3610 std::set<int64_t> received_packet_ids_; 3612 std::set<int64_t> received_packet_ids_;
3611 } test; 3613 } test;
3612 3614
3613 RunBaseTest(&test); 3615 RunBaseTest(&test);
3614 } 3616 }
3615 } // namespace webrtc 3617 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/test/call_test.cc ('k') | webrtc/video/video_capture_input_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698