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

Unified Diff: chromecast/media/cma/pipeline/media_pipeline_impl.cc

Issue 1306843003: CmaMediaPipelineClient to watch media pipeline status (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chromecast/media/cma/pipeline/media_pipeline_impl.cc
diff --git a/chromecast/media/cma/pipeline/media_pipeline_impl.cc b/chromecast/media/cma/pipeline/media_pipeline_impl.cc
index c9d0e288c76479a9604ef9e5c689fe7a440fe2c3..2c644f1a03015e37ccc5c90a2308bb31439be4a8 100644
--- a/chromecast/media/cma/pipeline/media_pipeline_impl.cc
+++ b/chromecast/media/cma/pipeline/media_pipeline_impl.cc
@@ -66,6 +66,15 @@ MediaPipelineImpl::MediaPipelineImpl()
MediaPipelineImpl::~MediaPipelineImpl() {
CMALOG(kLogControl) << __FUNCTION__;
DCHECK(thread_checker_.CalledOnValidThread());
+
+ weak_factory_.InvalidateWeakPtrs();
+
+ // Since av pipeline still need to access device components in their
+ // destructor, it's important to delete them first.
+ video_pipeline_.reset();
+ audio_pipeline_.reset();
+ media_pipeline_backend_.reset();
+ client_.device_components_destroy_cb.Run();
halliwell 2015/08/25 00:48:34 I think you have to check is_null before calling?
yucliu1 2015/08/25 00:53:11 The SetClient requires that all the callbacks can
halliwell 2015/08/25 01:02:49 You didn't add DCHECKs to SetClient for these new
yucliu1 2015/08/25 04:27:58 Done.
}
void MediaPipelineImpl::Initialize(
@@ -75,6 +84,7 @@ void MediaPipelineImpl::Initialize(
DCHECK(thread_checker_.CalledOnValidThread());
media_pipeline_backend_.reset(media_pipeline_backend.release());
clock_device_ = media_pipeline_backend_->GetClock();
+ client_.device_components_create_cb.Run();
halliwell 2015/08/25 00:48:34 same here.
yucliu1 2015/08/25 04:27:58 Done.
if (load_type == kLoadTypeURL || load_type == kLoadTypeMediaSource) {
base::TimeDelta low_threshold(kLowBufferThresholdURL);

Powered by Google App Engine
This is Rietveld 408576698