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
3 // found in the LICENSE file.
5 #ifndef MEDIA_FILTERS_CHUNK_DEMUXER_FACTORY_H_
6 #define MEDIA_FILTERS_CHUNK_DEMUXER_FACTORY_H_
10 #include "base/memory/scoped_ptr.h"
11 #include "media/base/filter_factories.h"
16 class ChunkDemuxerClient
;
18 // Factory for building ChunkDemuxers. The factory will only build a
19 // ChunkDemuxer for build URLs that match the one passed into the constructor.
20 // All other URLs are delegated to |delegate_factory_|. The url passed to
21 // the constructor represents the "special" URL that indicates that the
22 // ChunkDemuxer should be used for playback.
23 class MEDIA_EXPORT ChunkDemuxerFactory
: public DemuxerFactory
{
25 // Takes ownership of |delegate_factory|.
26 ChunkDemuxerFactory(const std::string
& url
, DemuxerFactory
* delegate_factory
,
27 ChunkDemuxerClient
* client
);
28 virtual ~ChunkDemuxerFactory();
30 // DemuxerFactory methods.
31 virtual void Build(const std::string
& url
, const BuildCallback
& cb
);
32 virtual DemuxerFactory
* Clone() const;
36 scoped_ptr
<DemuxerFactory
> delegate_factory_
;
37 ChunkDemuxerClient
* client_
;
39 DISALLOW_IMPLICIT_CONSTRUCTORS(ChunkDemuxerFactory
);
44 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_FACTORY_H_