| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 collection containing the filters they want the pipeline to | 6 // provide a filter collection 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_ |
| 11 | 11 |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "media/base/filters.h" | 15 #include "media/base/filters.h" |
| 16 #include "media/base/pipeline_status.h" | 16 #include "media/base/pipeline_status.h" |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class TimeDelta; | 19 class TimeDelta; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace media { | 22 namespace media { |
| 23 | 23 |
| 24 MEDIA_EXPORT extern const char kRawMediaScheme[]; | 24 extern const char kRawMediaScheme[]; |
| 25 | 25 |
| 26 struct PipelineStatistics { | 26 struct PipelineStatistics { |
| 27 PipelineStatistics() : | 27 PipelineStatistics() : |
| 28 audio_bytes_decoded(0), | 28 audio_bytes_decoded(0), |
| 29 video_bytes_decoded(0), | 29 video_bytes_decoded(0), |
| 30 video_frames_decoded(0), | 30 video_frames_decoded(0), |
| 31 video_frames_dropped(0) { | 31 video_frames_dropped(0) { |
| 32 } | 32 } |
| 33 | 33 |
| 34 uint32 audio_bytes_decoded; // Should be uint64? | 34 uint32 audio_bytes_decoded; // Should be uint64? |
| 35 uint32 video_bytes_decoded; // Should be uint64? | 35 uint32 video_bytes_decoded; // Should be uint64? |
| 36 uint32 video_frames_decoded; | 36 uint32 video_frames_decoded; |
| 37 uint32 video_frames_dropped; | 37 uint32 video_frames_dropped; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 class FilterCollection; | 40 class FilterCollection; |
| 41 | 41 |
| 42 class MEDIA_EXPORT Pipeline : public base::RefCountedThreadSafe<Pipeline> { | 42 class Pipeline : public base::RefCountedThreadSafe<Pipeline> { |
| 43 public: | 43 public: |
| 44 // Initializes pipeline. Pipeline takes ownership of all callbacks passed | 44 // Initializes pipeline. Pipeline takes ownership of all callbacks passed |
| 45 // into this method. | 45 // into this method. |
| 46 // |ended_callback| will be executed when the media reaches the end. | 46 // |ended_callback| will be executed when the media reaches the end. |
| 47 // |error_callback_| will be executed upon an error in the pipeline. | 47 // |error_callback_| will be executed upon an error in the pipeline. |
| 48 // |network_callback_| will be executed when there's a network event. | 48 // |network_callback_| will be executed when there's a network event. |
| 49 virtual void Init(PipelineStatusCallback* ended_callback, | 49 virtual void Init(PipelineStatusCallback* ended_callback, |
| 50 PipelineStatusCallback* error_callback, | 50 PipelineStatusCallback* error_callback, |
| 51 PipelineStatusCallback* network_callback) = 0; | 51 PipelineStatusCallback* network_callback) = 0; |
| 52 | 52 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 protected: | 168 protected: |
| 169 // Only allow ourselves to be deleted by reference counting. | 169 // Only allow ourselves to be deleted by reference counting. |
| 170 friend class base::RefCountedThreadSafe<Pipeline>; | 170 friend class base::RefCountedThreadSafe<Pipeline>; |
| 171 virtual ~Pipeline() {} | 171 virtual ~Pipeline() {} |
| 172 }; | 172 }; |
| 173 | 173 |
| 174 } // namespace media | 174 } // namespace media |
| 175 | 175 |
| 176 #endif // MEDIA_BASE_PIPELINE_H_ | 176 #endif // MEDIA_BASE_PIPELINE_H_ |
| OLD | NEW |