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 #include "media/base/filter_collection.h"
7 #include "base/logging.h"
8 #include "media/base/audio_decoder.h"
9 #include "media/base/audio_renderer.h"
10 #include "media/base/demuxer.h"
11 #include "media/base/video_decoder.h"
12 #include "media/base/video_renderer.h"
16 FilterCollection::FilterCollection() {}
18 FilterCollection::~FilterCollection() {}
20 void FilterCollection::SetDemuxer(const scoped_refptr
<Demuxer
>& demuxer
) {
24 const scoped_refptr
<Demuxer
>& FilterCollection::GetDemuxer() {
28 void FilterCollection::AddAudioRenderer(AudioRenderer
* audio_renderer
) {
29 audio_renderers_
.push_back(audio_renderer
);
32 void FilterCollection::AddVideoRenderer(VideoRenderer
* video_renderer
) {
33 video_renderers_
.push_back(video_renderer
);
36 void FilterCollection::Clear() {
37 audio_decoders_
.clear();
38 video_decoders_
.clear();
39 audio_renderers_
.clear();
40 video_renderers_
.clear();
43 void FilterCollection::SelectAudioRenderer(scoped_refptr
<AudioRenderer
>* out
) {
44 if (audio_renderers_
.empty()) {
48 *out
= audio_renderers_
.front();
49 audio_renderers_
.pop_front();
52 void FilterCollection::SelectVideoRenderer(scoped_refptr
<VideoRenderer
>* out
) {
53 if (video_renderers_
.empty()) {
57 *out
= video_renderers_
.front();
58 video_renderers_
.pop_front();
61 FilterCollection::AudioDecoderList
* FilterCollection::GetAudioDecoders() {
62 return &audio_decoders_
;
65 FilterCollection::VideoDecoderList
* FilterCollection::GetVideoDecoders() {
66 return &video_decoders_
;