| OLD | NEW |
| 1 // Copyright (c) 2008-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008-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 // Implementation of Pipeline. | 5 // Implementation of Pipeline. |
| 6 | 6 |
| 7 #ifndef MEDIA_BASE_PIPELINE_IMPL_H_ | 7 #ifndef MEDIA_BASE_PIPELINE_IMPL_H_ |
| 8 #define MEDIA_BASE_PIPELINE_IMPL_H_ | 8 #define MEDIA_BASE_PIPELINE_IMPL_H_ |
| 9 | 9 |
| 10 #include <map> |
| 11 #include <set> |
| 10 #include <string> | 12 #include <string> |
| 11 #include <vector> | 13 #include <vector> |
| 12 #include <set> | |
| 13 | 14 |
| 14 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
| 15 #include "base/ref_counted.h" | 16 #include "base/ref_counted.h" |
| 16 #include "base/thread.h" | 17 #include "base/thread.h" |
| 17 #include "base/time.h" | 18 #include "base/time.h" |
| 18 #include "media/base/filter_host.h" | 19 #include "media/base/filter_host.h" |
| 19 #include "media/base/pipeline.h" | 20 #include "media/base/pipeline.h" |
| 20 | 21 |
| 21 namespace media { | 22 namespace media { |
| 22 | 23 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 virtual float GetVolume() const; | 76 virtual float GetVolume() const; |
| 76 virtual void SetVolume(float volume); | 77 virtual void SetVolume(float volume); |
| 77 virtual base::TimeDelta GetCurrentTime() const; | 78 virtual base::TimeDelta GetCurrentTime() const; |
| 78 virtual base::TimeDelta GetBufferedTime() const; | 79 virtual base::TimeDelta GetBufferedTime() const; |
| 79 virtual base::TimeDelta GetDuration() const; | 80 virtual base::TimeDelta GetDuration() const; |
| 80 virtual int64 GetBufferedBytes() const; | 81 virtual int64 GetBufferedBytes() const; |
| 81 virtual int64 GetTotalBytes() const; | 82 virtual int64 GetTotalBytes() const; |
| 82 virtual void GetVideoSize(size_t* width_out, size_t* height_out) const; | 83 virtual void GetVideoSize(size_t* width_out, size_t* height_out) const; |
| 83 virtual PipelineError GetError() const; | 84 virtual PipelineError GetError() const; |
| 84 | 85 |
| 86 // |error_callback_| will be executed upon an error in the pipeline. If |
| 87 // |error_callback_| is NULL, it is ignored. The pipeline takes ownernship |
| 88 // of |error_callback|. |
| 89 virtual void SetPipelineErrorCallback(PipelineCallback* error_callback); |
| 90 |
| 85 private: | 91 private: |
| 86 // Pipeline states, as described above. | 92 // Pipeline states, as described above. |
| 87 enum State { | 93 enum State { |
| 88 kCreated, | 94 kCreated, |
| 89 kInitDataSource, | 95 kInitDataSource, |
| 90 kInitDemuxer, | 96 kInitDemuxer, |
| 91 kInitAudioDecoder, | 97 kInitAudioDecoder, |
| 92 kInitAudioRenderer, | 98 kInitAudioRenderer, |
| 93 kInitVideoDecoder, | 99 kInitVideoDecoder, |
| 94 kInitVideoRenderer, | 100 kInitVideoRenderer, |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 313 |
| 308 // Filter factory as passed in by Start(). | 314 // Filter factory as passed in by Start(). |
| 309 scoped_refptr<FilterFactory> filter_factory_; | 315 scoped_refptr<FilterFactory> filter_factory_; |
| 310 | 316 |
| 311 // URL for the data source as passed in by Start(). | 317 // URL for the data source as passed in by Start(). |
| 312 std::string url_; | 318 std::string url_; |
| 313 | 319 |
| 314 // Callbacks for various pipeline operations. | 320 // Callbacks for various pipeline operations. |
| 315 scoped_ptr<PipelineCallback> seek_callback_; | 321 scoped_ptr<PipelineCallback> seek_callback_; |
| 316 scoped_ptr<PipelineCallback> stop_callback_; | 322 scoped_ptr<PipelineCallback> stop_callback_; |
| 323 scoped_ptr<PipelineCallback> error_callback_; |
| 317 | 324 |
| 318 // Vector of our filters and map maintaining the relationship between the | 325 // Vector of our filters and map maintaining the relationship between the |
| 319 // FilterType and the filter itself. | 326 // FilterType and the filter itself. |
| 320 typedef std::vector<scoped_refptr<MediaFilter> > FilterVector; | 327 typedef std::vector<scoped_refptr<MediaFilter> > FilterVector; |
| 321 FilterVector filters_; | 328 FilterVector filters_; |
| 322 | 329 |
| 323 typedef std::map<FilterType, scoped_refptr<MediaFilter> > FilterTypeMap; | 330 typedef std::map<FilterType, scoped_refptr<MediaFilter> > FilterTypeMap; |
| 324 FilterTypeMap filter_types_; | 331 FilterTypeMap filter_types_; |
| 325 | 332 |
| 326 // Vector of threads owned by the pipeline and being used by filters. | 333 // Vector of threads owned by the pipeline and being used by filters. |
| 327 typedef std::vector<base::Thread*> FilterThreadVector; | 334 typedef std::vector<base::Thread*> FilterThreadVector; |
| 328 FilterThreadVector filter_threads_; | 335 FilterThreadVector filter_threads_; |
| 329 | 336 |
| 330 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); | 337 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); |
| 331 }; | 338 }; |
| 332 | 339 |
| 333 } // namespace media | 340 } // namespace media |
| 334 | 341 |
| 335 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ | 342 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ |
| OLD | NEW |