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_ |
(...skipping 11 matching lines...) Expand all Loading... |
22 namespace media { | 22 namespace media { |
23 | 23 |
24 struct PipelineStatistics { | 24 struct PipelineStatistics { |
25 PipelineStatistics() : | 25 PipelineStatistics() : |
26 audio_bytes_decoded(0), | 26 audio_bytes_decoded(0), |
27 video_bytes_decoded(0), | 27 video_bytes_decoded(0), |
28 video_frames_decoded(0), | 28 video_frames_decoded(0), |
29 video_frames_dropped(0) { | 29 video_frames_dropped(0) { |
30 } | 30 } |
31 | 31 |
32 uint32 audio_bytes_decoded; // Should be uint64? | 32 uint32 audio_bytes_decoded; // Should be uint64? |
33 uint32 video_bytes_decoded; // Should be uint64? | 33 uint32 video_bytes_decoded; // Should be uint64? |
34 uint32 video_frames_decoded; | 34 uint32 video_frames_decoded; |
35 uint32 video_frames_dropped; | 35 uint32 video_frames_dropped; |
36 }; | 36 }; |
37 | 37 |
38 class FilterCollection; | 38 class FilterCollection; |
39 | 39 |
40 class Pipeline : public base::RefCountedThreadSafe<Pipeline> { | 40 class Pipeline : public base::RefCountedThreadSafe<Pipeline> { |
41 public: | 41 public: |
42 // Initializes pipeline. Pipeline takes ownership of all callbacks passed | 42 // Initializes pipeline. Pipeline takes ownership of all callbacks passed |
43 // into this method. | 43 // into this method. |
(...skipping 10 matching lines...) Expand all Loading... |
54 // only indicates that the initialization process has started successfully. | 54 // only indicates that the initialization process has started successfully. |
55 // Pipeline initialization is an inherently asynchronous process. Clients can | 55 // Pipeline initialization is an inherently asynchronous process. Clients can |
56 // either poll the IsInitialized() method (discouraged) or use the | 56 // either poll the IsInitialized() method (discouraged) or use the |
57 // |start_callback| as described below. | 57 // |start_callback| as described below. |
58 // | 58 // |
59 // This method is asynchronous and can execute a callback when completed. | 59 // This method is asynchronous and can execute a callback when completed. |
60 // If the caller provides a |start_callback|, it will be called when the | 60 // If the caller provides a |start_callback|, it will be called when the |
61 // pipeline initialization completes. | 61 // pipeline initialization completes. |
62 virtual bool Start(FilterCollection* filter_collection, | 62 virtual bool Start(FilterCollection* filter_collection, |
63 const std::string& url, | 63 const std::string& url, |
64 PipelineStatusCallback* start_callback) = 0; | 64 PipelineStatusCallback* start_callback, |
| 65 bool raw_video) = 0; |
65 | 66 |
66 // Asynchronously stops the pipeline and resets it to an uninitialized state. | 67 // Asynchronously stops the pipeline and resets it to an uninitialized state. |
67 // If provided, |stop_callback| will be executed when the pipeline has been | 68 // If provided, |stop_callback| will be executed when the pipeline has been |
68 // completely torn down and reset to an uninitialized state. It is acceptable | 69 // completely torn down and reset to an uninitialized state. It is acceptable |
69 // to call Start() again once the callback has finished executing. | 70 // to call Start() again once the callback has finished executing. |
70 // | 71 // |
71 // Stop() must be called before destroying the pipeline. Clients can | 72 // Stop() must be called before destroying the pipeline. Clients can |
72 // determine whether Stop() must be called by checking IsRunning(). | 73 // determine whether Stop() must be called by checking IsRunning(). |
73 // | 74 // |
74 // TODO(scherkus): ideally clients would destroy the pipeline after calling | 75 // TODO(scherkus): ideally clients would destroy the pipeline after calling |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 166 |
166 protected: | 167 protected: |
167 // Only allow ourselves to be deleted by reference counting. | 168 // Only allow ourselves to be deleted by reference counting. |
168 friend class base::RefCountedThreadSafe<Pipeline>; | 169 friend class base::RefCountedThreadSafe<Pipeline>; |
169 virtual ~Pipeline() {} | 170 virtual ~Pipeline() {} |
170 }; | 171 }; |
171 | 172 |
172 } // namespace media | 173 } // namespace media |
173 | 174 |
174 #endif // MEDIA_BASE_PIPELINE_H_ | 175 #endif // MEDIA_BASE_PIPELINE_H_ |
OLD | NEW |