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

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

Issue 208263018: Add SupportsConfigChanges() to DemuxerStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@audioconverterchunk
Patch Set: Make comment not specific to video_decoder_config(). Created 6 years, 9 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
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/filters/fake_demuxer_stream.h" 5 #include "media/filters/fake_demuxer_stream.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // TODO(xhwang): Support audio if needed. 78 // TODO(xhwang): Support audio if needed.
79 DemuxerStream::Type FakeDemuxerStream::type() { 79 DemuxerStream::Type FakeDemuxerStream::type() {
80 DCHECK(task_runner_->BelongsToCurrentThread()); 80 DCHECK(task_runner_->BelongsToCurrentThread());
81 return VIDEO; 81 return VIDEO;
82 } 82 }
83 83
84 void FakeDemuxerStream::EnableBitstreamConverter() { 84 void FakeDemuxerStream::EnableBitstreamConverter() {
85 DCHECK(task_runner_->BelongsToCurrentThread()); 85 DCHECK(task_runner_->BelongsToCurrentThread());
86 } 86 }
87 87
88 bool FakeDemuxerStream::SupportsConfigChanges() {
89 return true;
scherkus (not reviewing) 2014/03/25 22:16:47 is this needed for some tests? do we need some te
rileya (GONE FROM CHROMIUM) 2014/03/25 22:43:19 Yeah, it's used by the tests. I made it return tru
90 }
91
88 void FakeDemuxerStream::HoldNextRead() { 92 void FakeDemuxerStream::HoldNextRead() {
89 DCHECK(task_runner_->BelongsToCurrentThread()); 93 DCHECK(task_runner_->BelongsToCurrentThread());
90 read_to_hold_ = next_read_num_; 94 read_to_hold_ = next_read_num_;
91 } 95 }
92 96
93 void FakeDemuxerStream::HoldNextConfigChangeRead() { 97 void FakeDemuxerStream::HoldNextConfigChangeRead() {
94 DCHECK(task_runner_->BelongsToCurrentThread()); 98 DCHECK(task_runner_->BelongsToCurrentThread());
95 // Set |read_to_hold_| to be the next config change read. 99 // Set |read_to_hold_| to be the next config change read.
96 read_to_hold_ = next_read_num_ + num_buffers_in_one_config_ - 100 read_to_hold_ = next_read_num_ + num_buffers_in_one_config_ -
97 next_read_num_ % (num_buffers_in_one_config_ + 1); 101 next_read_num_ % (num_buffers_in_one_config_ + 1);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 163
160 num_buffers_left_in_current_config_--; 164 num_buffers_left_in_current_config_--;
161 if (num_buffers_left_in_current_config_ == 0) 165 if (num_buffers_left_in_current_config_ == 0)
162 num_configs_left_--; 166 num_configs_left_--;
163 167
164 num_buffers_returned_++; 168 num_buffers_returned_++;
165 base::ResetAndReturn(&read_cb_).Run(kOk, buffer); 169 base::ResetAndReturn(&read_cb_).Run(kOk, buffer);
166 } 170 }
167 171
168 } // namespace media 172 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698