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

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

Issue 2964953002: Remove webrtc::VideoEncoderFactory (Closed)
Patch Set: 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
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 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 bool is_quick_test_enabled_; 1030 bool is_quick_test_enabled_;
1031 1031
1032 rtc::CriticalSection comparison_lock_; 1032 rtc::CriticalSection comparison_lock_;
1033 std::vector<rtc::PlatformThread*> comparison_thread_pool_; 1033 std::vector<rtc::PlatformThread*> comparison_thread_pool_;
1034 rtc::PlatformThread stats_polling_thread_; 1034 rtc::PlatformThread stats_polling_thread_;
1035 rtc::Event comparison_available_event_; 1035 rtc::Event comparison_available_event_;
1036 std::deque<FrameComparison> comparisons_ GUARDED_BY(comparison_lock_); 1036 std::deque<FrameComparison> comparisons_ GUARDED_BY(comparison_lock_);
1037 rtc::Event done_; 1037 rtc::Event done_;
1038 }; 1038 };
1039 1039
1040 class Vp8EncoderFactory : public VideoEncoderFactory { 1040 class Vp8EncoderFactory : public cricket::WebRtcVideoEncoderFactory {
1041 public: 1041 public:
1042 Vp8EncoderFactory() = default; 1042 Vp8EncoderFactory() {
1043 supported_codecs_.push_back(cricket::VideoCodec("VP8"));
1044 }
1043 ~Vp8EncoderFactory() override { RTC_CHECK(live_encoders_.empty()); } 1045 ~Vp8EncoderFactory() override { RTC_CHECK(live_encoders_.empty()); }
1044 1046
1045 VideoEncoder* Create() override { 1047 const std::vector<cricket::VideoCodec>& supported_codecs() const override {
1048 return supported_codecs_;
1049 }
1050
1051 VideoEncoder* CreateVideoEncoder(const cricket::VideoCodec& codec) override {
1046 VideoEncoder* encoder = VP8Encoder::Create(); 1052 VideoEncoder* encoder = VP8Encoder::Create();
1047 live_encoders_.insert(encoder); 1053 live_encoders_.insert(encoder);
1048 return encoder; 1054 return encoder;
1049 } 1055 }
1050 1056
1051 void Destroy(VideoEncoder* encoder) override { 1057 void DestroyVideoEncoder(VideoEncoder* encoder) override {
1052 auto it = live_encoders_.find(encoder); 1058 auto it = live_encoders_.find(encoder);
1053 RTC_CHECK(it != live_encoders_.end()); 1059 RTC_CHECK(it != live_encoders_.end());
1054 live_encoders_.erase(it); 1060 live_encoders_.erase(it);
1055 delete encoder; 1061 delete encoder;
1056 } 1062 }
1057 1063
1064 private:
1065 std::vector<cricket::VideoCodec> supported_codecs_;
1058 std::set<VideoEncoder*> live_encoders_; 1066 std::set<VideoEncoder*> live_encoders_;
1059 }; 1067 };
1060 1068
1061 VideoQualityTest::VideoQualityTest() 1069 VideoQualityTest::VideoQualityTest()
1062 : clock_(Clock::GetRealTimeClock()), receive_logs_(0), send_logs_(0) { 1070 : clock_(Clock::GetRealTimeClock()), receive_logs_(0), send_logs_(0) {
1063 payload_type_map_ = test::CallTest::payload_type_map_; 1071 payload_type_map_ = test::CallTest::payload_type_map_;
1064 RTC_DCHECK(payload_type_map_.find(kPayloadTypeH264) == 1072 RTC_DCHECK(payload_type_map_.find(kPayloadTypeH264) ==
1065 payload_type_map_.end()); 1073 payload_type_map_.end());
1066 RTC_DCHECK(payload_type_map_.find(kPayloadTypeVP8) == 1074 RTC_DCHECK(payload_type_map_.find(kPayloadTypeVP8) ==
1067 payload_type_map_.end()); 1075 payload_type_map_.end());
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
2019 if (!params_.video.encoded_frame_base_path.empty()) { 2027 if (!params_.video.encoded_frame_base_path.empty()) {
2020 std::ostringstream str; 2028 std::ostringstream str;
2021 str << receive_logs_++; 2029 str << receive_logs_++;
2022 std::string path = 2030 std::string path =
2023 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; 2031 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf";
2024 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), 2032 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path),
2025 10000000); 2033 10000000);
2026 } 2034 }
2027 } 2035 }
2028 } // namespace webrtc 2036 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698