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 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1110 else if (is_downloading && network_state_ == WebMediaPlayer::NetworkStateIdle) | 1110 else if (is_downloading && network_state_ == WebMediaPlayer::NetworkStateIdle) |
1111 SetNetworkState(WebMediaPlayer::NetworkStateLoading); | 1111 SetNetworkState(WebMediaPlayer::NetworkStateLoading); |
1112 media_log_->AddEvent( | 1112 media_log_->AddEvent( |
1113 media_log_->CreateBooleanEvent( | 1113 media_log_->CreateBooleanEvent( |
1114 media::MediaLogEvent::NETWORK_ACTIVITY_SET, | 1114 media::MediaLogEvent::NETWORK_ACTIVITY_SET, |
1115 "is_downloading_data", is_downloading)); | 1115 "is_downloading_data", is_downloading)); |
1116 } | 1116 } |
1117 | 1117 |
1118 void WebMediaPlayerImpl::StartPipeline() { | 1118 void WebMediaPlayerImpl::StartPipeline() { |
1119 starting_ = true; | 1119 starting_ = true; |
| 1120 |
| 1121 media::RequestDecryptorNotificationCB request_decryptor_notification_cb; |
| 1122 if (decryptor_) { |
| 1123 request_decryptor_notification_cb = |
| 1124 base::Bind(&ProxyDecryptor::RequestDecryptorNotification, |
| 1125 base::Unretained(decryptor_.get())); |
| 1126 } |
| 1127 |
1120 pipeline_->Start( | 1128 pipeline_->Start( |
1121 filter_collection_.Pass(), | 1129 filter_collection_.Pass(), |
1122 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineEnded), | 1130 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineEnded), |
1123 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineError), | 1131 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineError), |
1124 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineSeek), | 1132 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineSeek), |
1125 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineBufferingState)); | 1133 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineBufferingState), |
| 1134 request_decryptor_notification_cb); |
1126 } | 1135 } |
1127 | 1136 |
1128 void WebMediaPlayerImpl::SetNetworkState(WebMediaPlayer::NetworkState state) { | 1137 void WebMediaPlayerImpl::SetNetworkState(WebMediaPlayer::NetworkState state) { |
1129 DCHECK_EQ(main_loop_, MessageLoop::current()); | 1138 DCHECK_EQ(main_loop_, MessageLoop::current()); |
1130 DVLOG(1) << "SetNetworkState: " << state; | 1139 DVLOG(1) << "SetNetworkState: " << state; |
1131 network_state_ = state; | 1140 network_state_ = state; |
1132 // Always notify to ensure client has the latest value. | 1141 // Always notify to ensure client has the latest value. |
1133 GetClient()->networkStateChanged(); | 1142 GetClient()->networkStateChanged(); |
1134 } | 1143 } |
1135 | 1144 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 return audio_source_provider_; | 1208 return audio_source_provider_; |
1200 } | 1209 } |
1201 | 1210 |
1202 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 1211 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
1203 DCHECK_EQ(main_loop_, MessageLoop::current()); | 1212 DCHECK_EQ(main_loop_, MessageLoop::current()); |
1204 incremented_externally_allocated_memory_ = true; | 1213 incremented_externally_allocated_memory_ = true; |
1205 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 1214 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
1206 } | 1215 } |
1207 | 1216 |
1208 } // namespace webkit_media | 1217 } // namespace webkit_media |
OLD | NEW |