Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(321)

Side by Side Diff: media/base/filter_collection.cc

Issue 10836167: Move VideoDecoder initialization into VideoRendererBase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "media/base/audio_renderer.h" 9 #include "media/base/audio_renderer.h"
10 #include "media/base/demuxer.h" 10 #include "media/base/demuxer.h"
(...skipping 11 matching lines...) Expand all
22 } 22 }
23 23
24 const scoped_refptr<Demuxer>& FilterCollection::GetDemuxer() { 24 const scoped_refptr<Demuxer>& FilterCollection::GetDemuxer() {
25 return demuxer_; 25 return demuxer_;
26 } 26 }
27 27
28 void FilterCollection::AddAudioDecoder(AudioDecoder* audio_decoder) { 28 void FilterCollection::AddAudioDecoder(AudioDecoder* audio_decoder) {
29 audio_decoders_.push_back(audio_decoder); 29 audio_decoders_.push_back(audio_decoder);
30 } 30 }
31 31
32 void FilterCollection::AddVideoDecoder(VideoDecoder* video_decoder) {
33 video_decoders_.push_back(video_decoder);
34 }
35
36 void FilterCollection::AddAudioRenderer(AudioRenderer* audio_renderer) { 32 void FilterCollection::AddAudioRenderer(AudioRenderer* audio_renderer) {
37 audio_renderers_.push_back(audio_renderer); 33 audio_renderers_.push_back(audio_renderer);
38 } 34 }
39 35
40 void FilterCollection::AddVideoRenderer(VideoRenderer* video_renderer) { 36 void FilterCollection::AddVideoRenderer(VideoRenderer* video_renderer) {
41 video_renderers_.push_back(video_renderer); 37 video_renderers_.push_back(video_renderer);
42 } 38 }
43 39
44 bool FilterCollection::IsEmpty() const { 40 bool FilterCollection::IsEmpty() const {
45 return audio_decoders_.empty() && 41 return audio_decoders_.empty() &&
(...skipping 11 matching lines...) Expand all
57 53
58 void FilterCollection::SelectAudioDecoder(scoped_refptr<AudioDecoder>* out) { 54 void FilterCollection::SelectAudioDecoder(scoped_refptr<AudioDecoder>* out) {
59 if (audio_decoders_.empty()) { 55 if (audio_decoders_.empty()) {
60 *out = NULL; 56 *out = NULL;
61 return; 57 return;
62 } 58 }
63 *out = audio_decoders_.front(); 59 *out = audio_decoders_.front();
64 audio_decoders_.pop_front(); 60 audio_decoders_.pop_front();
65 } 61 }
66 62
67 void FilterCollection::SelectVideoDecoder(scoped_refptr<VideoDecoder>* out) {
68 if (video_decoders_.empty()) {
69 *out = NULL;
70 return;
71 }
72 *out = video_decoders_.front();
73 video_decoders_.pop_front();
74 }
75
76 void FilterCollection::SelectAudioRenderer(scoped_refptr<AudioRenderer>* out) { 63 void FilterCollection::SelectAudioRenderer(scoped_refptr<AudioRenderer>* out) {
77 if (audio_renderers_.empty()) { 64 if (audio_renderers_.empty()) {
78 *out = NULL; 65 *out = NULL;
79 return; 66 return;
80 } 67 }
81 *out = audio_renderers_.front(); 68 *out = audio_renderers_.front();
82 audio_renderers_.pop_front(); 69 audio_renderers_.pop_front();
83 } 70 }
84 71
85 void FilterCollection::SelectVideoRenderer(scoped_refptr<VideoRenderer>* out) { 72 void FilterCollection::SelectVideoRenderer(scoped_refptr<VideoRenderer>* out) {
86 if (video_renderers_.empty()) { 73 if (video_renderers_.empty()) {
87 *out = NULL; 74 *out = NULL;
88 return; 75 return;
89 } 76 }
90 *out = video_renderers_.front(); 77 *out = video_renderers_.front();
91 video_renderers_.pop_front(); 78 video_renderers_.pop_front();
92 } 79 }
93 80
81 FilterCollection::VideoDecoderList&
82 FilterCollection::GetVideoDecoders() {
83 return video_decoders_;
84 }
85
94 } // namespace media 86 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698