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 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 media_stream_client_(media_stream_client), | 120 media_stream_client_(media_stream_client), |
121 media_log_(media_log), | 121 media_log_(media_log), |
122 is_accelerated_compositing_active_(false), | 122 is_accelerated_compositing_active_(false), |
123 incremented_externally_allocated_memory_(false), | 123 incremented_externally_allocated_memory_(false), |
124 audio_source_provider_(audio_source_provider) { | 124 audio_source_provider_(audio_source_provider) { |
125 media_log_->AddEvent( | 125 media_log_->AddEvent( |
126 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); | 126 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); |
127 | 127 |
128 MessageLoop* pipeline_message_loop = | 128 MessageLoop* pipeline_message_loop = |
129 message_loop_factory_->GetMessageLoop("PipelineThread"); | 129 message_loop_factory_->GetMessageLoop("PipelineThread"); |
130 CHECK(pipeline_message_loop) << "Failed to create a new thread"; | |
131 pipeline_ = new media::Pipeline(pipeline_message_loop, media_log_); | 130 pipeline_ = new media::Pipeline(pipeline_message_loop, media_log_); |
132 | 131 |
133 // Let V8 know we started new thread if we did not did it yet. | 132 // Let V8 know we started new thread if we did not did it yet. |
134 // Made separate task to avoid deletion of player currently being created. | 133 // Made separate task to avoid deletion of player currently being created. |
135 // Also, delaying GC until after player starts gets rid of starting lag -- | 134 // Also, delaying GC until after player starts gets rid of starting lag -- |
136 // collection happens in parallel with playing. | 135 // collection happens in parallel with playing. |
137 // | 136 // |
138 // TODO(enal): remove when we get rid of per-audio-stream thread. | 137 // TODO(enal): remove when we get rid of per-audio-stream thread. |
139 MessageLoop::current()->PostTask( | 138 MessageLoop::current()->PostTask( |
140 FROM_HERE, | 139 FROM_HERE, |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 return audio_source_provider_; | 898 return audio_source_provider_; |
900 } | 899 } |
901 | 900 |
902 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 901 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
903 DCHECK_EQ(main_loop_, MessageLoop::current()); | 902 DCHECK_EQ(main_loop_, MessageLoop::current()); |
904 incremented_externally_allocated_memory_ = true; | 903 incremented_externally_allocated_memory_ = true; |
905 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 904 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
906 } | 905 } |
907 | 906 |
908 } // namespace webkit_media | 907 } // namespace webkit_media |
OLD | NEW |