| OLD | NEW |
| 1 // Copyright (c) 2006-2009 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 <string> | 10 #include <string> |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 // 3. The client calls Pipeline::Stop() | 259 // 3. The client calls Pipeline::Stop() |
| 260 // | 260 // |
| 261 // Callers can optionally use the returned Filter for further processing, | 261 // Callers can optionally use the returned Filter for further processing, |
| 262 // but since the call already placed the filter in the list of filter hosts, | 262 // but since the call already placed the filter in the list of filter hosts, |
| 263 // callers can ignore the return value. In any case, if this function can | 263 // callers can ignore the return value. In any case, if this function can |
| 264 // not create and initailze the speified Filter, then this method will return | 264 // not create and initailze the speified Filter, then this method will return |
| 265 // with |pipeline_->error_| != PIPELINE_OK. | 265 // with |pipeline_->error_| != PIPELINE_OK. |
| 266 template <class Filter, class Source> | 266 template <class Filter, class Source> |
| 267 scoped_refptr<Filter> CreateFilter(FilterFactory* filter_factory, | 267 scoped_refptr<Filter> CreateFilter(FilterFactory* filter_factory, |
| 268 Source source, | 268 Source source, |
| 269 const MediaFormat* source_media_format); | 269 const MediaFormat& source_media_format); |
| 270 | 270 |
| 271 // Creates a Filter and initilizes it with the given |source|. If a Filter | 271 // Creates a Filter and initilizes it with the given |source|. If a Filter |
| 272 // could not be created or an error occurred, this metod returns NULL and the | 272 // could not be created or an error occurred, this metod returns NULL and the |
| 273 // pipeline's |error_| member will contain a specific error code. Note that | 273 // pipeline's |error_| member will contain a specific error code. Note that |
| 274 // the Source could be a filter or a DemuxerStream, but it must support the | 274 // the Source could be a filter or a DemuxerStream, but it must support the |
| 275 // GetMediaFormat() method. | 275 // GetMediaFormat() method. |
| 276 template <class Filter, class Source> | 276 template <class Filter, class Source> |
| 277 scoped_refptr<Filter> CreateFilter(FilterFactory* filter_factory, | 277 scoped_refptr<Filter> CreateFilter(FilterFactory* filter_factory, |
| 278 Source* source) { | 278 Source* source) { |
| 279 return CreateFilter<Filter, Source*>(filter_factory, | 279 return CreateFilter<Filter, Source*>(filter_factory, |
| 280 source, | 280 source, |
| 281 source->GetMediaFormat()); | 281 source->media_format()); |
| 282 } | 282 } |
| 283 | 283 |
| 284 // Creates a DataSource (the first filter in a pipeline), and initializes it | 284 // Creates a DataSource (the first filter in a pipeline), and initializes it |
| 285 // with the specified URL. | 285 // with the specified URL. |
| 286 scoped_refptr<DataSource> CreateDataSource(FilterFactory* filter_factory, | 286 scoped_refptr<DataSource> CreateDataSource(FilterFactory* filter_factory, |
| 287 const std::string& url); | 287 const std::string& url); |
| 288 | 288 |
| 289 // If the |demuxer| contains a stream that matches Decoder::major_media_type() | 289 // If the |demuxer| contains a stream that matches Decoder::major_media_type() |
| 290 // this method creates and initializes the specified Decoder and Renderer. | 290 // this method creates and initializes the specified Decoder and Renderer. |
| 291 // Callers should examine the |pipeline_->error_| member to see if there was | 291 // Callers should examine the |pipeline_->error_| member to see if there was |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 // Vector of FilterHostImpl objects that contian the filters for the pipeline. | 325 // Vector of FilterHostImpl objects that contian the filters for the pipeline. |
| 326 typedef std::vector<FilterHostImpl*> FilterHostVector; | 326 typedef std::vector<FilterHostImpl*> FilterHostVector; |
| 327 FilterHostVector filter_hosts_; | 327 FilterHostVector filter_hosts_; |
| 328 | 328 |
| 329 DISALLOW_COPY_AND_ASSIGN(PipelineThread); | 329 DISALLOW_COPY_AND_ASSIGN(PipelineThread); |
| 330 }; | 330 }; |
| 331 | 331 |
| 332 } // namespace media | 332 } // namespace media |
| 333 | 333 |
| 334 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ | 334 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ |
| OLD | NEW |