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> |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 static const uint32_t kMaxComparisonThreads = 8; | 84 static const uint32_t kMaxComparisonThreads = 8; |
85 | 85 |
86 if (num_cores <= kMinCoresLeft) { | 86 if (num_cores <= kMinCoresLeft) { |
87 num_cores = 1; | 87 num_cores = 1; |
88 } else { | 88 } else { |
89 num_cores -= kMinCoresLeft; | 89 num_cores -= kMinCoresLeft; |
90 num_cores = std::min(num_cores, kMaxComparisonThreads); | 90 num_cores = std::min(num_cores, kMaxComparisonThreads); |
91 } | 91 } |
92 | 92 |
93 for (uint32_t i = 0; i < num_cores; ++i) { | 93 for (uint32_t i = 0; i < num_cores; ++i) { |
94 rtc::scoped_ptr<ThreadWrapper> thread = | 94 rtc::scoped_ptr<PlatformThread> thread = PlatformThread::CreateThread( |
95 ThreadWrapper::CreateThread(&FrameComparisonThread, this, "Analyzer"); | 95 &FrameComparisonThread, this, "Analyzer"); |
96 EXPECT_TRUE(thread->Start()); | 96 EXPECT_TRUE(thread->Start()); |
97 comparison_thread_pool_.push_back(thread.release()); | 97 comparison_thread_pool_.push_back(thread.release()); |
98 } | 98 } |
99 | 99 |
100 stats_polling_thread_ = | 100 stats_polling_thread_ = |
101 ThreadWrapper::CreateThread(&PollStatsThread, this, "StatsPoller"); | 101 PlatformThread::CreateThread(&PollStatsThread, this, "StatsPoller"); |
102 } | 102 } |
103 | 103 |
104 ~VideoAnalyzer() { | 104 ~VideoAnalyzer() { |
105 for (ThreadWrapper* thread : comparison_thread_pool_) { | 105 for (PlatformThread* thread : comparison_thread_pool_) { |
106 EXPECT_TRUE(thread->Stop()); | 106 EXPECT_TRUE(thread->Stop()); |
107 delete thread; | 107 delete thread; |
108 } | 108 } |
109 } | 109 } |
110 | 110 |
111 virtual void SetReceiver(PacketReceiver* receiver) { receiver_ = receiver; } | 111 virtual void SetReceiver(PacketReceiver* receiver) { receiver_ = receiver; } |
112 | 112 |
113 DeliveryStatus DeliverPacket(MediaType media_type, | 113 DeliveryStatus DeliverPacket(MediaType media_type, |
114 const uint8_t* packet, | 114 const uint8_t* packet, |
115 size_t length, | 115 size_t length, |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 std::deque<VideoFrame> frames_ GUARDED_BY(crit_); | 595 std::deque<VideoFrame> frames_ GUARDED_BY(crit_); |
596 VideoFrame last_rendered_frame_ GUARDED_BY(crit_); | 596 VideoFrame last_rendered_frame_ GUARDED_BY(crit_); |
597 std::map<uint32_t, int64_t> send_times_ GUARDED_BY(crit_); | 597 std::map<uint32_t, int64_t> send_times_ GUARDED_BY(crit_); |
598 std::map<uint32_t, int64_t> recv_times_ GUARDED_BY(crit_); | 598 std::map<uint32_t, int64_t> recv_times_ GUARDED_BY(crit_); |
599 std::map<uint32_t, size_t> encoded_frame_sizes_ GUARDED_BY(crit_); | 599 std::map<uint32_t, size_t> encoded_frame_sizes_ GUARDED_BY(crit_); |
600 VideoFrame first_send_frame_ GUARDED_BY(crit_); | 600 VideoFrame first_send_frame_ GUARDED_BY(crit_); |
601 const double avg_psnr_threshold_; | 601 const double avg_psnr_threshold_; |
602 const double avg_ssim_threshold_; | 602 const double avg_ssim_threshold_; |
603 | 603 |
604 rtc::CriticalSection comparison_lock_; | 604 rtc::CriticalSection comparison_lock_; |
605 std::vector<ThreadWrapper*> comparison_thread_pool_; | 605 std::vector<PlatformThread*> comparison_thread_pool_; |
606 rtc::scoped_ptr<ThreadWrapper> stats_polling_thread_; | 606 rtc::scoped_ptr<PlatformThread> stats_polling_thread_; |
607 const rtc::scoped_ptr<EventWrapper> comparison_available_event_; | 607 const rtc::scoped_ptr<EventWrapper> comparison_available_event_; |
608 std::deque<FrameComparison> comparisons_ GUARDED_BY(comparison_lock_); | 608 std::deque<FrameComparison> comparisons_ GUARDED_BY(comparison_lock_); |
609 const rtc::scoped_ptr<EventWrapper> done_; | 609 const rtc::scoped_ptr<EventWrapper> done_; |
610 }; | 610 }; |
611 | 611 |
612 VideoQualityTest::VideoQualityTest() : clock_(Clock::GetRealTimeClock()) {} | 612 VideoQualityTest::VideoQualityTest() : clock_(Clock::GetRealTimeClock()) {} |
613 | 613 |
614 void VideoQualityTest::TestBody() {} | 614 void VideoQualityTest::TestBody() {} |
615 | 615 |
616 std::string VideoQualityTest::GenerateGraphTitle() const { | 616 std::string VideoQualityTest::GenerateGraphTitle() const { |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 send_stream_->Stop(); | 1065 send_stream_->Stop(); |
1066 receive_stream->Stop(); | 1066 receive_stream->Stop(); |
1067 | 1067 |
1068 call->DestroyVideoReceiveStream(receive_stream); | 1068 call->DestroyVideoReceiveStream(receive_stream); |
1069 call->DestroyVideoSendStream(send_stream_); | 1069 call->DestroyVideoSendStream(send_stream_); |
1070 | 1070 |
1071 transport.StopSending(); | 1071 transport.StopSending(); |
1072 } | 1072 } |
1073 | 1073 |
1074 } // namespace webrtc | 1074 } // namespace webrtc |
OLD | NEW |