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

Unified Diff: content/renderer/media/webrtc/media_stream_video_webrtc_sink.cc

Issue 2964003002: Remove support for old getUserMedia video constraints algorithm. (Closed)
Patch Set: rebase and address hbos@ comments 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/webrtc/media_stream_video_webrtc_sink.cc
diff --git a/content/renderer/media/webrtc/media_stream_video_webrtc_sink.cc b/content/renderer/media/webrtc/media_stream_video_webrtc_sink.cc
index 1f6f9aa5708e685dba344322da2a4db5182a74d5..24bad310bcadef9934fabf9cac40a2d5542cca2e 100644
--- a/content/renderer/media/webrtc/media_stream_video_webrtc_sink.cc
+++ b/content/renderer/media/webrtc/media_stream_video_webrtc_sink.cc
@@ -266,51 +266,12 @@ MediaStreamVideoWebRtcSink::MediaStreamVideoWebRtcSink(
MediaStreamVideoTrack* video_track =
MediaStreamVideoTrack::GetVideoTrack(track);
DCHECK(video_track);
- rtc::Optional<bool> needs_denoising;
- bool is_screencast = false;
- base::Optional<double> min_frame_rate;
- base::Optional<double> max_frame_rate;
-
- if (IsOldVideoConstraints()) {
- const blink::WebMediaConstraints& constraints = video_track->constraints();
-
- // Check for presence of mediaStreamSource constraint. The value is ignored.
- std::string value;
- is_screencast = GetConstraintValueAsString(
- constraints, &blink::WebMediaTrackConstraintSet::media_stream_source,
- &value);
-
- // Extract denoising preference, if no value is set this currently falls
- // back to a codec-specific default inside webrtc, hence the tri-state of
- // {on, off unset}.
- // TODO(pbos): Add tests that make sure that googNoiseReduction has properly
- // propagated from getUserMedia down to a VideoTrackSource.
- bool denoising_value;
- if (GetConstraintValueAsBoolean(
- constraints,
- &blink::WebMediaTrackConstraintSet::goog_noise_reduction,
- &denoising_value)) {
- needs_denoising = rtc::Optional<bool>(denoising_value);
- }
- double frame_rate_value;
- if (GetConstraintMinAsDouble(constraints,
- &blink::WebMediaTrackConstraintSet::frame_rate,
- &frame_rate_value) &&
- frame_rate_value >= 0.0) {
- min_frame_rate = frame_rate_value;
- }
- if (GetConstraintMaxAsDouble(constraints,
- &blink::WebMediaTrackConstraintSet::frame_rate,
- &frame_rate_value) &&
- frame_rate_value >= 0.0) {
- max_frame_rate = frame_rate_value;
- }
- } else {
- needs_denoising = ToRtcOptional(video_track->noise_reduction());
- is_screencast = video_track->is_screencast();
- min_frame_rate = video_track->min_frame_rate();
- max_frame_rate = video_track->max_frame_rate();
- }
+
+ rtc::Optional<bool> needs_denoising =
+ ToRtcOptional(video_track->noise_reduction());
+ bool is_screencast = is_screencast = video_track->is_screencast();
+ base::Optional<double> min_frame_rate = video_track->min_frame_rate();
+ base::Optional<double> max_frame_rate = video_track->max_frame_rate();
// Enable automatic frame refreshes for the screen capture sources, which will
// stop producing frames whenever screen content is not changing. Check the

Powered by Google App Engine
This is Rietveld 408576698