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

Unified Diff: content/renderer/media/media_stream_center.cc

Issue 2790823002: Spec compliant video constraints for getUserMedia behind flag. (Closed)
Patch Set: rebase Created 3 years, 8 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 bd2c6a53f364f2ece61932a86601f185f56ba21f..283df659d9c55fdb7bfca9b9895a660de88d0c89 100644
--- a/content/renderer/media/media_stream_center.cc
+++ b/content/renderer/media/media_stream_center.cc
@@ -70,17 +70,26 @@ void CreateNativeVideoMediaStreamTrack(
MediaStreamVideoSource::GetVideoSource(source);
DCHECK(native_source);
blink::WebMediaStreamTrack writable_track(track);
- // 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();
- writable_track.setTrackData(new MediaStreamVideoTrack(
- native_source, constraints, MediaStreamVideoSource::ConstraintsCallback(),
- track.isEnabled()));
+ 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();
+ writable_track.setTrackData(new MediaStreamVideoTrack(
+ native_source, constraints,
+ MediaStreamVideoSource::ConstraintsCallback(), track.isEnabled()));
+ } else {
+ // TODO(guidou): All existing uses are without constraints except for the
+ // case of cloning a track. To fix this, create a new function in
+ // MediaStreamCenter specifically for cloning.
+ writable_track.setTrackData(new MediaStreamVideoTrack(
+ native_source, MediaStreamVideoSource::ConstraintsCallback(),
+ track.isEnabled()));
+ }
}
} // namespace
« no previous file with comments | « content/public/renderer/media_stream_utils.cc ('k') | content/renderer/media/media_stream_constraints_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698