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 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
695 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 695 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
696 | 696 |
697 base::Optional<MediaTrack::Id> selected_video_track_id; | 697 base::Optional<MediaTrack::Id> selected_video_track_id; |
698 if (selectedTrackId && !video_track_disabled_) | 698 if (selectedTrackId && !video_track_disabled_) |
699 selected_video_track_id = MediaTrack::Id(selectedTrackId->utf8().data()); | 699 selected_video_track_id = MediaTrack::Id(selectedTrackId->utf8().data()); |
700 MEDIA_LOG(INFO, media_log_) << "Selected video track: [" | 700 MEDIA_LOG(INFO, media_log_) << "Selected video track: [" |
701 << selected_video_track_id.value_or("") << "]"; | 701 << selected_video_track_id.value_or("") << "]"; |
702 pipeline_controller_.OnSelectedVideoTrackChanged(selected_video_track_id); | 702 pipeline_controller_.OnSelectedVideoTrackChanged(selected_video_track_id); |
703 } | 703 } |
704 | 704 |
705 bool WebMediaPlayerImpl::getCurrentFrameInfo(unsigned* width, | |
706 unsigned* height, | |
707 double* timestamp) { | |
708 scoped_refptr<VideoFrame> video_frame = GetCurrentFrameFromCompositor(); | |
Ken Russell (switch to Gerrit)
2017/03/15 04:41:50
As Dale points out, this isn't guaranteed to be co
| |
709 *width = video_frame->natural_size().width(); | |
710 *height = video_frame->natural_size().height(); | |
711 *timestamp = video_frame->timestamp().InSecondsF(); | |
712 return true; | |
713 } | |
714 | |
705 blink::WebSize WebMediaPlayerImpl::naturalSize() const { | 715 blink::WebSize WebMediaPlayerImpl::naturalSize() const { |
706 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 716 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
707 | 717 |
708 return blink::WebSize(pipeline_metadata_.natural_size); | 718 return blink::WebSize(pipeline_metadata_.natural_size); |
709 } | 719 } |
710 | 720 |
711 bool WebMediaPlayerImpl::paused() const { | 721 bool WebMediaPlayerImpl::paused() const { |
712 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 722 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
713 | 723 |
714 #if defined(OS_ANDROID) // WMPI_CAST | 724 #if defined(OS_ANDROID) // WMPI_CAST |
(...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2320 | 2330 |
2321 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { | 2331 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { |
2322 DCHECK(data_source_ || chunk_demuxer_); | 2332 DCHECK(data_source_ || chunk_demuxer_); |
2323 if (data_source_) | 2333 if (data_source_) |
2324 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); | 2334 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); |
2325 else | 2335 else |
2326 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); | 2336 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); |
2327 } | 2337 } |
2328 | 2338 |
2329 } // namespace media | 2339 } // namespace media |
OLD | NEW |