| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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 "base/scoped_ptr.h" | 10 #include <string> |
| 11 |
| 11 #include "media/base/pipeline.h" | 12 #include "media/base/pipeline.h" |
| 12 | 13 |
| 13 namespace media { | 14 namespace media { |
| 14 | 15 |
| 15 class PipelineImpl : public Pipeline { | 16 class PipelineImpl : public Pipeline { |
| 16 public: | 17 public: |
| 17 PipelineImpl(); | 18 PipelineImpl(); |
| 19 ~PipelineImpl(); |
| 18 | 20 |
| 19 // Pipeline implementation. | 21 // Implementation of PipelineStatus methods. |
| 20 virtual bool Initialize(FilterFactoryInterface* filter_factory, | 22 virtual bool IsInitialized() const; |
| 21 const std::string& uri); | 23 virtual int64 GetDuration() const; |
| 22 virtual bool Play(); | 24 virtual int64 GetBufferedTime() const; |
| 23 virtual bool Pause(); | 25 virtual int64 GetTotalBytes() const; |
| 24 virtual bool Seek(int64 seek_position); | 26 virtual int64 GetBufferedBytes()const; |
| 25 virtual void Shutdown(); | 27 virtual void GetVideoSize(size_t* width_out, size_t* height_out) const; |
| 28 virtual float GetVolume() const; |
| 29 virtual float GetPlaybackRate() const; |
| 26 virtual int64 GetTime() const; | 30 virtual int64 GetTime() const; |
| 27 virtual int64 GetDuration() const; | 31 virtual PipelineError GetError() const; |
| 28 virtual void SetStateChangedCallback( | |
| 29 Callback1<PipelineState>::Type* callback); | |
| 30 virtual void SetTimeChangedCallback(Callback1<int64>::Type* callback); | |
| 31 | 32 |
| 32 protected: | 33 // Impementation of Pipeline methods. |
| 33 virtual ~PipelineImpl(); | 34 virtual bool Start(FilterFactory* filter_factory, |
| 35 const std::string& uri, |
| 36 Callback1<bool>::Type* init_complete_callback); |
| 37 virtual void Stop(); |
| 38 virtual bool SetPlaybackRate(float rate); |
| 39 virtual bool Seek(int64 time); |
| 40 virtual bool SetVolume(float volume); |
| 34 | 41 |
| 35 private: | 42 private: |
| 36 int64 time_; | |
| 37 int64 duration_; | |
| 38 scoped_ptr<Callback1<PipelineState>::Type> state_changed_callback_; | |
| 39 scoped_ptr<Callback1<int64>::Type> time_changed_callback_; | |
| 40 | |
| 41 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); | 43 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); |
| 42 }; | 44 }; |
| 43 | 45 |
| 44 } // namespace media | 46 } // namespace media |
| 45 | 47 |
| 46 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ | 48 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ |
| OLD | NEW |