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 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 else if (is_downloading && network_state_ == WebMediaPlayer::NetworkStateIdle) | 1117 else if (is_downloading && network_state_ == WebMediaPlayer::NetworkStateIdle) |
1118 SetNetworkState(WebMediaPlayer::NetworkStateLoading); | 1118 SetNetworkState(WebMediaPlayer::NetworkStateLoading); |
1119 media_log_->AddEvent( | 1119 media_log_->AddEvent( |
1120 media_log_->CreateBooleanEvent( | 1120 media_log_->CreateBooleanEvent( |
1121 media::MediaLogEvent::NETWORK_ACTIVITY_SET, | 1121 media::MediaLogEvent::NETWORK_ACTIVITY_SET, |
1122 "is_downloading_data", is_downloading)); | 1122 "is_downloading_data", is_downloading)); |
1123 } | 1123 } |
1124 | 1124 |
1125 void WebMediaPlayerImpl::StartPipeline() { | 1125 void WebMediaPlayerImpl::StartPipeline() { |
1126 starting_ = true; | 1126 starting_ = true; |
| 1127 |
| 1128 media::SetDecryptorReadyCB set_decryptor_ready_cb; |
| 1129 if (decryptor_) { |
| 1130 set_decryptor_ready_cb = |
| 1131 base::Bind(&ProxyDecryptor::RegisterDecryptorReadyNotification, |
| 1132 base::Unretained(decryptor_.get())); |
| 1133 } |
| 1134 |
1127 pipeline_->Start( | 1135 pipeline_->Start( |
1128 filter_collection_.Pass(), | 1136 filter_collection_.Pass(), |
1129 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineEnded), | 1137 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineEnded), |
1130 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineError), | 1138 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineError), |
1131 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineSeek), | 1139 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineSeek), |
1132 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineBufferingState)); | 1140 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineBufferingState), |
| 1141 set_decryptor_ready_cb); |
1133 } | 1142 } |
1134 | 1143 |
1135 void WebMediaPlayerImpl::SetNetworkState(WebMediaPlayer::NetworkState state) { | 1144 void WebMediaPlayerImpl::SetNetworkState(WebMediaPlayer::NetworkState state) { |
1136 DCHECK_EQ(main_loop_, MessageLoop::current()); | 1145 DCHECK_EQ(main_loop_, MessageLoop::current()); |
1137 DVLOG(1) << "SetNetworkState: " << state; | 1146 DVLOG(1) << "SetNetworkState: " << state; |
1138 network_state_ = state; | 1147 network_state_ = state; |
1139 // Always notify to ensure client has the latest value. | 1148 // Always notify to ensure client has the latest value. |
1140 GetClient()->networkStateChanged(); | 1149 GetClient()->networkStateChanged(); |
1141 } | 1150 } |
1142 | 1151 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 return audio_source_provider_; | 1215 return audio_source_provider_; |
1207 } | 1216 } |
1208 | 1217 |
1209 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 1218 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
1210 DCHECK_EQ(main_loop_, MessageLoop::current()); | 1219 DCHECK_EQ(main_loop_, MessageLoop::current()); |
1211 incremented_externally_allocated_memory_ = true; | 1220 incremented_externally_allocated_memory_ = true; |
1212 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 1221 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
1213 } | 1222 } |
1214 | 1223 |
1215 } // namespace webkit_media | 1224 } // namespace webkit_media |
OLD | NEW |