Commit 621ffb7b authored by guidou's avatar guidou Committed by Commit bot

Support the googNoiseReduction constraint in SelectSettings for video-device capture.

BUG=657733

Review-Url: https://codereview.chromium.org/2711783008
Cr-Commit-Position: refs/heads/master@{#453263}
parent 76a6942d
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "content/common/content_export.h" #include "content/common/content_export.h"
#include "content/common/media/media_devices.mojom.h" #include "content/common/media/media_devices.mojom.h"
#include "media/capture/video_capture_types.h" #include "media/capture/video_capture_types.h"
#include "third_party/webrtc/base/optional.h"
namespace blink { namespace blink {
class WebString; class WebString;
...@@ -34,6 +35,7 @@ struct CONTENT_EXPORT VideoDeviceCaptureCapabilities { ...@@ -34,6 +35,7 @@ struct CONTENT_EXPORT VideoDeviceCaptureCapabilities {
// Each field is independent of each other. // Each field is independent of each other.
std::vector<::mojom::VideoInputDeviceCapabilitiesPtr> device_capabilities; std::vector<::mojom::VideoInputDeviceCapabilitiesPtr> device_capabilities;
std::vector<media::PowerLineFrequency> power_line_capabilities; std::vector<media::PowerLineFrequency> power_line_capabilities;
std::vector<rtc::Optional<bool>> noise_reduction_capabilities;
}; };
struct CONTENT_EXPORT VideoDeviceCaptureSourceSelectionResult { struct CONTENT_EXPORT VideoDeviceCaptureSourceSelectionResult {
...@@ -69,6 +71,7 @@ struct CONTENT_EXPORT VideoDeviceCaptureSourceSelectionResult { ...@@ -69,6 +71,7 @@ struct CONTENT_EXPORT VideoDeviceCaptureSourceSelectionResult {
std::string device_id; std::string device_id;
::mojom::FacingMode facing_mode; ::mojom::FacingMode facing_mode;
media::VideoCaptureParams capture_params; media::VideoCaptureParams capture_params;
rtc::Optional<bool> noise_reduction;
}; };
// This function performs source and source-settings selection based on // This function performs source and source-settings selection based on
...@@ -130,9 +133,9 @@ struct CONTENT_EXPORT VideoDeviceCaptureSourceSelectionResult { ...@@ -130,9 +133,9 @@ struct CONTENT_EXPORT VideoDeviceCaptureSourceSelectionResult {
// ideal value and thus has worse fitness according to step 2, even if C3's // ideal value and thus has worse fitness according to step 2, even if C3's
// native fitness is better than C1's and C2's. // native fitness is better than C1's and C2's.
// 5. C1 is better than C2 if its settings are closer to certain default // 5. C1 is better than C2 if its settings are closer to certain default
// settings that include the device ID, power-line frequency, resolution, and // settings that include the device ID, power-line frequency, noise
// frame rate, in that order. Note that there is no default facing mode or // reduction, resolution, and frame rate, in that order. Note that there is
// aspect ratio. // no default facing mode or aspect ratio.
VideoDeviceCaptureSourceSelectionResult CONTENT_EXPORT VideoDeviceCaptureSourceSelectionResult CONTENT_EXPORT
SelectVideoDeviceCaptureSourceSettings( SelectVideoDeviceCaptureSourceSettings(
const VideoDeviceCaptureCapabilities& capabilities, const VideoDeviceCaptureCapabilities& capabilities,
......
...@@ -372,6 +372,9 @@ void UserMediaClientImpl::SelectVideoDeviceSourceSettings( ...@@ -372,6 +372,9 @@ void UserMediaClientImpl::SelectVideoDeviceSourceSettings(
media::PowerLineFrequency::FREQUENCY_DEFAULT, media::PowerLineFrequency::FREQUENCY_DEFAULT,
media::PowerLineFrequency::FREQUENCY_50HZ, media::PowerLineFrequency::FREQUENCY_50HZ,
media::PowerLineFrequency::FREQUENCY_60HZ}; media::PowerLineFrequency::FREQUENCY_60HZ};
capabilities.noise_reduction_capabilities = {rtc::Optional<bool>(),
rtc::Optional<bool>(true),
rtc::Optional<bool>(false)};
base::PostTaskAndReplyWithResult( base::PostTaskAndReplyWithResult(
worker_task_runner_.get(), FROM_HERE, worker_task_runner_.get(), FROM_HERE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment