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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
300 } | 300 } |
301 | 301 |
302 void MediaStreamVideoTrack::getSettings( | 302 void MediaStreamVideoTrack::getSettings( |
303 blink::WebMediaStreamTrack::Settings& settings) { | 303 blink::WebMediaStreamTrack::Settings& settings) { |
304 if (source_) { | 304 if (source_) { |
305 const media::VideoCaptureFormat* format = source_->GetCurrentFormat(); | 305 const media::VideoCaptureFormat* format = source_->GetCurrentFormat(); |
306 if (format) { | 306 if (format) { |
307 settings.frameRate = format->frame_rate; | 307 settings.frameRate = format->frame_rate; |
308 settings.width = format->frame_size.width(); | 308 settings.width = format->frame_size.width(); |
309 settings.height = format->frame_size.height(); | 309 settings.height = format->frame_size.height(); |
310 settings.facingMode = source_->GetVideoFacing(); | |
hta - Chromium
2017/01/12 19:36:41
Why aren't you picking this out of source_->device
shenghao
2017/01/13 11:09:34
Deleted.
| |
310 } | 311 } |
311 } | 312 } |
312 // TODO(hta): Extract the real value. | 313 // TODO(hta): Extract the real value. |
313 settings.deviceId = blink::WebString("video device ID"); | 314 settings.deviceId = blink::WebString("video device ID"); |
314 } | 315 } |
315 | 316 |
316 void MediaStreamVideoTrack::OnReadyStateChanged( | 317 void MediaStreamVideoTrack::OnReadyStateChanged( |
317 blink::WebMediaStreamSource::ReadyState state) { | 318 blink::WebMediaStreamSource::ReadyState state) { |
318 DCHECK(main_render_thread_checker_.CalledOnValidThread()); | 319 DCHECK(main_render_thread_checker_.CalledOnValidThread()); |
319 for (auto* sink : sinks_) | 320 for (auto* sink : sinks_) |
320 sink->OnReadyStateChanged(state); | 321 sink->OnReadyStateChanged(state); |
321 } | 322 } |
322 | 323 |
323 } // namespace content | 324 } // namespace content |
OLD | NEW |