OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #include "media/base/filter_collection.h" | 5 #include "media/base/filter_collection.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "media/base/audio_decoder.h" | 8 #include "media/base/audio_decoder.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
11 | 11 |
12 FilterCollection::FilterCollection() {} | 12 FilterCollection::FilterCollection() {} |
13 | 13 |
14 FilterCollection::~FilterCollection() {} | 14 FilterCollection::~FilterCollection() {} |
15 | 15 |
16 void FilterCollection::SetDemuxerFactory(scoped_ptr<DemuxerFactory> factory) { | 16 void FilterCollection::SetDemuxer(const scoped_refptr<Demuxer>& demuxer) { |
17 DCHECK(factory.get()); | 17 demuxer_ = demuxer; |
18 demuxer_factory_ = factory.Pass(); | |
19 } | 18 } |
20 | 19 |
21 DemuxerFactory* FilterCollection::GetDemuxerFactory() { | 20 const scoped_refptr<Demuxer>& FilterCollection::GetDemuxer() { |
22 return demuxer_factory_.get(); | 21 return demuxer_; |
23 } | 22 } |
24 | 23 |
25 void FilterCollection::AddAudioDecoder(AudioDecoder* audio_decoder) { | 24 void FilterCollection::AddAudioDecoder(AudioDecoder* audio_decoder) { |
26 audio_decoders_.push_back(audio_decoder); | 25 audio_decoders_.push_back(audio_decoder); |
27 } | 26 } |
28 | 27 |
29 void FilterCollection::AddVideoDecoder(VideoDecoder* video_decoder) { | 28 void FilterCollection::AddVideoDecoder(VideoDecoder* video_decoder) { |
30 video_decoders_.push_back(video_decoder); | 29 video_decoders_.push_back(video_decoder); |
31 } | 30 } |
32 | 31 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 ++it; | 97 ++it; |
99 } | 98 } |
100 | 99 |
101 if (it != filters_.end()) { | 100 if (it != filters_.end()) { |
102 *filter_out = it->second.get(); | 101 *filter_out = it->second.get(); |
103 filters_.erase(it); | 102 filters_.erase(it); |
104 } | 103 } |
105 } | 104 } |
106 | 105 |
107 } // namespace media | 106 } // namespace media |
OLD | NEW |