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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 accelerated_compositing_reported_(false), | 129 accelerated_compositing_reported_(false), |
130 incremented_externally_allocated_memory_(false), | 130 incremented_externally_allocated_memory_(false), |
131 audio_source_provider_(audio_source_provider), | 131 audio_source_provider_(audio_source_provider), |
132 audio_renderer_sink_(audio_renderer_sink), | 132 audio_renderer_sink_(audio_renderer_sink), |
133 is_local_source_(false), | 133 is_local_source_(false), |
134 supports_save_(true), | 134 supports_save_(true), |
135 decryptor_(proxy_.get(), client, frame) { | 135 decryptor_(proxy_.get(), client, frame) { |
136 media_log_->AddEvent( | 136 media_log_->AddEvent( |
137 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); | 137 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); |
138 | 138 |
139 MessageLoop* pipeline_message_loop = | 139 scoped_refptr<base::MessageLoopProxy> pipeline_message_loop = |
140 message_loop_factory_->GetMessageLoop("PipelineThread"); | 140 message_loop_factory_->GetMessageLoop( |
| 141 media::MessageLoopFactory::kPipeline); |
141 pipeline_ = new media::Pipeline(pipeline_message_loop, media_log_); | 142 pipeline_ = new media::Pipeline(pipeline_message_loop, media_log_); |
142 | 143 |
143 // Let V8 know we started new thread if we did not did it yet. | 144 // Let V8 know we started new thread if we did not did it yet. |
144 // Made separate task to avoid deletion of player currently being created. | 145 // Made separate task to avoid deletion of player currently being created. |
145 // Also, delaying GC until after player starts gets rid of starting lag -- | 146 // Also, delaying GC until after player starts gets rid of starting lag -- |
146 // collection happens in parallel with playing. | 147 // collection happens in parallel with playing. |
147 // | 148 // |
148 // TODO(enal): remove when we get rid of per-audio-stream thread. | 149 // TODO(enal): remove when we get rid of per-audio-stream thread. |
149 MessageLoop::current()->PostTask( | 150 MessageLoop::current()->PostTask( |
150 FROM_HERE, | 151 FROM_HERE, |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 return audio_source_provider_; | 1030 return audio_source_provider_; |
1030 } | 1031 } |
1031 | 1032 |
1032 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 1033 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
1033 DCHECK_EQ(main_loop_, MessageLoop::current()); | 1034 DCHECK_EQ(main_loop_, MessageLoop::current()); |
1034 incremented_externally_allocated_memory_ = true; | 1035 incremented_externally_allocated_memory_ = true; |
1035 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 1036 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
1036 } | 1037 } |
1037 | 1038 |
1038 } // namespace webkit_media | 1039 } // namespace webkit_media |
OLD | NEW |