Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: media/blink/webmediaplayer_impl.cc

Issue 1999893004: Splits PipelineImpl into main and media thread components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/pipeline_impl_unittest.cc ('k') | media/filters/decoder_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "media/blink/webmediaplayer_impl.h" 5 #include "media/blink/webmediaplayer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <string> 10 #include <string>
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 // e.g. GetCurrentFrameFromCompositor(). See http://crbug.com/434861 223 // e.g. GetCurrentFrameFromCompositor(). See http://crbug.com/434861
224 224
225 // Use the null sink if no sink was provided. 225 // Use the null sink if no sink was provided.
226 audio_source_provider_ = new WebAudioSourceProviderImpl( 226 audio_source_provider_ = new WebAudioSourceProviderImpl(
227 params.audio_renderer_sink().get() 227 params.audio_renderer_sink().get()
228 ? params.audio_renderer_sink() 228 ? params.audio_renderer_sink()
229 : new NullAudioSink(media_task_runner_)); 229 : new NullAudioSink(media_task_runner_));
230 } 230 }
231 231
232 WebMediaPlayerImpl::~WebMediaPlayerImpl() { 232 WebMediaPlayerImpl::~WebMediaPlayerImpl() {
233 client_->setWebLayer(NULL);
234
235 DCHECK(main_task_runner_->BelongsToCurrentThread()); 233 DCHECK(main_task_runner_->BelongsToCurrentThread());
236 234
235 client_->setWebLayer(NULL);
237 if (delegate_) { 236 if (delegate_) {
238 delegate_->PlayerGone(delegate_id_); 237 delegate_->PlayerGone(delegate_id_);
239 delegate_->RemoveObserver(delegate_id_); 238 delegate_->RemoveObserver(delegate_id_);
240 } 239 }
241 240
242 // Abort any pending IO so stopping the pipeline doesn't get blocked.
243 suppress_destruction_errors_ = true; 241 suppress_destruction_errors_ = true;
sandersd (OOO until July 31) 2016/06/03 23:11:45 Probably group this with setWebLayer().
alokp 2016/06/03 23:57:49 Done.
244 if (data_source_)
sandersd (OOO until July 31) 2016/06/03 23:11:45 I don't see any change in PipelineImpl related to
alokp 2016/06/03 23:57:49 I can move these changes to a separate patch if yo
245 data_source_->Abort();
246 if (chunk_demuxer_) {
247 chunk_demuxer_->Shutdown();
248 chunk_demuxer_ = nullptr;
249 }
250
251 renderer_factory_.reset();
252 242
253 // Pipeline must be stopped before it is destroyed. 243 // Pipeline must be stopped before it is destroyed.
254 pipeline_.Stop(); 244 pipeline_.Stop();
255 245
256 if (last_reported_memory_usage_) 246 if (last_reported_memory_usage_)
257 adjust_allocated_memory_cb_.Run(-last_reported_memory_usage_); 247 adjust_allocated_memory_cb_.Run(-last_reported_memory_usage_);
258 248
259 compositor_task_runner_->DeleteSoon(FROM_HERE, compositor_); 249 compositor_task_runner_->DeleteSoon(FROM_HERE, compositor_);
260 250
261 media_log_->AddEvent( 251 media_log_->AddEvent(
(...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after
1613 << ", Video: " << stats.video_memory_usage << ", DataSource: " 1603 << ", Video: " << stats.video_memory_usage << ", DataSource: "
1614 << (data_source_ ? data_source_->GetMemoryUsage() : 0) 1604 << (data_source_ ? data_source_->GetMemoryUsage() : 0)
1615 << ", Demuxer: " << demuxer_memory_usage; 1605 << ", Demuxer: " << demuxer_memory_usage;
1616 1606
1617 const int64_t delta = current_memory_usage - last_reported_memory_usage_; 1607 const int64_t delta = current_memory_usage - last_reported_memory_usage_;
1618 last_reported_memory_usage_ = current_memory_usage; 1608 last_reported_memory_usage_ = current_memory_usage;
1619 adjust_allocated_memory_cb_.Run(delta); 1609 adjust_allocated_memory_cb_.Run(delta);
1620 } 1610 }
1621 1611
1622 } // namespace media 1612 } // namespace media
OLDNEW
« no previous file with comments | « media/base/pipeline_impl_unittest.cc ('k') | media/filters/decoder_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698