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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 if (!FindBestFormatWithConstraints(supported_formats_, | 473 if (!FindBestFormatWithConstraints(supported_formats_, |
474 ¤t_format_)) { | 474 ¤t_format_)) { |
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" | 483 DVLOG(3) << "Starting the capturer with " << current_format_.ToString(); |
484 << " width = " << current_format_.frame_size.width() | |
485 << " height = " << current_format_.frame_size.height() | |
486 << " frame rate = " << current_format_.frame_rate | |
487 << " pixel format = " | |
488 << media::VideoCaptureFormat::PixelFormatToString( | |
489 current_format_.pixel_format); | |
490 | 484 |
491 media::VideoCaptureParams params; | 485 media::VideoCaptureParams params; |
492 params.requested_format = current_format_; | 486 params.requested_format = current_format_; |
493 StartSourceImpl( | 487 StartSourceImpl( |
494 params, | 488 params, |
495 base::Bind(&VideoTrackAdapter::DeliverFrameOnIO, track_adapter_)); | 489 base::Bind(&VideoTrackAdapter::DeliverFrameOnIO, track_adapter_)); |
496 } | 490 } |
497 | 491 |
498 bool MediaStreamVideoSource::FindBestFormatWithConstraints( | 492 bool MediaStreamVideoSource::FindBestFormatWithConstraints( |
499 const media::VideoCaptureFormats& formats, | 493 const media::VideoCaptureFormats& formats, |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 : track(track), | 620 : track(track), |
627 frame_callback(frame_callback), | 621 frame_callback(frame_callback), |
628 constraints(constraints), | 622 constraints(constraints), |
629 callback(callback) { | 623 callback(callback) { |
630 } | 624 } |
631 | 625 |
632 MediaStreamVideoSource::RequestedConstraints::~RequestedConstraints() { | 626 MediaStreamVideoSource::RequestedConstraints::~RequestedConstraints() { |
633 } | 627 } |
634 | 628 |
635 } // namespace content | 629 } // namespace content |
OLD | NEW |