Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: content/renderer/media/capture_video_decoder_unittest.cc

Issue 8400084: refactor video capture in renderer process (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: code review Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/renderer/media/media_stream_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/renderer/media/capture_video_decoder.h" 6 #include "content/renderer/media/capture_video_decoder.h"
7 #include "content/renderer/media/video_capture_impl.h" 7 #include "content/renderer/media/video_capture_impl.h"
8 #include "content/renderer/media/video_capture_impl_manager.h" 8 #include "content/renderer/media/video_capture_impl_manager.h"
9 #include "media/base/filters.h" 9 #include "media/base/filters.h"
10 #include "media/base/limits.h" 10 #include "media/base/limits.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 message_loop_proxy_ = 88 message_loop_proxy_ =
89 base::MessageLoopProxy::current().get(); 89 base::MessageLoopProxy::current().get();
90 vc_manager_ = new MockVideoCaptureImplManager(); 90 vc_manager_ = new MockVideoCaptureImplManager();
91 media::VideoCapture::VideoCaptureCapability capability; 91 media::VideoCapture::VideoCaptureCapability capability;
92 capability.width = 176; 92 capability.width = 176;
93 capability.height = 144; 93 capability.height = 144;
94 capability.max_fps = 30; 94 capability.max_fps = 30;
95 capability.expected_capture_delay = 0; 95 capability.expected_capture_delay = 0;
96 capability.raw_type = media::VideoFrame::I420; 96 capability.raw_type = media::VideoFrame::I420;
97 capability.interlaced = false; 97 capability.interlaced = false;
98 capability.resolution_fixed = false;
99 98
100 decoder_ = new CaptureVideoDecoder(message_loop_proxy_, 99 decoder_ = new CaptureVideoDecoder(message_loop_proxy_,
101 kVideoStreamId, vc_manager_, capability); 100 kVideoStreamId, vc_manager_, capability);
102 renderer_ = new media::MockVideoRenderer(); 101 renderer_ = new media::MockVideoRenderer();
103 102
104 decoder_->set_host(&host_); 103 decoder_->set_host(&host_);
105 decoder_->set_consume_video_frame_callback( 104 decoder_->set_consume_video_frame_callback(
106 base::Bind(&media::MockVideoRenderer::ConsumeVideoFrame, 105 base::Bind(&media::MockVideoRenderer::ConsumeVideoFrame,
107 base::Unretained(renderer_.get()))); 106 base::Unretained(renderer_.get())));
108 EXPECT_CALL(statistics_callback_object_, OnStatistics(_)) 107 EXPECT_CALL(statistics_callback_object_, OnStatistics(_))
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 message_loop_->RunAllPending(); 161 message_loop_->RunAllPending();
163 162
164 EXPECT_CALL(*vc_impl, StopCapture(capture_client)) 163 EXPECT_CALL(*vc_impl, StopCapture(capture_client))
165 .Times(1) 164 .Times(1)
166 .WillOnce(CaptureStopped(capture_client, vc_impl.get())); 165 .WillOnce(CaptureStopped(capture_client, vc_impl.get()));
167 EXPECT_CALL(*vc_manager_, RemoveDevice(_, _)) 166 EXPECT_CALL(*vc_manager_, RemoveDevice(_, _))
168 .WillOnce(Return()); 167 .WillOnce(Return());
169 decoder_->Stop(media::NewExpectedClosure()); 168 decoder_->Stop(media::NewExpectedClosure());
170 message_loop_->RunAllPending(); 169 message_loop_->RunAllPending();
171 } 170 }
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/media_stream_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698