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 "media/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 #include <string> | 10 #include <string> |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
662 } | 662 } |
663 MEDIA_LOG(INFO, media_log_) << "Enabled audio tracks: [" << logstr.str() | 663 MEDIA_LOG(INFO, media_log_) << "Enabled audio tracks: [" << logstr.str() |
664 << "]"; | 664 << "]"; |
665 pipeline_.OnEnabledAudioTracksChanged(enabledMediaTrackIds); | 665 pipeline_.OnEnabledAudioTracksChanged(enabledMediaTrackIds); |
666 } | 666 } |
667 | 667 |
668 void WebMediaPlayerImpl::selectedVideoTrackChanged( | 668 void WebMediaPlayerImpl::selectedVideoTrackChanged( |
669 blink::WebMediaPlayer::TrackId* selectedTrackId) { | 669 blink::WebMediaPlayer::TrackId* selectedTrackId) { |
670 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 670 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
671 | 671 |
672 std::ostringstream logstr; | 672 base::Optional<MediaTrack::Id> selectedVideoTrackId; |
watk
2017/02/23 20:57:54
naming convention
servolk
2017/02/23 21:15:48
Done.
| |
673 std::vector<MediaTrack::Id> selectedVideoMediaTrackId; | 673 if (selectedTrackId && !video_track_disabled_) |
674 if (selectedTrackId && !video_track_disabled_) { | 674 selectedVideoTrackId = MediaTrack::Id(selectedTrackId->utf8().data()); |
675 selectedVideoMediaTrackId.push_back(selectedTrackId->utf8().data()); | 675 MEDIA_LOG(INFO, media_log_) |
676 logstr << selectedVideoMediaTrackId[0]; | 676 << "Selected video track: [" |
677 } | 677 << (selectedVideoTrackId ? *selectedVideoTrackId : "") << "]"; |
watk
2017/02/23 20:57:54
Could use .value_or("") to make it slightly shorte
servolk
2017/02/23 21:15:48
Done.
| |
678 MEDIA_LOG(INFO, media_log_) << "Selected video track: [" << logstr.str() | 678 pipeline_.OnSelectedVideoTrackChanged(selectedVideoTrackId); |
679 << "]"; | |
680 pipeline_.OnSelectedVideoTrackChanged(selectedVideoMediaTrackId); | |
681 } | 679 } |
682 | 680 |
683 blink::WebSize WebMediaPlayerImpl::naturalSize() const { | 681 blink::WebSize WebMediaPlayerImpl::naturalSize() const { |
684 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 682 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
685 | 683 |
686 return blink::WebSize(pipeline_metadata_.natural_size); | 684 return blink::WebSize(pipeline_metadata_.natural_size); |
687 } | 685 } |
688 | 686 |
689 bool WebMediaPlayerImpl::paused() const { | 687 bool WebMediaPlayerImpl::paused() const { |
690 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 688 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
(...skipping 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2295 | 2293 |
2296 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { | 2294 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { |
2297 DCHECK(data_source_ || chunk_demuxer_); | 2295 DCHECK(data_source_ || chunk_demuxer_); |
2298 if (data_source_) | 2296 if (data_source_) |
2299 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); | 2297 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); |
2300 else | 2298 else |
2301 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); | 2299 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); |
2302 } | 2300 } |
2303 | 2301 |
2304 } // namespace media | 2302 } // namespace media |
OLD | NEW |