| 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 <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 track_adapter_->AddTrack( | 644 track_adapter_->AddTrack( |
| 645 track.track, track.frame_callback, | 645 track.track, track.frame_callback, |
| 646 VideoTrackAdapterSettings(max_width, max_height, min_aspect_ratio, | 646 VideoTrackAdapterSettings(max_width, max_height, min_aspect_ratio, |
| 647 max_aspect_ratio, max_frame_rate)); | 647 max_aspect_ratio, max_frame_rate)); |
| 648 // Calculate resulting frame size if the source delivers frames | 648 // Calculate resulting frame size if the source delivers frames |
| 649 // according to the current format. Note: Format may change later. | 649 // according to the current format. Note: Format may change later. |
| 650 gfx::Size desired_size; | 650 gfx::Size desired_size; |
| 651 VideoTrackAdapter::CalculateTargetSize( | 651 VideoTrackAdapter::CalculateTargetSize( |
| 652 current_format_.frame_size, gfx::Size(max_width, max_height), | 652 current_format_.frame_size, gfx::Size(max_width, max_height), |
| 653 min_aspect_ratio, max_aspect_ratio, &desired_size); | 653 min_aspect_ratio, max_aspect_ratio, &desired_size); |
| 654 track.track->SetTargetSize(desired_size.width(), desired_size.height()); | 654 track.track->SetTargetSizeAndFrameRate( |
| 655 desired_size.width(), desired_size.height(), max_frame_rate); |
| 655 } | 656 } |
| 656 | 657 |
| 657 DVLOG(3) << "FinalizeAddTrackLegacy() result " << result; | 658 DVLOG(3) << "FinalizeAddTrackLegacy() result " << result; |
| 658 | 659 |
| 659 if (!track.callback.is_null()) | 660 if (!track.callback.is_null()) |
| 660 track.callback.Run(this, result, | 661 track.callback.Run(this, result, |
| 661 blink::WebString::FromUTF8(unsatisfied_constraint)); | 662 blink::WebString::FromUTF8(unsatisfied_constraint)); |
| 662 } | 663 } |
| 663 } | 664 } |
| 664 | 665 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 680 // according to the current format. Note: Format may change later. | 681 // according to the current format. Note: Format may change later. |
| 681 gfx::Size desired_size; | 682 gfx::Size desired_size; |
| 682 VideoTrackAdapter::CalculateTargetSize( | 683 VideoTrackAdapter::CalculateTargetSize( |
| 683 GetCurrentFormat() ? GetCurrentFormat()->frame_size | 684 GetCurrentFormat() ? GetCurrentFormat()->frame_size |
| 684 : gfx::Size(track.adapter_settings->max_width, | 685 : gfx::Size(track.adapter_settings->max_width, |
| 685 track.adapter_settings->max_height), | 686 track.adapter_settings->max_height), |
| 686 gfx::Size(track.adapter_settings->max_width, | 687 gfx::Size(track.adapter_settings->max_width, |
| 687 track.adapter_settings->max_height), | 688 track.adapter_settings->max_height), |
| 688 track.adapter_settings->min_aspect_ratio, | 689 track.adapter_settings->min_aspect_ratio, |
| 689 track.adapter_settings->max_aspect_ratio, &desired_size); | 690 track.adapter_settings->max_aspect_ratio, &desired_size); |
| 690 track.track->SetTargetSize(desired_size.width(), desired_size.height()); | 691 track.track->SetTargetSizeAndFrameRate( |
| 692 desired_size.width(), desired_size.height(), |
| 693 track.adapter_settings->max_frame_rate); |
| 691 } | 694 } |
| 692 | 695 |
| 693 if (!track.callback.is_null()) | 696 if (!track.callback.is_null()) |
| 694 track.callback.Run(this, result, blink::WebString()); | 697 track.callback.Run(this, result, blink::WebString()); |
| 695 } | 698 } |
| 696 } | 699 } |
| 697 | 700 |
| 698 void MediaStreamVideoSource::SetReadyState( | 701 void MediaStreamVideoSource::SetReadyState( |
| 699 blink::WebMediaStreamSource::ReadyState state) { | 702 blink::WebMediaStreamSource::ReadyState state) { |
| 700 DVLOG(3) << "MediaStreamVideoSource::SetReadyState state " << state; | 703 DVLOG(3) << "MediaStreamVideoSource::SetReadyState state " << state; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 MediaStreamVideoSource::TrackDescriptor::TrackDescriptor( | 745 MediaStreamVideoSource::TrackDescriptor::TrackDescriptor( |
| 743 TrackDescriptor&& other) = default; | 746 TrackDescriptor&& other) = default; |
| 744 MediaStreamVideoSource::TrackDescriptor& | 747 MediaStreamVideoSource::TrackDescriptor& |
| 745 MediaStreamVideoSource::TrackDescriptor::operator=( | 748 MediaStreamVideoSource::TrackDescriptor::operator=( |
| 746 MediaStreamVideoSource::TrackDescriptor&& other) = default; | 749 MediaStreamVideoSource::TrackDescriptor&& other) = default; |
| 747 | 750 |
| 748 MediaStreamVideoSource::TrackDescriptor::~TrackDescriptor() { | 751 MediaStreamVideoSource::TrackDescriptor::~TrackDescriptor() { |
| 749 } | 752 } |
| 750 | 753 |
| 751 } // namespace content | 754 } // namespace content |
| OLD | NEW |