Revert of Add method cricket::VideoCapturer::NeedsDenoising, use in VideoCapturerTrackSource. (patchset #5 id:80001 of https://codereview.webrtc.org/2334683002/ )
Reason for revert: This was a workaround to help Chrome wire up the googNoiseReduction constraint. However, it was fixed in a different way in Chrome, and this hack is not actually needed. Original issue's description: > Add method cricket::VideoCapturer::NeedsDenoising, use in VideoCapturerTrackSource. > > BUG=chromium:645907 > > Committed: https://crrev.com/0d14c6abba19295725519ce38105688ae0a62513 > Cr-Commit-Position: refs/heads/master@{#14219} TBR=pbos@webrtc.org,hta@webrtc.org,perkj@webrtc.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=chromium:645907 Review-Url: https://codereview.webrtc.org/2433293003 Cr-Commit-Position: refs/heads/master@{#14729}
This commit is contained in:
parent
151572ba05
commit
66712b024f
@ -320,9 +320,6 @@ void VideoCapturerTrackSource::Initialize(
|
||||
}
|
||||
}
|
||||
|
||||
// Get default from the capturer, overridden by constraints, if any.
|
||||
needs_denoising_ = video_capturer_->NeedsDenoising();
|
||||
|
||||
if (constraints) {
|
||||
MediaConstraintsInterface::Constraints mandatory_constraints =
|
||||
constraints->GetMandatory();
|
||||
|
||||
@ -444,35 +444,6 @@ TEST_F(VideoCapturerTrackSourceTest, ScreencastResolutionWithConstraint) {
|
||||
EXPECT_EQ(30, format->framerate());
|
||||
}
|
||||
|
||||
TEST_F(VideoCapturerTrackSourceTest, DenoisingDefault) {
|
||||
CreateVideoCapturerSource();
|
||||
EXPECT_FALSE(source_->needs_denoising());
|
||||
}
|
||||
|
||||
TEST_F(VideoCapturerTrackSourceTest, DenoisingConstraintOn) {
|
||||
FakeConstraints constraints;
|
||||
constraints.AddOptional(MediaConstraintsInterface::kNoiseReduction, true);
|
||||
CreateVideoCapturerSource(&constraints);
|
||||
ASSERT_TRUE(source_->needs_denoising());
|
||||
EXPECT_TRUE(*source_->needs_denoising());
|
||||
}
|
||||
|
||||
TEST_F(VideoCapturerTrackSourceTest, DenoisingCapturerOff) {
|
||||
capturer_->SetNeedsDenoising(rtc::Optional<bool>(false));
|
||||
CreateVideoCapturerSource();
|
||||
ASSERT_TRUE(source_->needs_denoising());
|
||||
EXPECT_FALSE(*source_->needs_denoising());
|
||||
}
|
||||
|
||||
TEST_F(VideoCapturerTrackSourceTest, DenoisingConstraintOverridesCapturer) {
|
||||
capturer_->SetNeedsDenoising(rtc::Optional<bool>(false));
|
||||
FakeConstraints constraints;
|
||||
constraints.AddOptional(MediaConstraintsInterface::kNoiseReduction, true);
|
||||
CreateVideoCapturerSource(&constraints);
|
||||
ASSERT_TRUE(source_->needs_denoising());
|
||||
EXPECT_TRUE(*source_->needs_denoising());
|
||||
}
|
||||
|
||||
TEST_F(VideoCapturerTrackSourceTest, MandatorySubOneFpsConstraints) {
|
||||
FakeConstraints constraints;
|
||||
constraints.AddMandatory(MediaConstraintsInterface::kMaxFrameRate, 0.5);
|
||||
|
||||
@ -121,9 +121,6 @@ class FakeVideoCapturer : public cricket::VideoCapturer {
|
||||
}
|
||||
bool IsRunning() override { return running_; }
|
||||
bool IsScreencast() const override { return is_screencast_; }
|
||||
rtc::Optional<bool> NeedsDenoising() const override {
|
||||
return needs_denoising_;
|
||||
}
|
||||
bool GetPreferredFourccs(std::vector<uint32_t>* fourccs) override {
|
||||
fourccs->push_back(cricket::FOURCC_I420);
|
||||
fourccs->push_back(cricket::FOURCC_MJPG);
|
||||
@ -136,16 +133,11 @@ class FakeVideoCapturer : public cricket::VideoCapturer {
|
||||
|
||||
webrtc::VideoRotation GetRotation() { return rotation_; }
|
||||
|
||||
void SetNeedsDenoising(rtc::Optional<bool> needs_denoising) {
|
||||
needs_denoising_ = needs_denoising;
|
||||
}
|
||||
|
||||
private:
|
||||
bool running_;
|
||||
int64_t initial_timestamp_;
|
||||
int64_t next_timestamp_;
|
||||
const bool is_screencast_;
|
||||
rtc::Optional<bool> needs_denoising_;
|
||||
webrtc::VideoRotation rotation_;
|
||||
};
|
||||
|
||||
|
||||
@ -140,18 +140,6 @@ class VideoCapturer : public sigslot::has_slots<>,
|
||||
// implement screencast specific behavior.
|
||||
virtual bool IsScreencast() const = 0;
|
||||
|
||||
// Indicates that the encoder should denoise video before encoding
|
||||
// it, wired up to VideoCapturerTrackSource::needs_denoising. If it
|
||||
// is not set, the default configuration is used which is different
|
||||
// depending on video codec.
|
||||
// TODO(nisse): This is a workaround needed to fix
|
||||
// https://bugs.chromium.org/p/chromium/issues/detail?id=645907.
|
||||
// Chrome should migrate to implement VideoTrackSourceInterface
|
||||
// directly, and then this method is no longer needed.
|
||||
virtual rtc::Optional<bool> NeedsDenoising() const {
|
||||
return rtc::Optional<bool>();
|
||||
}
|
||||
|
||||
// Caps the VideoCapturer's format according to max_format. It can e.g. be
|
||||
// used to prevent cameras from capturing at a resolution or framerate that
|
||||
// the capturer is capable of but not performing satisfactorily at.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user