Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Side by Side Diff: webkit/glue/webmediaplayer_impl.cc

Issue 7074018: Implement Chromium version of WebCore::MediaPlayer::mediaTimeForTimeValue() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/glue/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webkit/glue/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698