| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/media/webmediaplayer_impl.h" | 5 #include "webkit/renderer/media/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 supports_save_(true), | 146 supports_save_(true), |
| 147 starting_(false), | 147 starting_(false), |
| 148 chunk_demuxer_(NULL), | 148 chunk_demuxer_(NULL), |
| 149 pending_repaint_(false), | 149 pending_repaint_(false), |
| 150 pending_size_change_(false), | 150 pending_size_change_(false), |
| 151 video_frame_provider_client_(NULL), | 151 video_frame_provider_client_(NULL), |
| 152 text_track_index_(0) { | 152 text_track_index_(0) { |
| 153 media_log_->AddEvent( | 153 media_log_->AddEvent( |
| 154 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); | 154 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); |
| 155 | 155 |
| 156 pipeline_.reset(new media::Pipeline(media_loop_, media_log_)); | 156 pipeline_.reset(new media::Pipeline(media_loop_, media_log_.get())); |
| 157 | 157 |
| 158 // Let V8 know we started new thread if we did not do it yet. | 158 // Let V8 know we started new thread if we did not do it yet. |
| 159 // Made separate task to avoid deletion of player currently being created. | 159 // Made separate task to avoid deletion of player currently being created. |
| 160 // Also, delaying GC until after player starts gets rid of starting lag -- | 160 // Also, delaying GC until after player starts gets rid of starting lag -- |
| 161 // collection happens in parallel with playing. | 161 // collection happens in parallel with playing. |
| 162 // | 162 // |
| 163 // TODO(enal): remove when we get rid of per-audio-stream thread. | 163 // TODO(enal): remove when we get rid of per-audio-stream thread. |
| 164 main_loop_->PostTask( | 164 main_loop_->PostTask( |
| 165 FROM_HERE, | 165 FROM_HERE, |
| 166 base::Bind(&WebMediaPlayerImpl::IncrementExternallyAllocatedMemory, | 166 base::Bind(&WebMediaPlayerImpl::IncrementExternallyAllocatedMemory, |
| (...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1212 | 1212 |
| 1213 if (pending_repaint_) | 1213 if (pending_repaint_) |
| 1214 return; | 1214 return; |
| 1215 | 1215 |
| 1216 pending_repaint_ = true; | 1216 pending_repaint_ = true; |
| 1217 main_loop_->PostTask(FROM_HERE, base::Bind( | 1217 main_loop_->PostTask(FROM_HERE, base::Bind( |
| 1218 &WebMediaPlayerImpl::Repaint, AsWeakPtr())); | 1218 &WebMediaPlayerImpl::Repaint, AsWeakPtr())); |
| 1219 } | 1219 } |
| 1220 | 1220 |
| 1221 } // namespace webkit_media | 1221 } // namespace webkit_media |
| OLD | NEW |