OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
Ami GONE FROM CHROMIUM
2013/11/08 16:54:46
What about content/common/gpu/media ?
scherkus (not reviewing)
2013/11/08 21:51:39
I compiled the world and nothing broke. Try bots s
| |
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 "content/renderer/media/webmediaplayer_impl.h" | 5 #include "content/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> |
11 | 11 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 pending_repaint_(false), | 159 pending_repaint_(false), |
160 pending_size_change_(false), | 160 pending_size_change_(false), |
161 video_frame_provider_client_(NULL), | 161 video_frame_provider_client_(NULL), |
162 text_track_index_(0) { | 162 text_track_index_(0) { |
163 media_log_->AddEvent( | 163 media_log_->AddEvent( |
164 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); | 164 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); |
165 | 165 |
166 pipeline_.reset(new media::Pipeline(media_loop_, media_log_.get())); | 166 pipeline_.reset(new media::Pipeline(media_loop_, media_log_.get())); |
167 | 167 |
168 // |gpu_factories_| requires that its entry points be called on its | 168 // |gpu_factories_| requires that its entry points be called on its |
169 // |GetMessageLoop()|. Since |pipeline_| will own decoders created from the | 169 // |GetTaskRunner()|. Since |pipeline_| will own decoders created from the |
170 // factories, require that their message loops are identical. | 170 // factories, require that their message loops are identical. |
171 DCHECK(!gpu_factories_ || (gpu_factories_->GetMessageLoop() == media_loop_)); | 171 DCHECK(!gpu_factories_ || (gpu_factories_->GetTaskRunner() == media_loop_)); |
172 | 172 |
173 // Let V8 know we started new thread if we did not do it yet. | 173 // Let V8 know we started new thread if we did not do it yet. |
174 // Made separate task to avoid deletion of player currently being created. | 174 // Made separate task to avoid deletion of player currently being created. |
175 // Also, delaying GC until after player starts gets rid of starting lag -- | 175 // Also, delaying GC until after player starts gets rid of starting lag -- |
176 // collection happens in parallel with playing. | 176 // collection happens in parallel with playing. |
177 // | 177 // |
178 // TODO(enal): remove when we get rid of per-audio-stream thread. | 178 // TODO(enal): remove when we get rid of per-audio-stream thread. |
179 main_loop_->PostTask( | 179 main_loop_->PostTask( |
180 FROM_HERE, | 180 FROM_HERE, |
181 base::Bind(&WebMediaPlayerImpl::IncrementExternallyAllocatedMemory, | 181 base::Bind(&WebMediaPlayerImpl::IncrementExternallyAllocatedMemory, |
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1318 // The |current_frame_| wasn't painted, it is being replaced, and we haven't | 1318 // The |current_frame_| wasn't painted, it is being replaced, and we haven't |
1319 // even gotten the chance to request a repaint for it yet. Mark it as dropped. | 1319 // even gotten the chance to request a repaint for it yet. Mark it as dropped. |
1320 TRACE_EVENT0("media", "WebMediaPlayerImpl:frameDropped"); | 1320 TRACE_EVENT0("media", "WebMediaPlayerImpl:frameDropped"); |
1321 DVLOG(1) << "Frame dropped before being painted: " | 1321 DVLOG(1) << "Frame dropped before being painted: " |
1322 << current_frame_->GetTimestamp().InSecondsF(); | 1322 << current_frame_->GetTimestamp().InSecondsF(); |
1323 if (frames_dropped_before_paint_ < kuint32max) | 1323 if (frames_dropped_before_paint_ < kuint32max) |
1324 frames_dropped_before_paint_++; | 1324 frames_dropped_before_paint_++; |
1325 } | 1325 } |
1326 | 1326 |
1327 } // namespace content | 1327 } // namespace content |
OLD | NEW |