OLD | NEW |
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 void FakeDemuxerStream::SatisfyRead() { | 105 void FakeDemuxerStream::SatisfyRead() { |
106 DCHECK(task_runner_->BelongsToCurrentThread()); | 106 DCHECK(task_runner_->BelongsToCurrentThread()); |
107 DCHECK_EQ(read_to_hold_, next_read_num_); | 107 DCHECK_EQ(read_to_hold_, next_read_num_); |
108 DCHECK(!read_cb_.is_null()); | 108 DCHECK(!read_cb_.is_null()); |
109 | 109 |
110 read_to_hold_ = -1; | 110 read_to_hold_ = -1; |
111 DoRead(); | 111 DoRead(); |
112 } | 112 } |
113 | 113 |
| 114 void FakeDemuxerStream::SatisfyAndHoldRead() { |
| 115 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 116 DCHECK_EQ(read_to_hold_, next_read_num_); |
| 117 DCHECK(!read_cb_.is_null()); |
| 118 |
| 119 ++read_to_hold_; |
| 120 DoRead(); |
| 121 } |
| 122 |
114 void FakeDemuxerStream::Reset() { | 123 void FakeDemuxerStream::Reset() { |
115 read_to_hold_ = -1; | 124 read_to_hold_ = -1; |
116 | 125 |
117 if (!read_cb_.is_null()) | 126 if (!read_cb_.is_null()) |
118 base::ResetAndReturn(&read_cb_).Run(kAborted, NULL); | 127 base::ResetAndReturn(&read_cb_).Run(kAborted, NULL); |
119 } | 128 } |
120 | 129 |
121 void FakeDemuxerStream::UpdateVideoDecoderConfig() { | 130 void FakeDemuxerStream::UpdateVideoDecoderConfig() { |
122 const gfx::Rect kVisibleRect(kStartWidth, kStartHeight); | 131 const gfx::Rect kVisibleRect(kStartWidth, kStartHeight); |
123 video_decoder_config_.Initialize( | 132 video_decoder_config_.Initialize( |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 173 |
165 num_buffers_left_in_current_config_--; | 174 num_buffers_left_in_current_config_--; |
166 if (num_buffers_left_in_current_config_ == 0) | 175 if (num_buffers_left_in_current_config_ == 0) |
167 num_configs_left_--; | 176 num_configs_left_--; |
168 | 177 |
169 num_buffers_returned_++; | 178 num_buffers_returned_++; |
170 base::ResetAndReturn(&read_cb_).Run(kOk, buffer); | 179 base::ResetAndReturn(&read_cb_).Run(kOk, buffer); |
171 } | 180 } |
172 | 181 |
173 } // namespace media | 182 } // namespace media |
OLD | NEW |