Chromium Code Reviews| Index: content/renderer/media/media_stream_video_track.cc |
| diff --git a/content/renderer/media/media_stream_video_track.cc b/content/renderer/media/media_stream_video_track.cc |
| index cdfa86fb1defc60a53762f508c99387066dc27bc..e5ea7ce62355f94b4ba809ee417da05ddb732b60 100644 |
| --- a/content/renderer/media/media_stream_video_track.cc |
| +++ b/content/renderer/media/media_stream_video_track.cc |
| @@ -294,16 +294,25 @@ void MediaStreamVideoTrack::Stop() { |
| void MediaStreamVideoTrack::getSettings( |
| blink::WebMediaStreamTrack::Settings& settings) { |
| - if (source_) { |
| - const media::VideoCaptureFormat* format = source_->GetCurrentFormat(); |
| - if (format) { |
| - settings.frameRate = format->frame_rate; |
| - settings.width = format->frame_size.width(); |
| - settings.height = format->frame_size.height(); |
| - } |
| - } |
| // TODO(hta): Extract the real value. |
| settings.deviceId = blink::WebString("video device ID"); |
| + if (!source_) |
| + return; |
|
kinuko
2017/01/10 14:43:24
why don't we have this before line 298?
aleksandar.stojiljkovic
2017/01/11 08:58:46
Good point.
That change would be a functionality c
aleksandar.stojiljkovic
2017/01/11 09:32:18
Please ignore a note about non-const reference. As
|
| + |
| + const media::VideoCaptureFormat* format = source_->GetCurrentFormat(); |
| + if (format) { |
| + settings.frameRate = format->frame_rate; |
| + settings.width = format->frame_size.width(); |
| + settings.height = format->frame_size.height(); |
| + } |
| + const base::Optional<CameraCalibration> calibration = |
| + source_->device_info().device.camera_calibration; |
| + if (calibration) { |
| + settings.depthNear = calibration->depth_near; |
| + settings.depthFar = calibration->depth_far; |
| + settings.focalLengthX = calibration->focal_length_x; |
| + settings.focalLengthY = calibration->focal_length_y; |
| + } |
| } |
| void MediaStreamVideoTrack::OnReadyStateChanged( |