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

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

Issue 10800041: Update media duration if data is appended after the previous duration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/media/webmediaplayer_impl.h" 5 #include "webkit/media/webmediaplayer_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 877
878 case media::PIPELINE_STATUS_MAX: 878 case media::PIPELINE_STATUS_MAX:
879 NOTREACHED() << "PIPELINE_STATUS_MAX isn't a real error!"; 879 NOTREACHED() << "PIPELINE_STATUS_MAX isn't a real error!";
880 break; 880 break;
881 } 881 }
882 882
883 // Repaint to trigger UI update. 883 // Repaint to trigger UI update.
884 Repaint(); 884 Repaint();
885 } 885 }
886 886
887 void WebMediaPlayerImpl::OnPipelineDurationChanged() {
888 DCHECK_EQ(main_loop_, MessageLoop::current());
889
890 GetClient()->durationChanged();
891 }
892
887 void WebMediaPlayerImpl::OnDemuxerOpened() { 893 void WebMediaPlayerImpl::OnDemuxerOpened() {
888 DCHECK_EQ(main_loop_, MessageLoop::current()); 894 DCHECK_EQ(main_loop_, MessageLoop::current());
889 895
890 GetClient()->sourceOpened(); 896 GetClient()->sourceOpened();
891 } 897 }
892 898
893 void WebMediaPlayerImpl::OnKeyAdded(const std::string& key_system, 899 void WebMediaPlayerImpl::OnKeyAdded(const std::string& key_system,
894 const std::string& session_id) { 900 const std::string& session_id) {
895 DCHECK_EQ(main_loop_, MessageLoop::current()); 901 DCHECK_EQ(main_loop_, MessageLoop::current());
896 902
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 "is_downloading_data", is_downloading)); 986 "is_downloading_data", is_downloading));
981 } 987 }
982 988
983 void WebMediaPlayerImpl::StartPipeline() { 989 void WebMediaPlayerImpl::StartPipeline() {
984 started_ = true; 990 started_ = true;
985 pipeline_->Start( 991 pipeline_->Start(
986 filter_collection_.Pass(), 992 filter_collection_.Pass(),
987 base::Bind(&WebMediaPlayerProxy::PipelineEndedCallback, proxy_.get()), 993 base::Bind(&WebMediaPlayerProxy::PipelineEndedCallback, proxy_.get()),
988 base::Bind(&WebMediaPlayerProxy::PipelineErrorCallback, proxy_.get()), 994 base::Bind(&WebMediaPlayerProxy::PipelineErrorCallback, proxy_.get()),
989 base::Bind(&WebMediaPlayerProxy::PipelineInitializationCallback, 995 base::Bind(&WebMediaPlayerProxy::PipelineInitializationCallback,
996 proxy_.get()),
997 base::Bind(&WebMediaPlayerProxy::PipelineDurationChangedCallback,
990 proxy_.get())); 998 proxy_.get()));
991 } 999 }
992 1000
993 void WebMediaPlayerImpl::SetNetworkState(WebMediaPlayer::NetworkState state) { 1001 void WebMediaPlayerImpl::SetNetworkState(WebMediaPlayer::NetworkState state) {
994 DCHECK_EQ(main_loop_, MessageLoop::current()); 1002 DCHECK_EQ(main_loop_, MessageLoop::current());
995 DVLOG(1) << "SetNetworkState: " << state; 1003 DVLOG(1) << "SetNetworkState: " << state;
996 network_state_ = state; 1004 network_state_ = state;
997 // Always notify to ensure client has the latest value. 1005 // Always notify to ensure client has the latest value.
998 GetClient()->networkStateChanged(); 1006 GetClient()->networkStateChanged();
999 } 1007 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 return audio_source_provider_; 1060 return audio_source_provider_;
1053 } 1061 }
1054 1062
1055 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { 1063 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() {
1056 DCHECK_EQ(main_loop_, MessageLoop::current()); 1064 DCHECK_EQ(main_loop_, MessageLoop::current());
1057 incremented_externally_allocated_memory_ = true; 1065 incremented_externally_allocated_memory_ = true;
1058 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); 1066 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory);
1059 } 1067 }
1060 1068
1061 } // namespace webkit_media 1069 } // namespace webkit_media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698