OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/test_helpers.h" | 5 #include "media/base/test_helpers.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/pickle.h" | 10 #include "base/pickle.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 const VideoDecoderConfig& config, | 212 const VideoDecoderConfig& config, |
213 base::TimeDelta timestamp, base::TimeDelta duration) { | 213 base::TimeDelta timestamp, base::TimeDelta duration) { |
214 Pickle pickle; | 214 Pickle pickle; |
215 pickle.WriteString(kFakeVideoBufferHeader); | 215 pickle.WriteString(kFakeVideoBufferHeader); |
216 pickle.WriteInt(config.coded_size().width()); | 216 pickle.WriteInt(config.coded_size().width()); |
217 pickle.WriteInt(config.coded_size().height()); | 217 pickle.WriteInt(config.coded_size().height()); |
218 pickle.WriteInt64(timestamp.InMilliseconds()); | 218 pickle.WriteInt64(timestamp.InMilliseconds()); |
219 | 219 |
220 scoped_refptr<DecoderBuffer> buffer = DecoderBuffer::CopyFrom( | 220 scoped_refptr<DecoderBuffer> buffer = DecoderBuffer::CopyFrom( |
221 static_cast<const uint8*>(pickle.data()), | 221 static_cast<const uint8*>(pickle.data()), |
222 static_cast<int>(pickle.size())); | 222 static_cast<int>(pickle.size()), |
| 223 true); |
223 buffer->set_timestamp(timestamp); | 224 buffer->set_timestamp(timestamp); |
224 buffer->set_duration(duration); | 225 buffer->set_duration(duration); |
225 | 226 |
226 return buffer; | 227 return buffer; |
227 } | 228 } |
228 | 229 |
229 bool VerifyFakeVideoBufferForTest( | 230 bool VerifyFakeVideoBufferForTest( |
230 const scoped_refptr<DecoderBuffer>& buffer, | 231 const scoped_refptr<DecoderBuffer>& buffer, |
231 const VideoDecoderConfig& config) { | 232 const VideoDecoderConfig& config) { |
232 // Check if the input |buffer| matches the |config|. | 233 // Check if the input |buffer| matches the |config|. |
(...skipping 20 matching lines...) Expand all Loading... |
253 EXPECT_FALSE(expecting_b_); | 254 EXPECT_FALSE(expecting_b_); |
254 expecting_b_ = true; | 255 expecting_b_ = true; |
255 } | 256 } |
256 | 257 |
257 void CallbackPairChecker::RecordBCalled() { | 258 void CallbackPairChecker::RecordBCalled() { |
258 EXPECT_TRUE(expecting_b_); | 259 EXPECT_TRUE(expecting_b_); |
259 expecting_b_ = false; | 260 expecting_b_ = false; |
260 } | 261 } |
261 | 262 |
262 } // namespace media | 263 } // namespace media |
OLD | NEW |