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