OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <utility> | 5 #include <utility> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 CallInitialize(event.GetPipelineStatusCB(), low_delay, expect_to_success); | 107 CallInitialize(event.GetPipelineStatusCB(), low_delay, expect_to_success); |
108 event.RunAndWaitForStatus(expect_to_success ? PIPELINE_OK | 108 event.RunAndWaitForStatus(expect_to_success ? PIPELINE_OK |
109 : DECODER_ERROR_NOT_SUPPORTED); | 109 : DECODER_ERROR_NOT_SUPPORTED); |
110 } | 110 } |
111 | 111 |
112 void CallInitialize(const PipelineStatusCB& status_cb, | 112 void CallInitialize(const PipelineStatusCB& status_cb, |
113 bool low_delay, | 113 bool low_delay, |
114 bool expect_to_success) { | 114 bool expect_to_success) { |
115 if (low_delay) | 115 if (low_delay) |
116 demuxer_stream_.set_liveness(DemuxerStream::LIVENESS_LIVE); | 116 demuxer_stream_.set_liveness(DemuxerStream::LIVENESS_LIVE); |
117 EXPECT_CALL(*decoder_, Initialize(_, _, _, _)) | 117 EXPECT_CALL(*decoder_, Initialize(_, _, _, _, _)) |
118 .WillOnce( | 118 .WillOnce( |
119 DoAll(SaveArg<3>(&output_cb_), RunCallback<2>(expect_to_success))); | 119 DoAll(SaveArg<4>(&output_cb_), RunCallback<3>(expect_to_success))); |
120 EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0); | 120 EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0); |
121 renderer_->Initialize( | 121 renderer_->Initialize( |
122 &demuxer_stream_, status_cb, SetCdmReadyCB(), | 122 &demuxer_stream_, status_cb, SetCdmReadyCB(), |
123 base::Bind(&VideoRendererImplTest::OnStatisticsUpdate, | 123 base::Bind(&VideoRendererImplTest::OnStatisticsUpdate, |
124 base::Unretained(this)), | 124 base::Unretained(this)), |
125 base::Bind(&StrictMock<MockCB>::BufferingStateChange, | 125 base::Bind(&StrictMock<MockCB>::BufferingStateChange, |
126 base::Unretained(&mock_cb_)), | 126 base::Unretained(&mock_cb_)), |
127 ended_event_.GetClosure(), error_event_.GetPipelineStatusCB(), | 127 ended_event_.GetClosure(), error_event_.GetPipelineStatusCB(), |
128 base::Bind(&WallClockTimeSource::GetWallClockTimes, | 128 base::Bind(&WallClockTimeSource::GetWallClockTimes, |
129 base::Unretained(&time_source_)), | 129 base::Unretained(&time_source_)), |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 QueueFrames("0 10 20 30"); | 773 QueueFrames("0 10 20 30"); |
774 StartPlayingFrom(0); | 774 StartPlayingFrom(0); |
775 Flush(); | 775 Flush(); |
776 ASSERT_EQ(1u, frame_ready_cbs_.size()); | 776 ASSERT_EQ(1u, frame_ready_cbs_.size()); |
777 // This frame will be discarded. | 777 // This frame will be discarded. |
778 frame_ready_cbs_.front().Run(); | 778 frame_ready_cbs_.front().Run(); |
779 Destroy(); | 779 Destroy(); |
780 } | 780 } |
781 | 781 |
782 } // namespace media | 782 } // namespace media |
OLD | NEW |