| 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 #ifndef MEDIA_BASE_FILTER_FACTORIES_H_ | 5 #ifndef MEDIA_BASE_FILTER_FACTORIES_H_ |
| 6 #define MEDIA_BASE_FILTER_FACTORIES_H_ | 6 #define MEDIA_BASE_FILTER_FACTORIES_H_ |
| 7 | 7 |
| 8 #include<string> | 8 #include<string> |
| 9 | 9 |
| 10 #include "base/callback_old.h" | 10 #include "base/callback_old.h" |
| 11 #include "media/base/media_export.h" |
| 11 #include "media/base/pipeline_status.h" | 12 #include "media/base/pipeline_status.h" |
| 12 | 13 |
| 13 namespace media { | 14 namespace media { |
| 14 | 15 |
| 15 class DataSource; | 16 class DataSource; |
| 16 | 17 |
| 17 // Asynchronous factory interface for building DataSource objects. | 18 // Asynchronous factory interface for building DataSource objects. |
| 18 class DataSourceFactory { | 19 class MEDIA_EXPORT DataSourceFactory { |
| 19 public: | 20 public: |
| 20 // Ownership of the DataSource is transferred through this callback. | 21 // Ownership of the DataSource is transferred through this callback. |
| 21 typedef Callback2<PipelineStatus, DataSource*>::Type BuildCallback; | 22 typedef Callback2<PipelineStatus, DataSource*>::Type BuildCallback; |
| 22 | 23 |
| 23 virtual ~DataSourceFactory(); | 24 virtual ~DataSourceFactory(); |
| 24 | 25 |
| 25 // Builds a DataSource for |url| and returns it via |callback|. | 26 // Builds a DataSource for |url| and returns it via |callback|. |
| 26 virtual void Build(const std::string& url, BuildCallback* callback) = 0; | 27 virtual void Build(const std::string& url, BuildCallback* callback) = 0; |
| 27 | 28 |
| 28 // Makes a copy of this factory. | 29 // Makes a copy of this factory. |
| 29 // NOTE: Pending requests are not cloned. | 30 // NOTE: Pending requests are not cloned. |
| 30 virtual DataSourceFactory* Clone() const = 0; | 31 virtual DataSourceFactory* Clone() const = 0; |
| 31 }; | 32 }; |
| 32 | 33 |
| 33 class Demuxer; | 34 class Demuxer; |
| 34 | 35 |
| 35 // Asynchronous factory interface for building Demuxer objects. | 36 // Asynchronous factory interface for building Demuxer objects. |
| 36 class DemuxerFactory { | 37 class MEDIA_EXPORT DemuxerFactory { |
| 37 public: | 38 public: |
| 38 // Ownership of the Demuxer is transferred through this callback. | 39 // Ownership of the Demuxer is transferred through this callback. |
| 39 typedef Callback2<PipelineStatus, Demuxer*>::Type BuildCallback; | 40 typedef Callback2<PipelineStatus, Demuxer*>::Type BuildCallback; |
| 40 | 41 |
| 41 virtual ~DemuxerFactory(); | 42 virtual ~DemuxerFactory(); |
| 42 | 43 |
| 43 // Builds a Demuxer for |url| and returns it via |callback|. | 44 // Builds a Demuxer for |url| and returns it via |callback|. |
| 44 virtual void Build(const std::string& url, BuildCallback* callback) = 0; | 45 virtual void Build(const std::string& url, BuildCallback* callback) = 0; |
| 45 | 46 |
| 46 // Makes a copy of this factory. | 47 // Makes a copy of this factory. |
| 47 // NOTE: Pending requests are not cloned. | 48 // NOTE: Pending requests are not cloned. |
| 48 virtual DemuxerFactory* Clone() const = 0; | 49 virtual DemuxerFactory* Clone() const = 0; |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 } // namespace media | 52 } // namespace media |
| 52 | 53 |
| 53 #endif // MEDIA_BASE_FILTER_FACTORIES_H_ | 54 #endif // MEDIA_BASE_FILTER_FACTORIES_H_ |
| OLD | NEW |