| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // The pipeline is the public API clients use for playing back media. Clients | 5 // The pipeline is the public API clients use for playing back media. Clients |
| 6 // provide a filter factory containing the filters they want the pipeline to | 6 // provide a filter factory containing the filters they want the pipeline to |
| 7 // use to render media. | 7 // use to render media. |
| 8 | 8 |
| 9 #ifndef MEDIA_BASE_PIPELINE_H_ | 9 #ifndef MEDIA_BASE_PIPELINE_H_ |
| 10 #define MEDIA_BASE_PIPELINE_H_ | 10 #define MEDIA_BASE_PIPELINE_H_ |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // Stop() must be called before destroying the pipeline. Clients can | 74 // Stop() must be called before destroying the pipeline. Clients can |
| 75 // determine whether Stop() must be called by checking IsRunning(). | 75 // determine whether Stop() must be called by checking IsRunning(). |
| 76 // | 76 // |
| 77 // TODO(scherkus): ideally clients would destroy the pipeline after calling | 77 // TODO(scherkus): ideally clients would destroy the pipeline after calling |
| 78 // Stop() and create a new pipeline as needed. | 78 // Stop() and create a new pipeline as needed. |
| 79 virtual void Stop(PipelineCallback* stop_callback) = 0; | 79 virtual void Stop(PipelineCallback* stop_callback) = 0; |
| 80 | 80 |
| 81 // Attempt to seek to the position specified by time. |seek_callback| will be | 81 // Attempt to seek to the position specified by time. |seek_callback| will be |
| 82 // executed when the all filters in the pipeline have processed the seek. | 82 // executed when the all filters in the pipeline have processed the seek. |
| 83 // | 83 // |
| 84 // Clients are expected to call GetTime() to check whether the seek succeeded. | 84 // Clients are expected to call GetCurrentTime() to check whether the seek |
| 85 // succeeded. |
| 85 virtual void Seek(base::TimeDelta time, PipelineCallback* seek_callback) = 0; | 86 virtual void Seek(base::TimeDelta time, PipelineCallback* seek_callback) = 0; |
| 86 | 87 |
| 87 // Returns true if the pipeline has been started via Start(). If IsRunning() | 88 // Returns true if the pipeline has been started via Start(). If IsRunning() |
| 88 // returns true, it is expected that Stop() will be called before destroying | 89 // returns true, it is expected that Stop() will be called before destroying |
| 89 // the pipeline. | 90 // the pipeline. |
| 90 virtual bool IsRunning() const = 0; | 91 virtual bool IsRunning() const = 0; |
| 91 | 92 |
| 92 // Returns true if the pipeline has been started and fully initialized to a | 93 // Returns true if the pipeline has been started and fully initialized to a |
| 93 // point where playback controls will be respected. Note that it is possible | 94 // point where playback controls will be respected. Note that it is possible |
| 94 // for a pipeline to be started but not initialized (i.e., an error occurred). | 95 // for a pipeline to be started but not initialized (i.e., an error occurred). |
| (...skipping 23 matching lines...) Expand all Loading... |
| 118 // from 0.0f to 1.0f. | 119 // from 0.0f to 1.0f. |
| 119 virtual float GetVolume() const = 0; | 120 virtual float GetVolume() const = 0; |
| 120 | 121 |
| 121 // Attempt to set the volume of the audio renderer. Valid values for volume | 122 // Attempt to set the volume of the audio renderer. Valid values for volume |
| 122 // range from 0.0f (muted) to 1.0f (full volume). This value affects all | 123 // range from 0.0f (muted) to 1.0f (full volume). This value affects all |
| 123 // channels proportionately for multi-channel audio streams. | 124 // channels proportionately for multi-channel audio streams. |
| 124 virtual void SetVolume(float volume) = 0; | 125 virtual void SetVolume(float volume) = 0; |
| 125 | 126 |
| 126 // Gets the current pipeline time. For a pipeline "time" progresses from 0 to | 127 // Gets the current pipeline time. For a pipeline "time" progresses from 0 to |
| 127 // the end of the media. | 128 // the end of the media. |
| 128 virtual base::TimeDelta GetTime() const = 0; | 129 virtual base::TimeDelta GetCurrentTime() const = 0; |
| 129 | 130 |
| 130 // Get the approximate amount of playable data buffered so far in micro- | 131 // Get the approximate amount of playable data buffered so far in micro- |
| 131 // seconds. | 132 // seconds. |
| 132 virtual base::TimeDelta GetBufferedTime() const = 0; | 133 virtual base::TimeDelta GetBufferedTime() const = 0; |
| 133 | 134 |
| 134 // Get the duration of the media in microseconds. If the duration has not | 135 // Get the duration of the media in microseconds. If the duration has not |
| 135 // been determined yet, then returns 0. | 136 // been determined yet, then returns 0. |
| 136 virtual base::TimeDelta GetDuration() const = 0; | 137 virtual base::TimeDelta GetDuration() const = 0; |
| 137 | 138 |
| 138 // Get the total number of bytes that are buffered on the client and ready to | 139 // Get the total number of bytes that are buffered on the client and ready to |
| (...skipping 12 matching lines...) Expand all Loading... |
| 151 // operating correctly, this will return OK. | 152 // operating correctly, this will return OK. |
| 152 virtual PipelineError GetError() const = 0; | 153 virtual PipelineError GetError() const = 0; |
| 153 | 154 |
| 154 protected: | 155 protected: |
| 155 virtual ~Pipeline() {} | 156 virtual ~Pipeline() {} |
| 156 }; | 157 }; |
| 157 | 158 |
| 158 } // namespace media | 159 } // namespace media |
| 159 | 160 |
| 160 #endif // MEDIA_BASE_PIPELINE_H_ | 161 #endif // MEDIA_BASE_PIPELINE_H_ |
| OLD | NEW |