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

Unified Diff: content/renderer/media/media_stream_center.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/media_stream_center.cc
diff --git a/content/renderer/media/media_stream_center.cc b/content/renderer/media/media_stream_center.cc
index e7d146a72365887bcfe75d2b05e3094f37c55870..d6bb4c9167445c4cc44676ae9ec78f2c71fb26de 100644
--- a/content/renderer/media/media_stream_center.cc
+++ b/content/renderer/media/media_stream_center.cc
@@ -68,23 +68,9 @@ void CreateNativeVideoMediaStreamTrack(blink::WebMediaStreamTrack track) {
MediaStreamVideoSource* native_source =
MediaStreamVideoSource::GetVideoSource(source);
DCHECK(native_source);
- if (IsOldVideoConstraints()) {
- // TODO(perkj): The constraints to use here should be passed from blink when
- // a new track is created. For cloning, it should be the constraints of the
- // cloned track and not the originating source.
- // Also - source.constraints() returns an uninitialized constraint if the
- // source is coming from a remote video track. See http://crbug/287805.
- blink::WebMediaConstraints constraints = source.Constraints();
- if (constraints.IsNull())
- constraints.Initialize();
- track.SetTrackData(new MediaStreamVideoTrack(
- native_source, constraints,
- MediaStreamVideoSource::ConstraintsCallback(), track.IsEnabled()));
- } else {
- track.SetTrackData(new MediaStreamVideoTrack(
- native_source, MediaStreamVideoSource::ConstraintsCallback(),
- track.IsEnabled()));
- }
+ track.SetTrackData(new MediaStreamVideoTrack(
+ native_source, MediaStreamVideoSource::ConstraintsCallback(),
+ track.IsEnabled()));
}
void CloneNativeVideoMediaStreamTrack(
@@ -96,28 +82,14 @@ void CloneNativeVideoMediaStreamTrack(
MediaStreamVideoSource* native_source =
MediaStreamVideoSource::GetVideoSource(source);
DCHECK(native_source);
- if (IsOldVideoConstraints()) {
- // TODO(perkj): The constraints to use here should be passed from blink when
- // a new track is created. For cloning, it should be the constraints of the
- // cloned track and not the originating source.
- // Also - source.constraints() returns an uninitialized constraint if the
- // source is coming from a remote video track. See http://crbug/287805.
- blink::WebMediaConstraints constraints = source.Constraints();
- if (constraints.IsNull())
- constraints.Initialize();
- clone.SetTrackData(new MediaStreamVideoTrack(
- native_source, constraints,
- MediaStreamVideoSource::ConstraintsCallback(), clone.IsEnabled()));
- } else {
- MediaStreamVideoTrack* original_track =
- MediaStreamVideoTrack::GetVideoTrack(original);
- DCHECK(original_track);
- clone.SetTrackData(new MediaStreamVideoTrack(
- native_source, original_track->adapter_settings(),
- original_track->noise_reduction(), original_track->is_screencast(),
- original_track->min_frame_rate(),
- MediaStreamVideoSource::ConstraintsCallback(), clone.IsEnabled()));
- }
+ MediaStreamVideoTrack* original_track =
+ MediaStreamVideoTrack::GetVideoTrack(original);
+ DCHECK(original_track);
+ clone.SetTrackData(new MediaStreamVideoTrack(
+ native_source, original_track->adapter_settings(),
+ original_track->noise_reduction(), original_track->is_screencast(),
+ original_track->min_frame_rate(),
+ MediaStreamVideoSource::ConstraintsCallback(), clone.IsEnabled()));
}
} // namespace
« no previous file with comments | « content/public/common/content_features.cc ('k') | content/renderer/media/media_stream_video_capturer_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698