summaryrefslogtreecommitdiffstats
path: root/media/base/composite_data_source_factory.h
blob: 54f6387a1d93d1988c87af060a5de2cc6c251e26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MEDIA_BASE_COMPOSITE_DATA_SOURCE_FACTORY_H_
#define MEDIA_BASE_COMPOSITE_DATA_SOURCE_FACTORY_H_

#include <list>
#include <set>

#include "base/synchronization/lock.h"
#include "media/base/async_filter_factory_base.h"

namespace media {

class MEDIA_EXPORT CompositeDataSourceFactory
    : public AsyncDataSourceFactoryBase {
 public:
  CompositeDataSourceFactory();
  virtual ~CompositeDataSourceFactory();

  // Add factory to this composite.
  void AddFactory(scoped_ptr<DataSourceFactory> factory);

 protected:
  // AsyncDataSourceFactoryBase methods.
  virtual bool AllowRequests() const OVERRIDE;
  virtual AsyncDataSourceFactoryBase::BuildRequest* CreateRequest(
      const std::string& url, const BuildCallback& callback) OVERRIDE;

 private:
  class BuildRequest;

  typedef std::list<DataSourceFactory*> FactoryList;
  FactoryList factories_;

  DISALLOW_COPY_AND_ASSIGN(CompositeDataSourceFactory);
};

}  // namespace media

#endif  // MEDIA_BASE_COMPOSITE_DATA_SOURCE_FACTORY_H_