OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/media/media_stream_video_track.h" | 5 #include "content/renderer/media/media_stream_video_track.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
287 DCHECK(main_render_thread_checker_.CalledOnValidThread()); | 287 DCHECK(main_render_thread_checker_.CalledOnValidThread()); |
288 if (source_) { | 288 if (source_) { |
289 source_->RemoveTrack(this); | 289 source_->RemoveTrack(this); |
290 source_ = NULL; | 290 source_ = NULL; |
291 } | 291 } |
292 OnReadyStateChanged(blink::WebMediaStreamSource::ReadyStateEnded); | 292 OnReadyStateChanged(blink::WebMediaStreamSource::ReadyStateEnded); |
293 } | 293 } |
294 | 294 |
295 void MediaStreamVideoTrack::getSettings( | 295 void MediaStreamVideoTrack::getSettings( |
296 blink::WebMediaStreamTrack::Settings& settings) { | 296 blink::WebMediaStreamTrack::Settings& settings) { |
297 if (source_) { | 297 if (source_) { |
mcasas
2017/01/05 01:09:32
Not your fault but what about:
// TODO(hta): Ex
aleksandar.stojiljkovic
2017/01/09 18:47:01
Done.
| |
298 const media::VideoCaptureFormat* format = source_->GetCurrentFormat(); | 298 const media::VideoCaptureFormat* format = source_->GetCurrentFormat(); |
299 if (format) { | 299 if (format) { |
300 settings.frameRate = format->frame_rate; | 300 settings.frameRate = format->frame_rate; |
301 settings.width = format->frame_size.width(); | 301 settings.width = format->frame_size.width(); |
302 settings.height = format->frame_size.height(); | 302 settings.height = format->frame_size.height(); |
303 } | 303 } |
304 const MediaStreamDevice::CameraCalibration& calibration = | |
305 source_->device_info().device.camera_calibration; | |
306 if (calibration.valid) { | |
307 settings.depthNear = calibration.depth_near; | |
308 settings.depthFar = calibration.depth_far; | |
309 settings.focalLengthX = calibration.focal_length_x; | |
310 settings.focalLengthY = calibration.focal_length_y; | |
311 } | |
304 } | 312 } |
305 // TODO(hta): Extract the real value. | 313 // TODO(hta): Extract the real value. |
306 settings.deviceId = blink::WebString("video device ID"); | 314 settings.deviceId = blink::WebString("video device ID"); |
307 } | 315 } |
308 | 316 |
309 void MediaStreamVideoTrack::OnReadyStateChanged( | 317 void MediaStreamVideoTrack::OnReadyStateChanged( |
310 blink::WebMediaStreamSource::ReadyState state) { | 318 blink::WebMediaStreamSource::ReadyState state) { |
311 DCHECK(main_render_thread_checker_.CalledOnValidThread()); | 319 DCHECK(main_render_thread_checker_.CalledOnValidThread()); |
312 for (auto* sink : sinks_) | 320 for (auto* sink : sinks_) |
313 sink->OnReadyStateChanged(state); | 321 sink->OnReadyStateChanged(state); |
314 } | 322 } |
315 | 323 |
316 } // namespace content | 324 } // namespace content |
OLD | NEW |