| 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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 SetReadyState(blink::WebMediaStreamSource::ReadyStateEnded); | 475 SetReadyState(blink::WebMediaStreamSource::ReadyStateEnded); |
| 476 // This object can be deleted after calling FinalizeAddTrack. See comment | 476 // This object can be deleted after calling FinalizeAddTrack. See comment |
| 477 // in the header file. | 477 // in the header file. |
| 478 FinalizeAddTrack(); | 478 FinalizeAddTrack(); |
| 479 return; | 479 return; |
| 480 } | 480 } |
| 481 | 481 |
| 482 state_ = STARTING; | 482 state_ = STARTING; |
| 483 DVLOG(3) << "Starting the capturer with " << current_format_.ToString(); | 483 DVLOG(3) << "Starting the capturer with " << current_format_.ToString(); |
| 484 | 484 |
| 485 media::VideoCaptureParams params; | |
| 486 params.requested_format = current_format_; | |
| 487 StartSourceImpl( | 485 StartSourceImpl( |
| 488 params, | 486 current_format_, |
| 489 base::Bind(&VideoTrackAdapter::DeliverFrameOnIO, track_adapter_)); | 487 base::Bind(&VideoTrackAdapter::DeliverFrameOnIO, track_adapter_)); |
| 490 } | 488 } |
| 491 | 489 |
| 492 bool MediaStreamVideoSource::FindBestFormatWithConstraints( | 490 bool MediaStreamVideoSource::FindBestFormatWithConstraints( |
| 493 const media::VideoCaptureFormats& formats, | 491 const media::VideoCaptureFormats& formats, |
| 494 media::VideoCaptureFormat* best_format) { | 492 media::VideoCaptureFormat* best_format) { |
| 495 DCHECK(CalledOnValidThread()); | 493 DCHECK(CalledOnValidThread()); |
| 496 // Find the first constraints that we can fulfill. | 494 // Find the first constraints that we can fulfill. |
| 497 for (std::vector<RequestedConstraints>::iterator request_it = | 495 for (std::vector<RequestedConstraints>::iterator request_it = |
| 498 requested_constraints_.begin(); | 496 requested_constraints_.begin(); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 : track(track), | 618 : track(track), |
| 621 frame_callback(frame_callback), | 619 frame_callback(frame_callback), |
| 622 constraints(constraints), | 620 constraints(constraints), |
| 623 callback(callback) { | 621 callback(callback) { |
| 624 } | 622 } |
| 625 | 623 |
| 626 MediaStreamVideoSource::RequestedConstraints::~RequestedConstraints() { | 624 MediaStreamVideoSource::RequestedConstraints::~RequestedConstraints() { |
| 627 } | 625 } |
| 628 | 626 |
| 629 } // namespace content | 627 } // namespace content |
| OLD | NEW |