| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 Pickle pickle; | 143 Pickle pickle; |
| 144 pickle.WriteString(kFakeBufferHeader); | 144 pickle.WriteString(kFakeBufferHeader); |
| 145 pickle.WriteInt(video_decoder_config_.coded_size().width()); | 145 pickle.WriteInt(video_decoder_config_.coded_size().width()); |
| 146 pickle.WriteInt(video_decoder_config_.coded_size().height()); | 146 pickle.WriteInt(video_decoder_config_.coded_size().height()); |
| 147 pickle.WriteInt64(current_timestamp_.InMilliseconds()); | 147 pickle.WriteInt64(current_timestamp_.InMilliseconds()); |
| 148 | 148 |
| 149 scoped_refptr<DecoderBuffer> buffer = DecoderBuffer::CopyFrom( | 149 scoped_refptr<DecoderBuffer> buffer = DecoderBuffer::CopyFrom( |
| 150 static_cast<const uint8*>(pickle.data()), pickle.size()); | 150 static_cast<const uint8*>(pickle.data()), pickle.size()); |
| 151 | 151 |
| 152 // TODO(xhwang): Output out-of-order buffers if needed. | 152 // TODO(xhwang): Output out-of-order buffers if needed. |
| 153 buffer->SetTimestamp(current_timestamp_); | 153 buffer->set_timestamp(current_timestamp_); |
| 154 buffer->SetDuration(duration_); | 154 buffer->set_duration(duration_); |
| 155 current_timestamp_ += duration_; | 155 current_timestamp_ += duration_; |
| 156 | 156 |
| 157 num_buffers_left_in_current_config_--; | 157 num_buffers_left_in_current_config_--; |
| 158 if (num_buffers_left_in_current_config_ == 0) | 158 if (num_buffers_left_in_current_config_ == 0) |
| 159 num_configs_left_--; | 159 num_configs_left_--; |
| 160 | 160 |
| 161 num_buffers_returned_++; | 161 num_buffers_returned_++; |
| 162 base::ResetAndReturn(&read_cb_).Run(kOk, buffer); | 162 base::ResetAndReturn(&read_cb_).Run(kOk, buffer); |
| 163 } | 163 } |
| 164 | 164 |
| 165 } // namespace media | 165 } // namespace media |
| OLD | NEW |