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

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: . Created 8 years, 4 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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 880
881 case media::PIPELINE_STATUS_MAX: 881 case media::PIPELINE_STATUS_MAX:
882 NOTREACHED() << "PIPELINE_STATUS_MAX isn't a real error!"; 882 NOTREACHED() << "PIPELINE_STATUS_MAX isn't a real error!";
883 break; 883 break;
884 } 884 }
885 885
886 // Repaint to trigger UI update. 886 // Repaint to trigger UI update.
887 Repaint(); 887 Repaint();
888 } 888 }
889 889
890 void WebMediaPlayerImpl::OnPipelineDurationChanged() {
891 DCHECK_EQ(main_loop_, MessageLoop::current());
892
893 GetClient()->durationChanged();
894 }
895
890 void WebMediaPlayerImpl::OnDemuxerOpened() { 896 void WebMediaPlayerImpl::OnDemuxerOpened() {
891 DCHECK_EQ(main_loop_, MessageLoop::current()); 897 DCHECK_EQ(main_loop_, MessageLoop::current());
892 898
893 GetClient()->sourceOpened(); 899 GetClient()->sourceOpened();
894 } 900 }
895 901
896 void WebMediaPlayerImpl::OnKeyAdded(const std::string& key_system, 902 void WebMediaPlayerImpl::OnKeyAdded(const std::string& key_system,
897 const std::string& session_id) { 903 const std::string& session_id) {
898 DCHECK_EQ(main_loop_, MessageLoop::current()); 904 DCHECK_EQ(main_loop_, MessageLoop::current());
899 905
(...skipping 80 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