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

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: Rebase 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 {
45 return audio_decoders_.empty() &&
46 video_decoders_.empty() &&
47 audio_renderers_.empty() &&
48 video_renderers_.empty();
49 }
50
51 void FilterCollection::Clear() { 40 void FilterCollection::Clear() {
52 audio_decoders_.clear(); 41 audio_decoders_.clear();
53 video_decoders_.clear(); 42 video_decoders_.clear();
54 audio_renderers_.clear(); 43 audio_renderers_.clear();
55 video_renderers_.clear(); 44 video_renderers_.clear();
56 } 45 }
57 46
58 void FilterCollection::SelectAudioDecoder(scoped_refptr<AudioDecoder>* out) { 47 void FilterCollection::SelectAudioDecoder(scoped_refptr<AudioDecoder>* out) {
59 if (audio_decoders_.empty()) { 48 if (audio_decoders_.empty()) {
60 *out = NULL; 49 *out = NULL;
61 return; 50 return;
62 } 51 }
63 *out = audio_decoders_.front(); 52 *out = audio_decoders_.front();
64 audio_decoders_.pop_front(); 53 audio_decoders_.pop_front();
65 } 54 }
66 55
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) { 56 void FilterCollection::SelectAudioRenderer(scoped_refptr<AudioRenderer>* out) {
77 if (audio_renderers_.empty()) { 57 if (audio_renderers_.empty()) {
78 *out = NULL; 58 *out = NULL;
79 return; 59 return;
80 } 60 }
81 *out = audio_renderers_.front(); 61 *out = audio_renderers_.front();
82 audio_renderers_.pop_front(); 62 audio_renderers_.pop_front();
83 } 63 }
84 64
85 void FilterCollection::SelectVideoRenderer(scoped_refptr<VideoRenderer>* out) { 65 void FilterCollection::SelectVideoRenderer(scoped_refptr<VideoRenderer>* out) {
86 if (video_renderers_.empty()) { 66 if (video_renderers_.empty()) {
87 *out = NULL; 67 *out = NULL;
88 return; 68 return;
89 } 69 }
90 *out = video_renderers_.front(); 70 *out = video_renderers_.front();
91 video_renderers_.pop_front(); 71 video_renderers_.pop_front();
92 } 72 }
93 73
74 FilterCollection::VideoDecoderList*
75 FilterCollection::GetVideoDecoders() {
76 return &video_decoders_;
77 }
78
94 } // namespace media 79 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698