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

Side by Side Diff: webkit/support/test_media_stream_client.cc

Issue 8887004: add components for integration test which will detect breakage of media pipeline with video captu... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase Created 8 years, 11 months 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "webkit/support/test_media_stream_client.h"
6
7 #include "googleurl/src/gurl.h"
8 #include "media/base/message_loop_factory.h"
9 #include "media/base/pipeline.h"
10 #include "media/filters/video_frame_generator.h"
11
12 namespace {
13
14 static const int kVideoCaptureWidth = 352;
15 static const int kVideoCaptureHeight = 288;
16 static const int kVideoCaptureFrameDurationMs = 33;
17
18 } // namespace
19
20 namespace webkit_support {
21
22 TestMediaStreamClient::TestMediaStreamClient(MediaStreamUtil* media_stream_util)
23 : media_stream_util_(media_stream_util) {
24 }
25
26 scoped_refptr<media::VideoDecoder> TestMediaStreamClient::GetVideoDecoder(
27 const GURL& url, media::MessageLoopFactory* message_loop_factory) {
28 if (!media_stream_util_)
29 return NULL;
30
31 bool raw_media = media_stream_util_->IsMockStream(url);
32 media::VideoDecoder* decoder = NULL;
33 if (raw_media) {
acolwell GONE FROM CHROMIUM 2012/01/06 18:09:16 nit: Reversing the condition and returning early w
wjia(left Chromium) 2012/01/06 22:18:59 Done.
34 gfx::Size size(kVideoCaptureWidth, kVideoCaptureHeight);
35 base::TimeDelta frame_duration =
36 base::TimeDelta::FromMilliseconds(kVideoCaptureFrameDurationMs);
37
38 decoder = new media::VideoFrameGenerator(
39 message_loop_factory->GetMessageLoopProxy("CaptureVideoDecoder").get(),
40 size, frame_duration);
41 }
42 return decoder;
43 }
44
45 } // namespace webkit_support
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698