Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 virtual cricket::CaptureState Start( |
|
pbos-webrtc
2016/09/13 14:02:09
remove virtual (e.g. only use override and not vir
nisse-webrtc
2016/09/13 14:24:05
Done, all occurances in this class.
| |
| 127 const cricket::VideoFormat& format) override { | |
| 127 cricket::VideoFormat supported; | 128 cricket::VideoFormat supported; |
| 128 if (GetBestCaptureFormat(format, &supported)) { | 129 if (GetBestCaptureFormat(format, &supported)) { |
| 129 SetCaptureFormat(&supported); | 130 SetCaptureFormat(&supported); |
| 130 } | 131 } |
| 131 running_ = true; | 132 running_ = true; |
| 132 SetCaptureState(cricket::CS_RUNNING); | 133 SetCaptureState(cricket::CS_RUNNING); |
| 133 return cricket::CS_RUNNING; | 134 return cricket::CS_RUNNING; |
| 134 } | 135 } |
| 135 virtual void Stop() { | 136 virtual void Stop() override { |
| 136 running_ = false; | 137 running_ = false; |
| 137 SetCaptureFormat(NULL); | 138 SetCaptureFormat(NULL); |
| 138 SetCaptureState(cricket::CS_STOPPED); | 139 SetCaptureState(cricket::CS_STOPPED); |
| 139 } | 140 } |
| 140 virtual bool IsRunning() { return running_; } | 141 virtual bool IsRunning() override { return running_; } |
| 141 virtual bool IsScreencast() const { return is_screencast_; } | 142 virtual bool IsScreencast() const override { return is_screencast_; } |
| 142 bool GetPreferredFourccs(std::vector<uint32_t>* fourccs) { | 143 rtc::Optional<bool> NeedsDenoising() const override { |
| 144 return needs_denoising_; | |
| 145 } | |
| 146 bool GetPreferredFourccs(std::vector<uint32_t>* fourccs) override { | |
| 143 fourccs->push_back(cricket::FOURCC_I420); | 147 fourccs->push_back(cricket::FOURCC_I420); |
| 144 fourccs->push_back(cricket::FOURCC_MJPG); | 148 fourccs->push_back(cricket::FOURCC_MJPG); |
| 145 return true; | 149 return true; |
| 146 } | 150 } |
| 147 | 151 |
| 148 void SetRotation(webrtc::VideoRotation rotation) { | 152 void SetRotation(webrtc::VideoRotation rotation) { |
| 149 rotation_ = rotation; | 153 rotation_ = rotation; |
| 150 } | 154 } |
| 151 | 155 |
| 152 webrtc::VideoRotation GetRotation() { return rotation_; } | 156 webrtc::VideoRotation GetRotation() { return rotation_; } |
| 153 | 157 |
| 158 void SetNeedsDenoising(bool needs_denoising) { | |
|
pbos-webrtc
2016/09/13 14:02:09
Nit: Imo this should take a rtc::Optional<bool> as
nisse-webrtc
2016/09/13 14:24:05
Done.
| |
| 159 needs_denoising_ = rtc::Optional<bool>(needs_denoising); | |
| 160 } | |
| 161 | |
| 154 private: | 162 private: |
| 155 bool running_; | 163 bool running_; |
| 156 int64_t initial_timestamp_; | 164 int64_t initial_timestamp_; |
| 157 int64_t next_timestamp_; | 165 int64_t next_timestamp_; |
| 158 const bool is_screencast_; | 166 const bool is_screencast_; |
| 167 rtc::Optional<bool> needs_denoising_; | |
| 159 webrtc::VideoRotation rotation_; | 168 webrtc::VideoRotation rotation_; |
| 160 }; | 169 }; |
| 161 | 170 |
| 162 } // namespace cricket | 171 } // namespace cricket |
| 163 | 172 |
| 164 #endif // WEBRTC_MEDIA_BASE_FAKEVIDEOCAPTURER_H_ | 173 #endif // WEBRTC_MEDIA_BASE_FAKEVIDEOCAPTURER_H_ |
| OLD | NEW |