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 |