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

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

Issue 2964953002: Remove webrtc::VideoEncoderFactory (Closed)
Patch Set: Add dep to base:sequenced_task_checker Created 3 years, 5 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') | no next file » | 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 "webrtc/video/video_quality_test.h" 10 #include "webrtc/video/video_quality_test.h"
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 bool is_quick_test_enabled_; 1054 bool is_quick_test_enabled_;
1055 1055
1056 rtc::CriticalSection comparison_lock_; 1056 rtc::CriticalSection comparison_lock_;
1057 std::vector<rtc::PlatformThread*> comparison_thread_pool_; 1057 std::vector<rtc::PlatformThread*> comparison_thread_pool_;
1058 rtc::PlatformThread stats_polling_thread_; 1058 rtc::PlatformThread stats_polling_thread_;
1059 rtc::Event comparison_available_event_; 1059 rtc::Event comparison_available_event_;
1060 std::deque<FrameComparison> comparisons_ GUARDED_BY(comparison_lock_); 1060 std::deque<FrameComparison> comparisons_ GUARDED_BY(comparison_lock_);
1061 rtc::Event done_; 1061 rtc::Event done_;
1062 }; 1062 };
1063 1063
1064 class Vp8EncoderFactory : public VideoEncoderFactory { 1064 class Vp8EncoderFactory : public cricket::WebRtcVideoEncoderFactory {
1065 public: 1065 public:
1066 Vp8EncoderFactory() = default; 1066 Vp8EncoderFactory() {
1067 supported_codecs_.push_back(cricket::VideoCodec("VP8"));
1068 }
1067 ~Vp8EncoderFactory() override { RTC_CHECK(live_encoders_.empty()); } 1069 ~Vp8EncoderFactory() override { RTC_CHECK(live_encoders_.empty()); }
1068 1070
1069 VideoEncoder* Create() override { 1071 const std::vector<cricket::VideoCodec>& supported_codecs() const override {
1072 return supported_codecs_;
1073 }
1074
1075 VideoEncoder* CreateVideoEncoder(const cricket::VideoCodec& codec) override {
1070 VideoEncoder* encoder = VP8Encoder::Create(); 1076 VideoEncoder* encoder = VP8Encoder::Create();
1071 live_encoders_.insert(encoder); 1077 live_encoders_.insert(encoder);
1072 return encoder; 1078 return encoder;
1073 } 1079 }
1074 1080
1075 void Destroy(VideoEncoder* encoder) override { 1081 void DestroyVideoEncoder(VideoEncoder* encoder) override {
1076 auto it = live_encoders_.find(encoder); 1082 auto it = live_encoders_.find(encoder);
1077 RTC_CHECK(it != live_encoders_.end()); 1083 RTC_CHECK(it != live_encoders_.end());
1078 live_encoders_.erase(it); 1084 live_encoders_.erase(it);
1079 delete encoder; 1085 delete encoder;
1080 } 1086 }
1081 1087
1088 private:
1089 std::vector<cricket::VideoCodec> supported_codecs_;
1082 std::set<VideoEncoder*> live_encoders_; 1090 std::set<VideoEncoder*> live_encoders_;
1083 }; 1091 };
1084 1092
1085 VideoQualityTest::VideoQualityTest() 1093 VideoQualityTest::VideoQualityTest()
1086 : clock_(Clock::GetRealTimeClock()), receive_logs_(0), send_logs_(0) { 1094 : clock_(Clock::GetRealTimeClock()), receive_logs_(0), send_logs_(0) {
1087 payload_type_map_ = test::CallTest::payload_type_map_; 1095 payload_type_map_ = test::CallTest::payload_type_map_;
1088 RTC_DCHECK(payload_type_map_.find(kPayloadTypeH264) == 1096 RTC_DCHECK(payload_type_map_.find(kPayloadTypeH264) ==
1089 payload_type_map_.end()); 1097 payload_type_map_.end());
1090 RTC_DCHECK(payload_type_map_.find(kPayloadTypeVP8) == 1098 RTC_DCHECK(payload_type_map_.find(kPayloadTypeVP8) ==
1091 payload_type_map_.end()); 1099 payload_type_map_.end());
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
2044 if (!params_.video.encoded_frame_base_path.empty()) { 2052 if (!params_.video.encoded_frame_base_path.empty()) {
2045 std::ostringstream str; 2053 std::ostringstream str;
2046 str << receive_logs_++; 2054 str << receive_logs_++;
2047 std::string path = 2055 std::string path =
2048 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; 2056 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf";
2049 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), 2057 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path),
2050 10000000); 2058 10000000);
2051 } 2059 }
2052 } 2060 }
2053 } // namespace webrtc 2061 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/video_quality_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698