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

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

Issue 1751903002: Replace scoped_ptr with unique_ptr in webrtc/video/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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/video/video_quality_test.h ('k') | webrtc/video/video_receive_stream.h » ('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) 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 #include <stdio.h> 10 #include <stdio.h>
11 11
12 #include <algorithm> 12 #include <algorithm>
13 #include <deque> 13 #include <deque>
14 #include <map> 14 #include <map>
15 #include <sstream> 15 #include <sstream>
16 #include <string> 16 #include <string>
17 #include <vector> 17 #include <vector>
18 18
19 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
20 20
21 #include "webrtc/base/checks.h" 21 #include "webrtc/base/checks.h"
22 #include "webrtc/base/event.h" 22 #include "webrtc/base/event.h"
23 #include "webrtc/base/format_macros.h" 23 #include "webrtc/base/format_macros.h"
24 #include "webrtc/base/scoped_ptr.h"
25 #include "webrtc/base/timeutils.h" 24 #include "webrtc/base/timeutils.h"
26 #include "webrtc/call.h" 25 #include "webrtc/call.h"
27 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" 26 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
28 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" 27 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
29 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" 28 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
30 #include "webrtc/system_wrappers/include/cpu_info.h" 29 #include "webrtc/system_wrappers/include/cpu_info.h"
31 #include "webrtc/test/layer_filtering_transport.h" 30 #include "webrtc/test/layer_filtering_transport.h"
32 #include "webrtc/test/run_loop.h" 31 #include "webrtc/test/run_loop.h"
33 #include "webrtc/test/statistics.h" 32 #include "webrtc/test/statistics.h"
34 #include "webrtc/test/testsupport/fileutils.h" 33 #include "webrtc/test/testsupport/fileutils.h"
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 DestroyStreams(); 1031 DestroyStreams();
1033 1032
1034 if (graph_data_output_file) 1033 if (graph_data_output_file)
1035 fclose(graph_data_output_file); 1034 fclose(graph_data_output_file);
1036 } 1035 }
1037 1036
1038 void VideoQualityTest::RunWithVideoRenderer(const Params& params) { 1037 void VideoQualityTest::RunWithVideoRenderer(const Params& params) {
1039 params_ = params; 1038 params_ = params;
1040 CheckParams(); 1039 CheckParams();
1041 1040
1042 rtc::scoped_ptr<test::VideoRenderer> local_preview( 1041 std::unique_ptr<test::VideoRenderer> local_preview(
1043 test::VideoRenderer::Create("Local Preview", params_.common.width, 1042 test::VideoRenderer::Create("Local Preview", params_.common.width,
1044 params_.common.height)); 1043 params_.common.height));
1045 size_t stream_id = params_.ss.selected_stream; 1044 size_t stream_id = params_.ss.selected_stream;
1046 std::string title = "Loopback Video"; 1045 std::string title = "Loopback Video";
1047 if (params_.ss.streams.size() > 1) { 1046 if (params_.ss.streams.size() > 1) {
1048 std::ostringstream s; 1047 std::ostringstream s;
1049 s << stream_id; 1048 s << stream_id;
1050 title += " - Stream #" + s.str(); 1049 title += " - Stream #" + s.str();
1051 } 1050 }
1052 1051
1053 rtc::scoped_ptr<test::VideoRenderer> loopback_video( 1052 std::unique_ptr<test::VideoRenderer> loopback_video(
1054 test::VideoRenderer::Create(title.c_str(), 1053 test::VideoRenderer::Create(title.c_str(),
1055 params_.ss.streams[stream_id].width, 1054 params_.ss.streams[stream_id].width,
1056 params_.ss.streams[stream_id].height)); 1055 params_.ss.streams[stream_id].height));
1057 1056
1058 // TODO(ivica): Remove bitrate_config and use the default Call::Config(), to 1057 // TODO(ivica): Remove bitrate_config and use the default Call::Config(), to
1059 // match the full stack tests. 1058 // match the full stack tests.
1060 Call::Config call_config; 1059 Call::Config call_config;
1061 call_config.bitrate_config = params_.common.call_bitrate_config; 1060 call_config.bitrate_config = params_.common.call_bitrate_config;
1062 rtc::scoped_ptr<Call> call(Call::Create(call_config)); 1061 std::unique_ptr<Call> call(Call::Create(call_config));
1063 1062
1064 test::LayerFilteringTransport transport( 1063 test::LayerFilteringTransport transport(
1065 params.pipe, call.get(), kPayloadTypeVP8, kPayloadTypeVP9, 1064 params.pipe, call.get(), kPayloadTypeVP8, kPayloadTypeVP9,
1066 params.common.selected_tl, params_.ss.selected_sl); 1065 params.common.selected_tl, params_.ss.selected_sl);
1067 // TODO(ivica): Use two calls to be able to merge with RunWithAnalyzer or at 1066 // TODO(ivica): Use two calls to be able to merge with RunWithAnalyzer or at
1068 // least share as much code as possible. That way this test would also match 1067 // least share as much code as possible. That way this test would also match
1069 // the full stack tests better. 1068 // the full stack tests better.
1070 transport.SetReceiver(call->Receiver()); 1069 transport.SetReceiver(call->Receiver());
1071 1070
1072 SetupCommon(&transport, &transport); 1071 SetupCommon(&transport, &transport);
(...skipping 20 matching lines...) Expand all
1093 video_send_stream_->Stop(); 1092 video_send_stream_->Stop();
1094 receive_stream->Stop(); 1093 receive_stream->Stop();
1095 1094
1096 call->DestroyVideoReceiveStream(receive_stream); 1095 call->DestroyVideoReceiveStream(receive_stream);
1097 call->DestroyVideoSendStream(video_send_stream_); 1096 call->DestroyVideoSendStream(video_send_stream_);
1098 1097
1099 transport.StopSending(); 1098 transport.StopSending();
1100 } 1099 }
1101 1100
1102 } // namespace webrtc 1101 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/video_quality_test.h ('k') | webrtc/video/video_receive_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698