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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 num_buffers_left_in_current_config_ = num_buffers_in_one_config_; | 135 num_buffers_left_in_current_config_ = num_buffers_in_one_config_; |
136 UpdateVideoDecoderConfig(); | 136 UpdateVideoDecoderConfig(); |
137 base::ResetAndReturn(&read_cb_).Run(kConfigChanged, NULL); | 137 base::ResetAndReturn(&read_cb_).Run(kConfigChanged, NULL); |
138 return; | 138 return; |
139 } | 139 } |
140 | 140 |
141 scoped_refptr<DecoderBuffer> buffer = CreateFakeVideoBufferForTest( | 141 scoped_refptr<DecoderBuffer> buffer = CreateFakeVideoBufferForTest( |
142 video_decoder_config_, current_timestamp_, duration_); | 142 video_decoder_config_, current_timestamp_, duration_); |
143 | 143 |
144 // TODO(xhwang): Output out-of-order buffers if needed. | 144 // TODO(xhwang): Output out-of-order buffers if needed. |
| 145 buffer->set_timestamp(current_timestamp_); |
| 146 buffer->set_duration(duration_); |
145 current_timestamp_ += duration_; | 147 current_timestamp_ += duration_; |
146 | 148 |
147 num_buffers_left_in_current_config_--; | 149 num_buffers_left_in_current_config_--; |
148 if (num_buffers_left_in_current_config_ == 0) | 150 if (num_buffers_left_in_current_config_ == 0) |
149 num_configs_left_--; | 151 num_configs_left_--; |
150 | 152 |
151 num_buffers_returned_++; | 153 num_buffers_returned_++; |
152 base::ResetAndReturn(&read_cb_).Run(kOk, buffer); | 154 base::ResetAndReturn(&read_cb_).Run(kOk, buffer); |
153 } | 155 } |
154 | 156 |
155 } // namespace media | 157 } // namespace media |
OLD | NEW |