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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/debug/stack_trace.h" | 8 #include "base/debug/stack_trace.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 current_frame_ = NULL; | 227 current_frame_ = NULL; |
228 } | 228 } |
229 | 229 |
230 scoped_refptr<VideoFrame> GetCurrentFrame() { | 230 scoped_refptr<VideoFrame> GetCurrentFrame() { |
231 base::AutoLock l(lock_); | 231 base::AutoLock l(lock_); |
232 return current_frame_; | 232 return current_frame_; |
233 } | 233 } |
234 | 234 |
235 int GetCurrentTimestampInMs() { | 235 int GetCurrentTimestampInMs() { |
236 scoped_refptr<VideoFrame> frame = GetCurrentFrame(); | 236 scoped_refptr<VideoFrame> frame = GetCurrentFrame(); |
237 if (!frame) | 237 if (!frame.get()) |
238 return -1; | 238 return -1; |
239 return frame->GetTimestamp().InMilliseconds(); | 239 return frame->GetTimestamp().InMilliseconds(); |
240 } | 240 } |
241 | 241 |
242 void WaitForError(PipelineStatus expected) { | 242 void WaitForError(PipelineStatus expected) { |
243 SCOPED_TRACE(base::StringPrintf("WaitForError(%d)", expected)); | 243 SCOPED_TRACE(base::StringPrintf("WaitForError(%d)", expected)); |
244 error_event_.RunAndWaitForStatus(expected); | 244 error_event_.RunAndWaitForStatus(expected); |
245 } | 245 } |
246 | 246 |
247 void WaitForEnded() { | 247 void WaitForEnded() { |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 InSequence s; | 642 InSequence s; |
643 | 643 |
644 EXPECT_CALL(*decoder_, Initialize(_, _, _)) | 644 EXPECT_CALL(*decoder_, Initialize(_, _, _)) |
645 .WillOnce(RunCallback<1>(DECODER_ERROR_NOT_SUPPORTED)); | 645 .WillOnce(RunCallback<1>(DECODER_ERROR_NOT_SUPPORTED)); |
646 InitializeRenderer(DECODER_ERROR_NOT_SUPPORTED); | 646 InitializeRenderer(DECODER_ERROR_NOT_SUPPORTED); |
647 | 647 |
648 Stop(); | 648 Stop(); |
649 } | 649 } |
650 | 650 |
651 } // namespace media | 651 } // namespace media |
OLD | NEW |