| 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 30 matching lines...) Expand all Loading... |
| 41 DEMUXER_ERROR_COULD_NOT_OPEN, | 41 DEMUXER_ERROR_COULD_NOT_OPEN, |
| 42 DEMUXER_ERROR_COULD_NOT_PARSE, | 42 DEMUXER_ERROR_COULD_NOT_PARSE, |
| 43 DEMUXER_ERROR_NO_SUPPORTED_STREAMS, | 43 DEMUXER_ERROR_NO_SUPPORTED_STREAMS, |
| 44 DEMUXER_ERROR_COULD_NOT_CREATE_THREAD, | 44 DEMUXER_ERROR_COULD_NOT_CREATE_THREAD, |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 // Client-provided callbacks for various pipeline operations. Clients should | 47 // Client-provided callbacks for various pipeline operations. Clients should |
| 48 // inspect the Pipeline for errors. | 48 // inspect the Pipeline for errors. |
| 49 typedef Callback0::Type PipelineCallback; | 49 typedef Callback0::Type PipelineCallback; |
| 50 | 50 |
| 51 class Pipeline { | 51 class Pipeline : public base::RefCountedThreadSafe<Pipeline> { |
| 52 public: | 52 public: |
| 53 // Build a pipeline to render the given URL using the given filter factory to | 53 // Build a pipeline to render the given URL using the given filter factory to |
| 54 // construct a filter chain. Returns true if successful, false otherwise | 54 // construct a filter chain. Returns true if successful, false otherwise |
| 55 // (i.e., pipeline already started). Note that a return value of true | 55 // (i.e., pipeline already started). Note that a return value of true |
| 56 // only indicates that the initialization process has started successfully. | 56 // only indicates that the initialization process has started successfully. |
| 57 // Pipeline initialization is an inherently asynchronous process. Clients can | 57 // Pipeline initialization is an inherently asynchronous process. Clients can |
| 58 // either poll the IsInitialized() method (discouraged) or use the | 58 // either poll the IsInitialized() method (discouraged) or use the |
| 59 // |start_callback| as described below. | 59 // |start_callback| as described below. |
| 60 // | 60 // |
| 61 // This method is asynchronous and can execute a callback when completed. | 61 // This method is asynchronous and can execute a callback when completed. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 // Gets the size of the video output in pixel units. If there is no video | 147 // Gets the size of the video output in pixel units. If there is no video |
| 148 // or the video has not been rendered yet, the width and height will be 0. | 148 // or the video has not been rendered yet, the width and height will be 0. |
| 149 virtual void GetVideoSize(size_t* width_out, size_t* height_out) const = 0; | 149 virtual void GetVideoSize(size_t* width_out, size_t* height_out) const = 0; |
| 150 | 150 |
| 151 // Gets the current error status for the pipeline. If the pipeline is | 151 // Gets the current error status for the pipeline. If the pipeline is |
| 152 // operating correctly, this will return OK. | 152 // operating correctly, this will return OK. |
| 153 virtual PipelineError GetError() const = 0; | 153 virtual PipelineError GetError() const = 0; |
| 154 | 154 |
| 155 protected: | 155 protected: |
| 156 // Only allow ourselves to be deleted by reference counting. |
| 157 friend class base::RefCountedThreadSafe<Pipeline>; |
| 156 virtual ~Pipeline() {} | 158 virtual ~Pipeline() {} |
| 157 }; | 159 }; |
| 158 | 160 |
| 159 } // namespace media | 161 } // namespace media |
| 160 | 162 |
| 161 #endif // MEDIA_BASE_PIPELINE_H_ | 163 #endif // MEDIA_BASE_PIPELINE_H_ |
| OLD | NEW |