1 // Copyright (c) 2012 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 WEBKIT_MEDIA_FILTER_HELPERS_H_
6 #define WEBKIT_MEDIA_FILTER_HELPERS_H_
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_vector.h"
11 // TODO(fgalligan): Remove the dependency on FFmpeg.
12 #include "media/filters/ffmpeg_demuxer.h"
15 class MessageLoopProxy
;
22 class FilterCollection
;
25 namespace webkit_media
{
27 // Creates and adds the default set of audio decoders to |audio_decoders|.
28 void AddDefaultAudioDecoders(
29 const scoped_refptr
<base::MessageLoopProxy
>& message_loop
,
30 ScopedVector
<media::AudioDecoder
>* audio_decoders
);
32 // Builds the required filters for handling media source URLs, adds them to
33 // |filter_collection|.
34 void BuildMediaSourceCollection(
35 const scoped_refptr
<media::ChunkDemuxer
>& demuxer
,
36 const scoped_refptr
<base::MessageLoopProxy
>& message_loop
,
37 media::FilterCollection
* filter_collection
);
39 // Builds the required filters for handling regular URLs and adds them to
40 // |filter_collection| and fills |video_decoder| returning true if successful.
41 void BuildDefaultCollection(
42 const scoped_refptr
<media::DataSource
>& data_source
,
43 const scoped_refptr
<base::MessageLoopProxy
>& message_loop
,
44 media::FilterCollection
* filter_collection
,
45 const media::FFmpegNeedKeyCB
& need_key_cb
);
49 #endif // WEBKIT_MEDIA_FILTER_HELPERS_H_