From 6a1b224cac50ee395704c1062a0d040b0c235199 Mon Sep 17 00:00:00 2001 From: "acolwell@chromium.org" Date: Thu, 23 Dec 2010 16:59:52 +0000 Subject: Refactor PipelineImpl to use CompositeFilter to manage Filter state transitions. BUG=54110 TEST=media_unittests CompositeFilterTest.* Review URL: http://codereview.chromium.org/5744002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70063 0039d316-1c4b-4281-b951-d872f2087c98 --- media/base/pipeline_impl.h | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'media/base/pipeline_impl.h') diff --git a/media/base/pipeline_impl.h b/media/base/pipeline_impl.h index aa99f73..fbc2b3d 100644 --- a/media/base/pipeline_impl.h +++ b/media/base/pipeline_impl.h @@ -18,6 +18,7 @@ #include "base/thread.h" #include "base/time.h" #include "media/base/clock.h" +#include "media/base/composite_filter.h" #include "media/base/filter_host.h" #include "media/base/pipeline.h" @@ -119,6 +120,9 @@ class PipelineImpl : public Pipeline, public FilterHost { // is used by the constructor, and the Stop() method. void ResetState(); + // Updates |state_|. All state transitions should use this call. + void set_state(State next_state); + // Simple method used to make sure the pipeline is running normally. bool IsPipelineOk(); @@ -353,12 +357,6 @@ class PipelineImpl : public Pipeline, public FilterHost { // Member that tracks the current state. State state_; - // For kPausing, kSeeking and kStarting, we need to track how many filters - // have completed transitioning to the destination state. When - // |remaining_transitions_| reaches 0 the pipeline can transition out - // of the current state. - size_t remaining_transitions_; - // For kSeeking we need to remember where we're seeking between filter // replies. base::TimeDelta seek_timestamp_; @@ -388,20 +386,14 @@ class PipelineImpl : public Pipeline, public FilterHost { scoped_ptr error_callback_; scoped_ptr network_callback_; - // Vector of our filters and map maintaining the relationship between the - // FilterType and the filter itself. - typedef std::vector > FilterVector; - FilterVector filters_; + // Reference to the filter(s) that constitute the pipeline. + scoped_refptr pipeline_filter_; // Renderer references used for setting the volume and determining // when playback has finished. scoped_refptr audio_renderer_; scoped_refptr video_renderer_; - // Vector of threads owned by the pipeline and being used by filters. - typedef std::vector FilterThreadVector; - FilterThreadVector filter_threads_; - // Helper class that stores filter references during pipeline // initialization. class PipelineInitState; -- cgit v1.1