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

Unified Diff: media/base/pipeline.h

Issue 10826196: Clean up Pipeline terminal state logic by merging kError into kStopped state. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: Created 8 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: media/base/pipeline.h
diff --git a/media/base/pipeline.h b/media/base/pipeline.h
index 9dfbf556224b56ca1f3844a93290edfd5a9c3ecf..e28e1cbd45bdb2dee026afeb386390c78ebd6bce 100644
--- a/media/base/pipeline.h
+++ b/media/base/pipeline.h
@@ -92,9 +92,7 @@ class MEDIA_EXPORT PipelineStatusNotification {
// From then on the normal Seek() transitions are carried out and we start
// playing the media.
//
-// If any error ever happens, this object will transition to the "Error" state
-// from any state. If Stop() is ever called, this object will transition to
-// "Stopped" state.
+// Any runtime error will cause the pipeline to end up in the stopped state.
class MEDIA_EXPORT Pipeline
: public base::RefCountedThreadSafe<Pipeline>,
public DemuxerHost {
@@ -105,10 +103,6 @@ class MEDIA_EXPORT Pipeline
// Build a pipeline to using the given filter collection to construct a filter
// chain.
//
- // Pipeline initialization is an inherently asynchronous process. Clients can
- // either poll the IsInitialized() method (discouraged) or optionally pass in
- // |start_cb|, which will be executed when initialization completes.
- //
// The following permanent callbacks will be executed as follows:
// |start_cb_| will be executed when Start is done (successfully or not).
// |ended_cb| will be executed whenever the media reaches the end.
@@ -119,26 +113,14 @@ class MEDIA_EXPORT Pipeline
// Stop() has completed.
//
// It is an error to call this method after the pipeline has already started.
- //
- // TODO(scherkus): remove IsInitialized() and force clients to use callbacks.
void Start(scoped_ptr<FilterCollection> filter_collection,
const PipelineStatusCB& ended_cb,
const PipelineStatusCB& error_cb,
const PipelineStatusCB& start_cb);
- // Asynchronously stops the pipeline and resets it to an uninitialized state.
- //
- // If provided, |stop_cb| will be executed when the pipeline has been
- // completely torn down and reset to an uninitialized state. It is acceptable
- // to call Start() again once the callback has finished executing.
+ // Asynchronously stops the pipeline, executing |stop_cb| when completed.
//
- // Stop() must be called before destroying the pipeline. Clients can
- // determine whether Stop() must be called by checking IsRunning().
- //
- // It is an error to call this method if the pipeline has not started.
- //
- // TODO(scherkus): ideally clients would destroy the pipeline after calling
- // Stop() and create a new pipeline as needed.
+ // Clients can delete the pipeline after |stop_cb| runs.
void Stop(const base::Closure& stop_cb);
// Attempt to seek to the position specified by time. |seek_cb| will be
@@ -155,11 +137,6 @@ class MEDIA_EXPORT Pipeline
// the pipeline.
bool IsRunning() const;
- // Returns true if the pipeline has been started and fully initialized to a
- // point where playback controls will be respected. Note that it is possible
- // for a pipeline to be started but not initialized (i.e., an error occurred).
- bool IsInitialized() const;
-
// Returns true if the media has audio.
bool HasAudio() const;
@@ -245,7 +222,6 @@ class MEDIA_EXPORT Pipeline
kStarted,
kStopping,
kStopped,
- kError,
};
// Updates |state_|. All state transitions should use this call.
@@ -341,7 +317,7 @@ class MEDIA_EXPORT Pipeline
void StopTask(const base::Closure& stop_cb);
// Carries out stopping and destroying all filters, placing the pipeline in
- // the kError state.
+ // the kStopped state.
void ErrorChangedTask(PipelineStatus error);
// Carries out notifying filters that the playback rate has changed.
@@ -443,15 +419,9 @@ class MEDIA_EXPORT Pipeline
// Whether or not the pipeline is in transition for a seek operation.
bool seek_pending_;
- // Whether or not the pipeline is pending a stop operation.
- bool stop_pending_;
scherkus (not reviewing) 2012/08/08 02:20:56 this is equivalent to inspecting stop_cb_
-
// Whether or not the pipeline is perform a stop operation.
bool tearing_down_;
- // Whether or not an error triggered the teardown.
- bool error_caused_teardown_;
scherkus (not reviewing) 2012/08/08 02:20:56 this is equivalent to (status_ != PIPELINE_OK)
-
// Whether or not a playback rate change should be done once seeking is done.
bool playback_rate_change_pending_;
« no previous file with comments | « media/base/media_log.cc ('k') | media/base/pipeline.cc » ('j') | media/base/pipeline_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698