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 "content/renderer/media/rtc_video_decoder.h" | 5 #include "content/renderer/media/rtc_video_decoder.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 StatisticsCB NewStatisticsCB() { | 213 StatisticsCB NewStatisticsCB() { |
214 return base::Bind(&MockStatisticsCB::OnStatistics, | 214 return base::Bind(&MockStatisticsCB::OnStatistics, |
215 base::Unretained(&statistics_cb_)); | 215 base::Unretained(&statistics_cb_)); |
216 } | 216 } |
217 | 217 |
218 void RenderFrame() { | 218 void RenderFrame() { |
219 NullVideoFrame video_frame; | 219 NullVideoFrame video_frame; |
220 decoder_->RenderFrame(&video_frame); | 220 decoder_->RenderFrame(&video_frame); |
221 } | 221 } |
222 | 222 |
223 MOCK_METHOD2(FrameReady, void(media::VideoDecoder::DecoderStatus status, | 223 MOCK_METHOD2(FrameReady, void(media::VideoDecoder::Status status, |
224 const scoped_refptr<media::VideoFrame>&)); | 224 const scoped_refptr<media::VideoFrame>&)); |
225 | 225 |
226 // Fixture members. | 226 // Fixture members. |
227 scoped_refptr<MockVideoTrack> video_track_; | 227 scoped_refptr<MockVideoTrack> video_track_; |
228 scoped_refptr<RTCVideoDecoder> decoder_; | 228 scoped_refptr<RTCVideoDecoder> decoder_; |
229 scoped_refptr<MockVideoRenderer> renderer_; | 229 scoped_refptr<MockVideoRenderer> renderer_; |
230 MockStatisticsCB statistics_cb_; | 230 MockStatisticsCB statistics_cb_; |
231 MessageLoop message_loop_; | 231 MessageLoop message_loop_; |
232 media::VideoDecoder::ReadCB read_cb_; | 232 media::VideoDecoder::ReadCB read_cb_; |
233 | 233 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 EXPECT_CALL(*this, FrameReady(media::VideoDecoder::kOk, | 309 EXPECT_CALL(*this, FrameReady(media::VideoDecoder::kOk, |
310 scoped_refptr<media::VideoFrame>())).Times(2); | 310 scoped_refptr<media::VideoFrame>())).Times(2); |
311 decoder_->Read(read_cb_); | 311 decoder_->Read(read_cb_); |
312 EXPECT_FALSE(decoder_->shutting_down_); | 312 EXPECT_FALSE(decoder_->shutting_down_); |
313 decoder_->PrepareForShutdownHack(); | 313 decoder_->PrepareForShutdownHack(); |
314 EXPECT_TRUE(decoder_->shutting_down_); | 314 EXPECT_TRUE(decoder_->shutting_down_); |
315 decoder_->Read(read_cb_); | 315 decoder_->Read(read_cb_); |
316 | 316 |
317 message_loop_.RunAllPending(); | 317 message_loop_.RunAllPending(); |
318 } | 318 } |
OLD | NEW |