| Index: media/base/filter_collection.cc
|
| ===================================================================
|
| --- media/base/filter_collection.cc (revision 68165)
|
| +++ media/base/filter_collection.cc (working copy)
|
| @@ -43,31 +43,31 @@
|
|
|
| void FilterCollection::SelectDataSource(
|
| scoped_refptr<DataSource>* filter_out) {
|
| - SelectFilter<DATA_SOURCE>(filter_out);
|
| + SelectFilter<DATA_SOURCE>(filter_out, NULL);
|
| }
|
|
|
| void FilterCollection::SelectDemuxer(scoped_refptr<Demuxer>* filter_out) {
|
| - SelectFilter<DEMUXER>(filter_out);
|
| + SelectFilter<DEMUXER>(filter_out, NULL);
|
| }
|
|
|
| void FilterCollection::SelectVideoDecoder(
|
| - scoped_refptr<VideoDecoder>* filter_out) {
|
| - SelectFilter<VIDEO_DECODER>(filter_out);
|
| + scoped_refptr<VideoDecoder>* filter_out, int codec_id) {
|
| + SelectFilter<VIDEO_DECODER>(filter_out, &codec_id);
|
| }
|
|
|
| void FilterCollection::SelectAudioDecoder(
|
| scoped_refptr<AudioDecoder>* filter_out) {
|
| - SelectFilter<AUDIO_DECODER>(filter_out);
|
| + SelectFilter<AUDIO_DECODER>(filter_out, NULL);
|
| }
|
|
|
| void FilterCollection::SelectVideoRenderer(
|
| scoped_refptr<VideoRenderer>* filter_out) {
|
| - SelectFilter<VIDEO_RENDERER>(filter_out);
|
| + SelectFilter<VIDEO_RENDERER>(filter_out, NULL);
|
| }
|
|
|
| void FilterCollection::SelectAudioRenderer(
|
| scoped_refptr<AudioRenderer>* filter_out) {
|
| - SelectFilter<AUDIO_RENDERER>(filter_out);
|
| + SelectFilter<AUDIO_RENDERER>(filter_out, NULL);
|
| }
|
|
|
| void FilterCollection::AddFilter(FilterType filter_type,
|
| @@ -76,20 +76,28 @@
|
| }
|
|
|
| template<FilterCollection::FilterType filter_type, typename F>
|
| -void FilterCollection::SelectFilter(scoped_refptr<F>* filter_out) {
|
| +void FilterCollection::SelectFilter(scoped_refptr<F>* filter_out,
|
| + void *filter_props) {
|
| scoped_refptr<Filter> filter;
|
| - SelectFilter(filter_type, &filter);
|
| + SelectFilter(filter_type, &filter, filter_props);
|
| *filter_out = reinterpret_cast<F*>(filter.get());
|
| }
|
|
|
| void FilterCollection::SelectFilter(
|
| FilterType filter_type,
|
| - scoped_refptr<Filter>* filter_out) {
|
| + scoped_refptr<Filter>* filter_out, void *filter_props) {
|
|
|
| FilterList::iterator it = filters_.begin();
|
| while (it != filters_.end()) {
|
| - if (it->first == filter_type)
|
| - break;
|
| + if (it->first == filter_type) {
|
| + if (filter_props == NULL)
|
| + break;
|
| + // Now assume that *filter_props contains codec_id and we need
|
| + // to select filter which supports this codec_id
|
| + int codec_id = *(int*)filter_props;
|
| + if (it->second->supports_codec_id(codec_id) == true)
|
| + break;
|
| + }
|
| ++it;
|
| }
|
|
|
|
|