diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-22 20:24:35 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-22 20:24:35 +0000 |
commit | a73e3d734f59ba7e593855c32254fc79a51898eb (patch) | |
tree | ddf363d4c9b7cc887a979e70fdd574e7d0fd8715 /media/base/pipeline.h | |
parent | 7a7c5ceca41bbccc7c048042b29c973b2e5929e7 (diff) | |
download | chromium_src-a73e3d734f59ba7e593855c32254fc79a51898eb.zip chromium_src-a73e3d734f59ba7e593855c32254fc79a51898eb.tar.gz chromium_src-a73e3d734f59ba7e593855c32254fc79a51898eb.tar.bz2 |
Extract media::Clock::IsPlaying() into media::Pipeline::ClockState enum.
Instead of using both Clock::IsPlaying() and waiting_for_clock_update_,
use a three-state representation so it's easier to determine the actual
state of both audio rendering and the clock when Pipeline is in its
playing state. Introduce some helpers to deal with transitioning between states.
This is needed for the upcoming BufferingState changes as Pipeline now
handles underflow/preroll.
BUG=370634
Review URL: https://codereview.chromium.org/294133003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272301 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/pipeline.h')
-rw-r--r-- | media/base/pipeline.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/media/base/pipeline.h b/media/base/pipeline.h index 06bffba..b40cd3c 100644 --- a/media/base/pipeline.h +++ b/media/base/pipeline.h @@ -326,6 +326,7 @@ class MEDIA_EXPORT Pipeline : public DemuxerHost { void StartWaitingForEnoughData(); void StartPlayback(); + void PauseClockAndStopRendering_Locked(); void StartClockIfWaitingForTimeUpdate_Locked(); // Task runner used to execute pipeline tasks. @@ -365,10 +366,18 @@ class MEDIA_EXPORT Pipeline : public DemuxerHost { // by filters. scoped_ptr<Clock> clock_; - // If this value is set to true, then |clock_| is paused and we are waiting - // for an update of the clock greater than or equal to the elapsed time to - // start the clock. - bool waiting_for_clock_update_; + enum ClockState { + // Audio (if present) is not rendering. Clock isn't playing. + CLOCK_PAUSED, + + // Audio (if present) is rendering. Clock isn't playing. + CLOCK_WAITING_FOR_AUDIO_TIME_UPDATE, + + // Audio (if present) is rendering. Clock is playing. + CLOCK_PLAYING, + }; + + ClockState clock_state_; // Status of the pipeline. Initialized to PIPELINE_OK which indicates that // the pipeline is operating correctly. Any other value indicates that the |