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 // 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 <set> |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 virtual bool IsLoaded() const; | 93 virtual bool IsLoaded() const; |
94 virtual PipelineError GetError() const; | 94 virtual PipelineError GetError() const; |
95 virtual PipelineStatistics GetStatistics() const; | 95 virtual PipelineStatistics GetStatistics() const; |
96 | 96 |
97 void SetClockForTesting(Clock* clock); | 97 void SetClockForTesting(Clock* clock); |
98 | 98 |
99 private: | 99 private: |
100 // Pipeline states, as described above. | 100 // Pipeline states, as described above. |
101 enum State { | 101 enum State { |
102 kCreated, | 102 kCreated, |
103 kInitDataSource, | |
104 kInitDemuxer, | 103 kInitDemuxer, |
105 kInitAudioDecoder, | 104 kInitAudioDecoder, |
106 kInitAudioRenderer, | 105 kInitAudioRenderer, |
107 kInitVideoDecoder, | 106 kInitVideoDecoder, |
108 kInitVideoRenderer, | 107 kInitVideoRenderer, |
109 kPausing, | 108 kPausing, |
110 kSeeking, | 109 kSeeking, |
111 kFlushing, | 110 kFlushing, |
112 kStarting, | 111 kStarting, |
113 kStarted, | 112 kStarted, |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 243 |
245 // Internal methods used in the implementation of the pipeline thread. All | 244 // Internal methods used in the implementation of the pipeline thread. All |
246 // of these methods are only called on the pipeline thread. | 245 // of these methods are only called on the pipeline thread. |
247 | 246 |
248 // PrepareFilter() creates the filter's thread and injects a FilterHost and | 247 // PrepareFilter() creates the filter's thread and injects a FilterHost and |
249 // MessageLoop. | 248 // MessageLoop. |
250 bool PrepareFilter(scoped_refptr<Filter> filter); | 249 bool PrepareFilter(scoped_refptr<Filter> filter); |
251 | 250 |
252 // The following initialize methods are used to select a specific type of | 251 // The following initialize methods are used to select a specific type of |
253 // Filter object from FilterCollection and initialize it asynchronously. | 252 // Filter object from FilterCollection and initialize it asynchronously. |
254 void InitializeDataSource(); | 253 void InitializeDemuxer(); |
255 void OnDataSourceBuilt(PipelineError error, DataSource* data_source); | 254 void OnDemuxerBuilt(PipelineError error, Demuxer* demuxer); |
256 | |
257 void InitializeDemuxer(const scoped_refptr<DataSource>& data_source); | |
258 | 255 |
259 // Returns true if the asynchronous action of creating decoder has started. | 256 // Returns true if the asynchronous action of creating decoder has started. |
260 // Returns false if this method did nothing because the corresponding | 257 // Returns false if this method did nothing because the corresponding |
261 // audio/video stream does not exist. | 258 // audio/video stream does not exist. |
262 bool InitializeAudioDecoder(const scoped_refptr<Demuxer>& demuxer); | 259 bool InitializeAudioDecoder(const scoped_refptr<Demuxer>& demuxer); |
263 bool InitializeVideoDecoder(const scoped_refptr<Demuxer>& demuxer); | 260 bool InitializeVideoDecoder(const scoped_refptr<Demuxer>& demuxer); |
264 | 261 |
265 // Initializes a renderer and connects it with decoder. Returns true if the | 262 // Initializes a renderer and connects it with decoder. Returns true if the |
266 // asynchronous action of creating renderer has started. Returns | 263 // asynchronous action of creating renderer has started. Returns |
267 // false if this method did nothing because the corresponding audio/video | 264 // false if this method did nothing because the corresponding audio/video |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 PipelineStatistics statistics_; | 414 PipelineStatistics statistics_; |
418 | 415 |
419 FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime); | 416 FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime); |
420 | 417 |
421 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); | 418 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); |
422 }; | 419 }; |
423 | 420 |
424 } // namespace media | 421 } // namespace media |
425 | 422 |
426 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ | 423 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ |
OLD | NEW |