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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 source_->RemoveTrack(this); | 285 source_->RemoveTrack(this); |
286 source_ = NULL; | 286 source_ = NULL; |
287 } | 287 } |
288 OnReadyStateChanged(blink::WebMediaStreamSource::ReadyStateEnded); | 288 OnReadyStateChanged(blink::WebMediaStreamSource::ReadyStateEnded); |
289 } | 289 } |
290 | 290 |
291 void MediaStreamVideoTrack::getSettings( | 291 void MediaStreamVideoTrack::getSettings( |
292 blink::WebMediaStreamTrack::Settings& settings) { | 292 blink::WebMediaStreamTrack::Settings& settings) { |
293 if (source_) { | 293 if (source_) { |
294 const media::VideoCaptureFormat* format = source_->GetCurrentFormat(); | 294 const media::VideoCaptureFormat* format = source_->GetCurrentFormat(); |
295 if (format) | 295 if (format) { |
296 settings.frameRate = format->frame_rate; | 296 settings.frameRate = format->frame_rate; |
| 297 settings.width = format->frame_size.width(); |
| 298 settings.height = format->frame_size.height(); |
| 299 } |
297 } | 300 } |
298 // TODO(hta): Extract the real value. | 301 // TODO(hta): Extract the real value. |
299 settings.deviceId = blink::WebString("video device ID"); | 302 settings.deviceId = blink::WebString("video device ID"); |
300 } | 303 } |
301 | 304 |
302 void MediaStreamVideoTrack::OnReadyStateChanged( | 305 void MediaStreamVideoTrack::OnReadyStateChanged( |
303 blink::WebMediaStreamSource::ReadyState state) { | 306 blink::WebMediaStreamSource::ReadyState state) { |
304 DCHECK(main_render_thread_checker_.CalledOnValidThread()); | 307 DCHECK(main_render_thread_checker_.CalledOnValidThread()); |
305 for (auto* sink : sinks_) | 308 for (auto* sink : sinks_) |
306 sink->OnReadyStateChanged(state); | 309 sink->OnReadyStateChanged(state); |
307 } | 310 } |
308 | 311 |
309 } // namespace content | 312 } // namespace content |
OLD | NEW |