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

Side by Side Diff: media/filters/dummy_demuxer.cc

Issue 9968117: Move Demuxer::set_host() to Initialize(). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: Created 8 years, 8 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/filters/dummy_demuxer.h" 5 #include "media/filters/dummy_demuxer.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace media { 9 namespace media {
10 10
(...skipping 15 matching lines...) Expand all
26 const VideoDecoderConfig& DummyDemuxerStream::video_decoder_config() { 26 const VideoDecoderConfig& DummyDemuxerStream::video_decoder_config() {
27 CHECK_EQ(type_, VIDEO); 27 CHECK_EQ(type_, VIDEO);
28 return video_config_; 28 return video_config_;
29 } 29 }
30 30
31 void DummyDemuxerStream::Read(const ReadCB& read_cb) {} 31 void DummyDemuxerStream::Read(const ReadCB& read_cb) {}
32 32
33 void DummyDemuxerStream::EnableBitstreamConverter() {} 33 void DummyDemuxerStream::EnableBitstreamConverter() {}
34 34
35 DummyDemuxer::DummyDemuxer(bool has_video, bool has_audio, bool local_source) 35 DummyDemuxer::DummyDemuxer(bool has_video, bool has_audio, bool local_source)
36 : has_video_(has_video), 36 : host_(NULL),
37 has_video_(has_video),
37 has_audio_(has_audio), 38 has_audio_(has_audio),
38 local_source_(local_source) { 39 local_source_(local_source) {
39 streams_.resize(DemuxerStream::NUM_TYPES); 40 streams_.resize(DemuxerStream::NUM_TYPES);
40 if (has_audio) 41 if (has_audio)
41 streams_[DemuxerStream::AUDIO] = 42 streams_[DemuxerStream::AUDIO] =
42 new DummyDemuxerStream(DemuxerStream::AUDIO); 43 new DummyDemuxerStream(DemuxerStream::AUDIO);
43 if (has_video) 44 if (has_video)
44 streams_[DemuxerStream::VIDEO] = 45 streams_[DemuxerStream::VIDEO] =
45 new DummyDemuxerStream(DemuxerStream::VIDEO); 46 new DummyDemuxerStream(DemuxerStream::VIDEO);
46 } 47 }
47 48
48 DummyDemuxer::~DummyDemuxer() {} 49 DummyDemuxer::~DummyDemuxer() {}
49 50
50 void DummyDemuxer::Initialize(const PipelineStatusCB& status_cb) { 51 void DummyDemuxer::Initialize(DemuxerHost* host,
52 const PipelineStatusCB& status_cb) {
51 status_cb.Run(PIPELINE_OK); 53 status_cb.Run(PIPELINE_OK);
52 } 54 }
53 55
54 scoped_refptr<DemuxerStream> DummyDemuxer::GetStream(DemuxerStream::Type type) { 56 scoped_refptr<DemuxerStream> DummyDemuxer::GetStream(DemuxerStream::Type type) {
55 return streams_[type]; 57 return streams_[type];
56 } 58 }
57 59
58 void DummyDemuxer::set_host(DemuxerHost* demuxer_host) {
59 Demuxer::set_host(demuxer_host);
60 host()->SetDuration(media::kInfiniteDuration());
acolwell GONE FROM CHROMIUM 2012/04/04 16:01:00 Why don't we need this call anymore?
scherkus (not reviewing) 2012/04/05 01:54:53 whoops!
61 }
62
63 base::TimeDelta DummyDemuxer::GetStartTime() const { 60 base::TimeDelta DummyDemuxer::GetStartTime() const {
64 return base::TimeDelta(); 61 return base::TimeDelta();
65 } 62 }
66 63
67 int DummyDemuxer::GetBitrate() { 64 int DummyDemuxer::GetBitrate() {
68 return 0; 65 return 0;
69 } 66 }
70 67
71 bool DummyDemuxer::IsLocalSource() { 68 bool DummyDemuxer::IsLocalSource() {
72 return local_source_; 69 return local_source_;
73 } 70 }
74 71
75 bool DummyDemuxer::IsSeekable() { 72 bool DummyDemuxer::IsSeekable() {
76 // This is always false because DummyDemuxer is only used by WebRTC and such 73 // This is always false because DummyDemuxer is only used by WebRTC and such
77 // streams are not seekable. 74 // streams are not seekable.
78 return false; 75 return false;
79 } 76 }
80 77
81 } // namespace media 78 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698