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 "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> |
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 DCHECK(main_loop_->BelongsToCurrentThread()); | 1208 DCHECK(main_loop_->BelongsToCurrentThread()); |
1209 | 1209 |
1210 // Abort any pending IO so stopping the pipeline doesn't get blocked. | 1210 // Abort any pending IO so stopping the pipeline doesn't get blocked. |
1211 if (data_source_) | 1211 if (data_source_) |
1212 data_source_->Abort(); | 1212 data_source_->Abort(); |
1213 if (chunk_demuxer_) { | 1213 if (chunk_demuxer_) { |
1214 chunk_demuxer_->Shutdown(); | 1214 chunk_demuxer_->Shutdown(); |
1215 chunk_demuxer_ = NULL; | 1215 chunk_demuxer_ = NULL; |
1216 } | 1216 } |
1217 | 1217 |
1218 if (gpu_factories_.get()) { | 1218 gpu_factories_ = NULL; |
1219 gpu_factories_->Abort(); | |
1220 gpu_factories_ = NULL; | |
1221 } | |
1222 | 1219 |
1223 // Make sure to kill the pipeline so there's no more media threads running. | 1220 // Make sure to kill the pipeline so there's no more media threads running. |
1224 // Note: stopping the pipeline might block for a long time. | 1221 // Note: stopping the pipeline might block for a long time. |
1225 base::WaitableEvent waiter(false, false); | 1222 base::WaitableEvent waiter(false, false); |
1226 pipeline_->Stop(base::Bind( | 1223 pipeline_->Stop(base::Bind( |
1227 &base::WaitableEvent::Signal, base::Unretained(&waiter))); | 1224 &base::WaitableEvent::Signal, base::Unretained(&waiter))); |
1228 waiter.Wait(); | 1225 waiter.Wait(); |
1229 | 1226 |
1230 // Let V8 know we are not using extra resources anymore. | 1227 // Let V8 know we are not using extra resources anymore. |
1231 if (incremented_externally_allocated_memory_) { | 1228 if (incremented_externally_allocated_memory_) { |
(...skipping 86 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 | 1315 // 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. | 1316 // even gotten the chance to request a repaint for it yet. Mark it as dropped. |
1320 TRACE_EVENT0("media", "WebMediaPlayerImpl:frameDropped"); | 1317 TRACE_EVENT0("media", "WebMediaPlayerImpl:frameDropped"); |
1321 DVLOG(1) << "Frame dropped before being painted: " | 1318 DVLOG(1) << "Frame dropped before being painted: " |
1322 << current_frame_->GetTimestamp().InSecondsF(); | 1319 << current_frame_->GetTimestamp().InSecondsF(); |
1323 if (frames_dropped_before_paint_ < kuint32max) | 1320 if (frames_dropped_before_paint_ < kuint32max) |
1324 frames_dropped_before_paint_++; | 1321 frames_dropped_before_paint_++; |
1325 } | 1322 } |
1326 | 1323 |
1327 } // namespace content | 1324 } // namespace content |
OLD | NEW |