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

Side by Side Diff: webrtc/media/base/fakevideocapturer.h

Issue 2334683002: Add method cricket::VideoCapturer::NeedsDenoising, use in VideoCapturerTrackSource. (Closed)
Patch Set: TODO comment explaining the NeedsDenoising hack. Created 4 years, 3 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/api/videocapturertracksource_unittest.cc ('k') | webrtc/media/base/videocapturer.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) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 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 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 SignalFrameCaptured(this, &frame); 116 SignalFrameCaptured(this, &frame);
117 return true; 117 return true;
118 } 118 }
119 119
120 void SignalCapturedFrame(cricket::CapturedFrame* frame) { 120 void SignalCapturedFrame(cricket::CapturedFrame* frame) {
121 SignalFrameCaptured(this, frame); 121 SignalFrameCaptured(this, frame);
122 } 122 }
123 123
124 sigslot::signal1<FakeVideoCapturer*> SignalDestroyed; 124 sigslot::signal1<FakeVideoCapturer*> SignalDestroyed;
125 125
126 virtual cricket::CaptureState Start(const cricket::VideoFormat& format) { 126 cricket::CaptureState Start(const cricket::VideoFormat& format) override {
127 cricket::VideoFormat supported; 127 cricket::VideoFormat supported;
128 if (GetBestCaptureFormat(format, &supported)) { 128 if (GetBestCaptureFormat(format, &supported)) {
129 SetCaptureFormat(&supported); 129 SetCaptureFormat(&supported);
130 } 130 }
131 running_ = true; 131 running_ = true;
132 SetCaptureState(cricket::CS_RUNNING); 132 SetCaptureState(cricket::CS_RUNNING);
133 return cricket::CS_RUNNING; 133 return cricket::CS_RUNNING;
134 } 134 }
135 virtual void Stop() { 135 void Stop() override {
136 running_ = false; 136 running_ = false;
137 SetCaptureFormat(NULL); 137 SetCaptureFormat(NULL);
138 SetCaptureState(cricket::CS_STOPPED); 138 SetCaptureState(cricket::CS_STOPPED);
139 } 139 }
140 virtual bool IsRunning() { return running_; } 140 bool IsRunning() override { return running_; }
141 virtual bool IsScreencast() const { return is_screencast_; } 141 bool IsScreencast() const override { return is_screencast_; }
142 bool GetPreferredFourccs(std::vector<uint32_t>* fourccs) { 142 rtc::Optional<bool> NeedsDenoising() const override {
143 return needs_denoising_;
144 }
145 bool GetPreferredFourccs(std::vector<uint32_t>* fourccs) override {
143 fourccs->push_back(cricket::FOURCC_I420); 146 fourccs->push_back(cricket::FOURCC_I420);
144 fourccs->push_back(cricket::FOURCC_MJPG); 147 fourccs->push_back(cricket::FOURCC_MJPG);
145 return true; 148 return true;
146 } 149 }
147 150
148 void SetRotation(webrtc::VideoRotation rotation) { 151 void SetRotation(webrtc::VideoRotation rotation) {
149 rotation_ = rotation; 152 rotation_ = rotation;
150 } 153 }
151 154
152 webrtc::VideoRotation GetRotation() { return rotation_; } 155 webrtc::VideoRotation GetRotation() { return rotation_; }
153 156
157 void SetNeedsDenoising(rtc::Optional<bool> needs_denoising) {
158 needs_denoising_ = needs_denoising;
159 }
160
154 private: 161 private:
155 bool running_; 162 bool running_;
156 int64_t initial_timestamp_; 163 int64_t initial_timestamp_;
157 int64_t next_timestamp_; 164 int64_t next_timestamp_;
158 const bool is_screencast_; 165 const bool is_screencast_;
166 rtc::Optional<bool> needs_denoising_;
159 webrtc::VideoRotation rotation_; 167 webrtc::VideoRotation rotation_;
160 }; 168 };
161 169
162 } // namespace cricket 170 } // namespace cricket
163 171
164 #endif // WEBRTC_MEDIA_BASE_FAKEVIDEOCAPTURER_H_ 172 #endif // WEBRTC_MEDIA_BASE_FAKEVIDEOCAPTURER_H_
OLDNEW
« no previous file with comments | « webrtc/api/videocapturertracksource_unittest.cc ('k') | webrtc/media/base/videocapturer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698