OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 #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 <vector> | 17 #include <vector> |
17 | 18 |
18 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
19 | 20 |
20 #include "webrtc/base/checks.h" | 21 #include "webrtc/base/checks.h" |
21 #include "webrtc/base/format_macros.h" | 22 #include "webrtc/base/format_macros.h" |
22 #include "webrtc/base/scoped_ptr.h" | 23 #include "webrtc/base/scoped_ptr.h" |
23 #include "webrtc/call.h" | 24 #include "webrtc/call.h" |
24 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 25 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
25 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 26 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 num_cores -= kMinCoresLeft; | 91 num_cores -= kMinCoresLeft; |
91 num_cores = std::min(num_cores, kMaxComparisonThreads); | 92 num_cores = std::min(num_cores, kMaxComparisonThreads); |
92 } | 93 } |
93 | 94 |
94 for (uint32_t i = 0; i < num_cores; ++i) { | 95 for (uint32_t i = 0; i < num_cores; ++i) { |
95 rtc::PlatformThread* thread = | 96 rtc::PlatformThread* thread = |
96 new rtc::PlatformThread(&FrameComparisonThread, this, "Analyzer"); | 97 new rtc::PlatformThread(&FrameComparisonThread, this, "Analyzer"); |
97 thread->Start(); | 98 thread->Start(); |
98 comparison_thread_pool_.push_back(thread); | 99 comparison_thread_pool_.push_back(thread); |
99 } | 100 } |
100 | |
101 } | 101 } |
102 | 102 |
103 ~VideoAnalyzer() { | 103 ~VideoAnalyzer() { |
104 for (rtc::PlatformThread* thread : comparison_thread_pool_) { | 104 for (rtc::PlatformThread* thread : comparison_thread_pool_) { |
105 thread->Stop(); | 105 thread->Stop(); |
106 delete thread; | 106 delete thread; |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 virtual void SetReceiver(PacketReceiver* receiver) { receiver_ = receiver; } | 110 virtual void SetReceiver(PacketReceiver* receiver) { receiver_ = receiver; } |
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1010 } | 1010 } |
1011 | 1011 |
1012 void VideoQualityTest::RunWithVideoRenderer(const Params& params) { | 1012 void VideoQualityTest::RunWithVideoRenderer(const Params& params) { |
1013 params_ = params; | 1013 params_ = params; |
1014 CheckParams(); | 1014 CheckParams(); |
1015 | 1015 |
1016 rtc::scoped_ptr<test::VideoRenderer> local_preview( | 1016 rtc::scoped_ptr<test::VideoRenderer> local_preview( |
1017 test::VideoRenderer::Create("Local Preview", params_.common.width, | 1017 test::VideoRenderer::Create("Local Preview", params_.common.width, |
1018 params_.common.height)); | 1018 params_.common.height)); |
1019 size_t stream_id = params_.ss.selected_stream; | 1019 size_t stream_id = params_.ss.selected_stream; |
1020 char title[32]; | 1020 std::string title = "Loopback Video"; |
1021 if (params_.ss.streams.size() == 1) { | 1021 if (params_.ss.streams.size() > 1) |
1022 sprintf(title, "Loopback Video"); | 1022 title += " - Stream #" + std::to_string(stream_id); |
pbos-webrtc
2015/12/09 11:21:49
library feature, use an ostringstream
mflodman
2015/12/09 13:49:36
Done.
| |
1023 } else { | 1023 |
1024 sprintf(title, "Loopback Video - Stream #%" PRIuS, stream_id); | |
1025 } | |
1026 rtc::scoped_ptr<test::VideoRenderer> loopback_video( | 1024 rtc::scoped_ptr<test::VideoRenderer> loopback_video( |
1027 test::VideoRenderer::Create(title, params_.ss.streams[stream_id].width, | 1025 test::VideoRenderer::Create(title.c_str(), |
1026 params_.ss.streams[stream_id].width, | |
1028 params_.ss.streams[stream_id].height)); | 1027 params_.ss.streams[stream_id].height)); |
1029 | 1028 |
1030 // TODO(ivica): Remove bitrate_config and use the default Call::Config(), to | 1029 // TODO(ivica): Remove bitrate_config and use the default Call::Config(), to |
1031 // match the full stack tests. | 1030 // match the full stack tests. |
1032 Call::Config call_config; | 1031 Call::Config call_config; |
1033 call_config.bitrate_config = params_.common.call_bitrate_config; | 1032 call_config.bitrate_config = params_.common.call_bitrate_config; |
1034 rtc::scoped_ptr<Call> call(Call::Create(call_config)); | 1033 rtc::scoped_ptr<Call> call(Call::Create(call_config)); |
1035 | 1034 |
1036 test::LayerFilteringTransport transport( | 1035 test::LayerFilteringTransport transport( |
1037 params.pipe, call.get(), kPayloadTypeVP8, kPayloadTypeVP9, | 1036 params.pipe, call.get(), kPayloadTypeVP8, kPayloadTypeVP9, |
(...skipping 26 matching lines...) Expand all Loading... | |
1064 send_stream_->Stop(); | 1063 send_stream_->Stop(); |
1065 receive_stream->Stop(); | 1064 receive_stream->Stop(); |
1066 | 1065 |
1067 call->DestroyVideoReceiveStream(receive_stream); | 1066 call->DestroyVideoReceiveStream(receive_stream); |
1068 call->DestroyVideoSendStream(send_stream_); | 1067 call->DestroyVideoSendStream(send_stream_); |
1069 | 1068 |
1070 transport.StopSending(); | 1069 transport.StopSending(); |
1071 } | 1070 } |
1072 | 1071 |
1073 } // namespace webrtc | 1072 } // namespace webrtc |
OLD | NEW |