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