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

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

Issue 2667283002: Refactor MediaResource to be multi-stream capable (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « media/base/fake_demuxer_stream.h ('k') | media/base/fake_text_track_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/fake_demuxer_stream.h" 5 #include "media/base/fake_demuxer_stream.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 } 104 }
105 105
106 bool FakeDemuxerStream::enabled() const { 106 bool FakeDemuxerStream::enabled() const {
107 return true; 107 return true;
108 } 108 }
109 109
110 void FakeDemuxerStream::set_enabled(bool enabled, base::TimeDelta timestamp) { 110 void FakeDemuxerStream::set_enabled(bool enabled, base::TimeDelta timestamp) {
111 NOTIMPLEMENTED(); 111 NOTIMPLEMENTED();
112 } 112 }
113 113
114 void FakeDemuxerStream::SetStreamStatusChangeCB(
115 const StreamStatusChangeCB& cb) {
116 NOTIMPLEMENTED();
117 }
118
119 void FakeDemuxerStream::HoldNextRead() { 114 void FakeDemuxerStream::HoldNextRead() {
120 DCHECK(task_runner_->BelongsToCurrentThread()); 115 DCHECK(task_runner_->BelongsToCurrentThread());
121 read_to_hold_ = next_read_num_; 116 read_to_hold_ = next_read_num_;
122 } 117 }
123 118
124 void FakeDemuxerStream::HoldNextConfigChangeRead() { 119 void FakeDemuxerStream::HoldNextConfigChangeRead() {
125 DCHECK(task_runner_->BelongsToCurrentThread()); 120 DCHECK(task_runner_->BelongsToCurrentThread());
126 // Set |read_to_hold_| to be the next config change read. 121 // Set |read_to_hold_| to be the next config change read.
127 read_to_hold_ = next_read_num_ + num_buffers_in_one_config_ - 122 read_to_hold_ = next_read_num_ + num_buffers_in_one_config_ -
128 next_read_num_ % (num_buffers_in_one_config_ + 1); 123 next_read_num_ % (num_buffers_in_one_config_ + 1);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 212
218 FakeMediaResource::FakeMediaResource(int num_video_configs, 213 FakeMediaResource::FakeMediaResource(int num_video_configs,
219 int num_video_buffers_in_one_config, 214 int num_video_buffers_in_one_config,
220 bool is_video_encrypted) 215 bool is_video_encrypted)
221 : fake_video_stream_(num_video_configs, 216 : fake_video_stream_(num_video_configs,
222 num_video_buffers_in_one_config, 217 num_video_buffers_in_one_config,
223 is_video_encrypted) {} 218 is_video_encrypted) {}
224 219
225 FakeMediaResource::~FakeMediaResource() {} 220 FakeMediaResource::~FakeMediaResource() {}
226 221
227 DemuxerStream* FakeMediaResource::GetStream(DemuxerStream::Type type) { 222 std::vector<DemuxerStream*> FakeMediaResource::GetStreams() {
228 if (type == DemuxerStream::Type::AUDIO) 223 std::vector<DemuxerStream*> result;
229 return nullptr; 224 result.push_back(&fake_video_stream_);
230 return &fake_video_stream_; 225 return result;
231 }; 226 }
227
228 void FakeMediaResource::SetStreamStatusChangeCB(
229 const StreamStatusChangeCB& cb) {
230 NOTIMPLEMENTED();
231 }
232 232
233 } // namespace media 233 } // namespace media
OLDNEW
« no previous file with comments | « media/base/fake_demuxer_stream.h ('k') | media/base/fake_text_track_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698