OLD | NEW |
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 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 | 882 |
883 case media::PIPELINE_STATUS_MAX: | 883 case media::PIPELINE_STATUS_MAX: |
884 NOTREACHED() << "PIPELINE_STATUS_MAX isn't a real error!"; | 884 NOTREACHED() << "PIPELINE_STATUS_MAX isn't a real error!"; |
885 break; | 885 break; |
886 } | 886 } |
887 | 887 |
888 // Repaint to trigger UI update. | 888 // Repaint to trigger UI update. |
889 Repaint(); | 889 Repaint(); |
890 } | 890 } |
891 | 891 |
| 892 void WebMediaPlayerImpl::OnPipelineDurationChanged() { |
| 893 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 894 |
| 895 GetClient()->durationChanged(); |
| 896 } |
| 897 |
892 void WebMediaPlayerImpl::OnDemuxerOpened() { | 898 void WebMediaPlayerImpl::OnDemuxerOpened() { |
893 DCHECK_EQ(main_loop_, MessageLoop::current()); | 899 DCHECK_EQ(main_loop_, MessageLoop::current()); |
894 | 900 |
895 GetClient()->sourceOpened(); | 901 GetClient()->sourceOpened(); |
896 } | 902 } |
897 | 903 |
898 void WebMediaPlayerImpl::OnKeyAdded(const std::string& key_system, | 904 void WebMediaPlayerImpl::OnKeyAdded(const std::string& key_system, |
899 const std::string& session_id) { | 905 const std::string& session_id) { |
900 DCHECK_EQ(main_loop_, MessageLoop::current()); | 906 DCHECK_EQ(main_loop_, MessageLoop::current()); |
901 | 907 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 "is_downloading_data", is_downloading)); | 991 "is_downloading_data", is_downloading)); |
986 } | 992 } |
987 | 993 |
988 void WebMediaPlayerImpl::StartPipeline() { | 994 void WebMediaPlayerImpl::StartPipeline() { |
989 started_ = true; | 995 started_ = true; |
990 pipeline_->Start( | 996 pipeline_->Start( |
991 filter_collection_.Pass(), | 997 filter_collection_.Pass(), |
992 base::Bind(&WebMediaPlayerProxy::PipelineEndedCallback, proxy_.get()), | 998 base::Bind(&WebMediaPlayerProxy::PipelineEndedCallback, proxy_.get()), |
993 base::Bind(&WebMediaPlayerProxy::PipelineErrorCallback, proxy_.get()), | 999 base::Bind(&WebMediaPlayerProxy::PipelineErrorCallback, proxy_.get()), |
994 base::Bind(&WebMediaPlayerProxy::PipelineInitializationCallback, | 1000 base::Bind(&WebMediaPlayerProxy::PipelineInitializationCallback, |
| 1001 proxy_.get()), |
| 1002 base::Bind(&WebMediaPlayerProxy::PipelineDurationChangedCallback, |
995 proxy_.get())); | 1003 proxy_.get())); |
996 } | 1004 } |
997 | 1005 |
998 void WebMediaPlayerImpl::SetNetworkState(WebMediaPlayer::NetworkState state) { | 1006 void WebMediaPlayerImpl::SetNetworkState(WebMediaPlayer::NetworkState state) { |
999 DCHECK_EQ(main_loop_, MessageLoop::current()); | 1007 DCHECK_EQ(main_loop_, MessageLoop::current()); |
1000 DVLOG(1) << "SetNetworkState: " << state; | 1008 DVLOG(1) << "SetNetworkState: " << state; |
1001 network_state_ = state; | 1009 network_state_ = state; |
1002 // Always notify to ensure client has the latest value. | 1010 // Always notify to ensure client has the latest value. |
1003 GetClient()->networkStateChanged(); | 1011 GetClient()->networkStateChanged(); |
1004 } | 1012 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 return audio_source_provider_; | 1065 return audio_source_provider_; |
1058 } | 1066 } |
1059 | 1067 |
1060 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 1068 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
1061 DCHECK_EQ(main_loop_, MessageLoop::current()); | 1069 DCHECK_EQ(main_loop_, MessageLoop::current()); |
1062 incremented_externally_allocated_memory_ = true; | 1070 incremented_externally_allocated_memory_ = true; |
1063 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 1071 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
1064 } | 1072 } |
1065 | 1073 |
1066 } // namespace webkit_media | 1074 } // namespace webkit_media |
OLD | NEW |