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

Unified Diff: media/base/pipeline.h

Issue 276973004: Introduce audio/video BufferingState to Pipeline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 6 years, 7 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
« no previous file with comments | « media/base/buffering_state.h ('k') | media/base/pipeline.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline.h
diff --git a/media/base/pipeline.h b/media/base/pipeline.h
index c4de1ce1a346c1d22a38ebf42c6f5305bdd51b0a..1464cc2485952d766b3520000910dfd59071ff9c 100644
--- a/media/base/pipeline.h
+++ b/media/base/pipeline.h
@@ -13,6 +13,7 @@
#include "base/threading/thread_checker.h"
#include "base/time/default_tick_clock.h"
#include "media/base/audio_renderer.h"
+#include "media/base/buffering_state.h"
#include "media/base/demuxer.h"
#include "media/base/media_export.h"
#include "media/base/pipeline_status.h"
@@ -58,14 +59,13 @@ typedef base::Callback<void(PipelineMetadata)> PipelineMetadataCB;
// [ InitXXX (for each filter) ] [ Stopping ]
// | |
// V V
-// [ InitPreroll ] [ Stopped ]
+// [ InitPrerolling ] [ Stopped ]
// |
// V
-// [ Starting ] <-- [ Seeking ]
+// [ Playing ] <-- [ Seeking ]
// | ^
-// V |
-// [ Started ] ----------'
-// Seek()
+// `---------------'
+// Seek()
//
// Initialization is a series of state transitions from "Created" through each
// filter initialization state. When all filter initialization states have
@@ -194,8 +194,7 @@ class MEDIA_EXPORT Pipeline : public DemuxerHost {
kInitVideoRenderer,
kInitPrerolling,
kSeeking,
- kStarting,
- kStarted,
+ kPlaying,
kStopping,
kStopped,
};
@@ -305,10 +304,6 @@ class MEDIA_EXPORT Pipeline : public DemuxerHost {
// indepentent from seeking.
void DoSeek(base::TimeDelta seek_timestamp, const PipelineStatusCB& done_cb);
- // Updates playback rate and volume and initiates an asynchronous play call
- // sequence executing |done_cb| with the final status when completed.
- void DoPlay(const PipelineStatusCB& done_cb);
-
// Initiates an asynchronous pause-flush-stop call sequence executing
// |done_cb| when completed.
void DoStop(const PipelineStatusCB& done_cb);
@@ -316,6 +311,21 @@ class MEDIA_EXPORT Pipeline : public DemuxerHost {
void OnAudioUnderflow();
+ // Collection of callback methods and helpers for tracking changes in
+ // buffering state and transition from paused/underflow states and playing
+ // states.
+ //
+ // While in the kPlaying state:
+ // - A waiting to non-waiting transition indicates preroll has completed
+ // and StartPlayback() should be called
+ // - A non-waiting to waiting transition indicates underflow has occurred
+ // and StartWaitingForEnoughData() should be called
+ void BufferingStateChanged(BufferingState* buffering_state,
+ BufferingState new_buffering_state);
+ bool WaitingForEnoughData() const;
+ void StartWaitingForEnoughData();
+ void StartPlayback();
+
void StartClockIfWaitingForTimeUpdate_Locked();
// Task runner used to execute pipeline tasks.
@@ -377,6 +387,9 @@ class MEDIA_EXPORT Pipeline : public DemuxerHost {
bool video_ended_;
bool text_ended_;
+ BufferingState audio_buffering_state_;
+ BufferingState video_buffering_state_;
+
// Temporary callback used for Start() and Seek().
PipelineStatusCB seek_cb_;
« no previous file with comments | « media/base/buffering_state.h ('k') | media/base/pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698