| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 } | 98 } |
| 99 return result; | 99 return result; |
| 100 } | 100 } |
| 101 | 101 |
| 102 WebMediaPlayerImpl::WebMediaPlayerImpl( | 102 WebMediaPlayerImpl::WebMediaPlayerImpl( |
| 103 WebKit::WebFrame* frame, | 103 WebKit::WebFrame* frame, |
| 104 WebKit::WebMediaPlayerClient* client, | 104 WebKit::WebMediaPlayerClient* client, |
| 105 base::WeakPtr<WebMediaPlayerDelegate> delegate, | 105 base::WeakPtr<WebMediaPlayerDelegate> delegate, |
| 106 media::FilterCollection* collection, | 106 media::FilterCollection* collection, |
| 107 WebKit::WebAudioSourceProvider* audio_source_provider, | 107 WebKit::WebAudioSourceProvider* audio_source_provider, |
| 108 media::AudioRendererSink* audio_renderer_sink, |
| 108 media::MessageLoopFactory* message_loop_factory, | 109 media::MessageLoopFactory* message_loop_factory, |
| 109 MediaStreamClient* media_stream_client, | 110 MediaStreamClient* media_stream_client, |
| 110 media::MediaLog* media_log) | 111 media::MediaLog* media_log) |
| 111 : frame_(frame), | 112 : frame_(frame), |
| 112 network_state_(WebMediaPlayer::NetworkStateEmpty), | 113 network_state_(WebMediaPlayer::NetworkStateEmpty), |
| 113 ready_state_(WebMediaPlayer::ReadyStateHaveNothing), | 114 ready_state_(WebMediaPlayer::ReadyStateHaveNothing), |
| 114 main_loop_(MessageLoop::current()), | 115 main_loop_(MessageLoop::current()), |
| 115 filter_collection_(collection), | 116 filter_collection_(collection), |
| 116 started_(false), | 117 started_(false), |
| 117 message_loop_factory_(message_loop_factory), | 118 message_loop_factory_(message_loop_factory), |
| 118 paused_(true), | 119 paused_(true), |
| 119 seeking_(false), | 120 seeking_(false), |
| 120 playback_rate_(0.0f), | 121 playback_rate_(0.0f), |
| 121 pending_seek_(false), | 122 pending_seek_(false), |
| 122 pending_seek_seconds_(0.0f), | 123 pending_seek_seconds_(0.0f), |
| 123 client_(client), | 124 client_(client), |
| 124 proxy_(new WebMediaPlayerProxy(main_loop_->message_loop_proxy(), this)), | 125 proxy_(new WebMediaPlayerProxy(main_loop_->message_loop_proxy(), this)), |
| 125 delegate_(delegate), | 126 delegate_(delegate), |
| 126 media_stream_client_(media_stream_client), | 127 media_stream_client_(media_stream_client), |
| 127 media_log_(media_log), | 128 media_log_(media_log), |
| 128 accelerated_compositing_reported_(false), | 129 accelerated_compositing_reported_(false), |
| 129 incremented_externally_allocated_memory_(false), | 130 incremented_externally_allocated_memory_(false), |
| 130 audio_source_provider_(audio_source_provider), | 131 audio_source_provider_(audio_source_provider), |
| 132 audio_renderer_sink_(audio_renderer_sink), |
| 131 is_local_source_(false), | 133 is_local_source_(false), |
| 132 decryptor_(proxy_.get()) { | 134 decryptor_(proxy_.get()) { |
| 133 media_log_->AddEvent( | 135 media_log_->AddEvent( |
| 134 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); | 136 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); |
| 135 | 137 |
| 136 MessageLoop* pipeline_message_loop = | 138 MessageLoop* pipeline_message_loop = |
| 137 message_loop_factory_->GetMessageLoop("PipelineThread"); | 139 message_loop_factory_->GetMessageLoop("PipelineThread"); |
| 138 pipeline_ = new media::Pipeline(pipeline_message_loop, media_log_); | 140 pipeline_ = new media::Pipeline(pipeline_message_loop, media_log_); |
| 139 | 141 |
| 140 // Let V8 know we started new thread if we did not did it yet. | 142 // Let V8 know we started new thread if we did not did it yet. |
| (...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1042 return audio_source_provider_; | 1044 return audio_source_provider_; |
| 1043 } | 1045 } |
| 1044 | 1046 |
| 1045 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 1047 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
| 1046 DCHECK_EQ(main_loop_, MessageLoop::current()); | 1048 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 1047 incremented_externally_allocated_memory_ = true; | 1049 incremented_externally_allocated_memory_ = true; |
| 1048 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 1050 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
| 1049 } | 1051 } |
| 1050 | 1052 |
| 1051 } // namespace webkit_media | 1053 } // namespace webkit_media |
| OLD | NEW |