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 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
770 WebMediaPlayer::NetworkState WebMediaPlayerImpl::GetNetworkState() const { | 770 WebMediaPlayer::NetworkState WebMediaPlayerImpl::GetNetworkState() const { |
771 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 771 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
772 return network_state_; | 772 return network_state_; |
773 } | 773 } |
774 | 774 |
775 WebMediaPlayer::ReadyState WebMediaPlayerImpl::GetReadyState() const { | 775 WebMediaPlayer::ReadyState WebMediaPlayerImpl::GetReadyState() const { |
776 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 776 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
777 return ready_state_; | 777 return ready_state_; |
778 } | 778 } |
779 | 779 |
780 blink::WebString WebMediaPlayerImpl::GetErrorMessage() { | 780 std::map<std::string, std::vector<std::string>> |
jochen (gone - plz use gerrit)
2017/04/12 09:16:42
hum, it looks like you really want a base::Value o
wolenetz
2017/04/13 23:59:10
I switched back to just blink::WebString. JSON-enc
| |
781 WebMediaPlayerImpl::GetErrorMessages() const { | |
781 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 782 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
782 return blink::WebString::FromUTF8(media_log_->GetLastErrorMessage()); | 783 return media_log_->GetErrorMessages(); |
783 } | 784 } |
784 | 785 |
785 blink::WebTimeRanges WebMediaPlayerImpl::Buffered() const { | 786 blink::WebTimeRanges WebMediaPlayerImpl::Buffered() const { |
786 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 787 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
787 | 788 |
788 Ranges<base::TimeDelta> buffered_time_ranges = | 789 Ranges<base::TimeDelta> buffered_time_ranges = |
789 pipeline_controller_.GetBufferedTimeRanges(); | 790 pipeline_controller_.GetBufferedTimeRanges(); |
790 | 791 |
791 const base::TimeDelta duration = GetPipelineMediaDuration(); | 792 const base::TimeDelta duration = GetPipelineMediaDuration(); |
792 if (duration != kInfiniteDuration) { | 793 if (duration != kInfiniteDuration) { |
(...skipping 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2338 | 2339 |
2339 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { | 2340 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { |
2340 DCHECK(data_source_ || chunk_demuxer_); | 2341 DCHECK(data_source_ || chunk_demuxer_); |
2341 if (data_source_) | 2342 if (data_source_) |
2342 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); | 2343 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); |
2343 else | 2344 else |
2344 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); | 2345 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); |
2345 } | 2346 } |
2346 | 2347 |
2347 } // namespace media | 2348 } // namespace media |
OLD | NEW |