| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_source.h" | 5 #include "content/renderer/media/media_stream_video_source.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 | 394 |
| 395 if (tracks_.empty()) | 395 if (tracks_.empty()) |
| 396 StopSource(); | 396 StopSource(); |
| 397 } | 397 } |
| 398 | 398 |
| 399 base::SingleThreadTaskRunner* MediaStreamVideoSource::io_task_runner() const { | 399 base::SingleThreadTaskRunner* MediaStreamVideoSource::io_task_runner() const { |
| 400 DCHECK(CalledOnValidThread()); | 400 DCHECK(CalledOnValidThread()); |
| 401 return track_adapter_->io_task_runner(); | 401 return track_adapter_->io_task_runner(); |
| 402 } | 402 } |
| 403 | 403 |
| 404 const media::VideoCaptureFormat* |
| 405 MediaStreamVideoSource::GetCurrentFormat() const { |
| 406 DCHECK(CalledOnValidThread()); |
| 407 if (state_ == STARTING || state_ == STARTED) |
| 408 return ¤t_format_; |
| 409 return nullptr; |
| 410 } |
| 411 |
| 404 void MediaStreamVideoSource::DoStopSource() { | 412 void MediaStreamVideoSource::DoStopSource() { |
| 405 DCHECK(CalledOnValidThread()); | 413 DCHECK(CalledOnValidThread()); |
| 406 DVLOG(3) << "DoStopSource()"; | 414 DVLOG(3) << "DoStopSource()"; |
| 407 if (state_ == ENDED) | 415 if (state_ == ENDED) |
| 408 return; | 416 return; |
| 409 track_adapter_->StopFrameMonitoring(); | 417 track_adapter_->StopFrameMonitoring(); |
| 410 StopSourceImpl(); | 418 StopSourceImpl(); |
| 411 state_ = ENDED; | 419 state_ = ENDED; |
| 412 SetReadyState(blink::WebMediaStreamSource::ReadyStateEnded); | 420 SetReadyState(blink::WebMediaStreamSource::ReadyStateEnded); |
| 413 } | 421 } |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 callback(callback) { | 584 callback(callback) { |
| 577 } | 585 } |
| 578 | 586 |
| 579 MediaStreamVideoSource::TrackDescriptor::TrackDescriptor( | 587 MediaStreamVideoSource::TrackDescriptor::TrackDescriptor( |
| 580 const TrackDescriptor& other) = default; | 588 const TrackDescriptor& other) = default; |
| 581 | 589 |
| 582 MediaStreamVideoSource::TrackDescriptor::~TrackDescriptor() { | 590 MediaStreamVideoSource::TrackDescriptor::~TrackDescriptor() { |
| 583 } | 591 } |
| 584 | 592 |
| 585 } // namespace content | 593 } // namespace content |
| OLD | NEW |