OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/glue/webmediaplayer_impl.h" | 5 #include "webkit/glue/webmediaplayer_impl.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 DCHECK(MessageLoop::current() == main_loop_); | 707 DCHECK(MessageLoop::current() == main_loop_); |
708 | 708 |
709 // TODO(hclam): If the pipeline is performing streaming, we say that this is | 709 // TODO(hclam): If the pipeline is performing streaming, we say that this is |
710 // a live stream. But instead it should be a StoredStream if we have proper | 710 // a live stream. But instead it should be a StoredStream if we have proper |
711 // caching. | 711 // caching. |
712 if (pipeline_->IsStreaming()) | 712 if (pipeline_->IsStreaming()) |
713 return WebKit::WebMediaPlayer::LiveStream; | 713 return WebKit::WebMediaPlayer::LiveStream; |
714 return WebKit::WebMediaPlayer::Unknown; | 714 return WebKit::WebMediaPlayer::Unknown; |
715 } | 715 } |
716 | 716 |
| 717 float WebMediaPlayerImpl::mediaTimeForTimeValue(float timeValue) const { |
| 718 return ConvertSecondsToTimestamp(timeValue).InSecondsF(); |
| 719 } |
| 720 |
717 unsigned WebMediaPlayerImpl::decodedFrameCount() const { | 721 unsigned WebMediaPlayerImpl::decodedFrameCount() const { |
718 DCHECK(MessageLoop::current() == main_loop_); | 722 DCHECK(MessageLoop::current() == main_loop_); |
719 | 723 |
720 media::PipelineStatistics stats = pipeline_->GetStatistics(); | 724 media::PipelineStatistics stats = pipeline_->GetStatistics(); |
721 return stats.video_frames_decoded; | 725 return stats.video_frames_decoded; |
722 } | 726 } |
723 | 727 |
724 unsigned WebMediaPlayerImpl::droppedFrameCount() const { | 728 unsigned WebMediaPlayerImpl::droppedFrameCount() const { |
725 DCHECK(MessageLoop::current() == main_loop_); | 729 DCHECK(MessageLoop::current() == main_loop_); |
726 | 730 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 } | 926 } |
923 } | 927 } |
924 | 928 |
925 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() { | 929 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() { |
926 DCHECK(MessageLoop::current() == main_loop_); | 930 DCHECK(MessageLoop::current() == main_loop_); |
927 DCHECK(client_); | 931 DCHECK(client_); |
928 return client_; | 932 return client_; |
929 } | 933 } |
930 | 934 |
931 } // namespace webkit_glue | 935 } // namespace webkit_glue |
OLD | NEW |