Chromium Code Reviews| Index: webkit/support/test_media_stream_client.cc | 
| =================================================================== | 
| --- webkit/support/test_media_stream_client.cc (revision 0) | 
| +++ webkit/support/test_media_stream_client.cc (revision 0) | 
| @@ -0,0 +1,45 @@ | 
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. | 
| +// Use of this source code is governed by a BSD-style license that can be | 
| +// found in the LICENSE file. | 
| + | 
| +#include "webkit/support/test_media_stream_client.h" | 
| + | 
| +#include "googleurl/src/gurl.h" | 
| +#include "media/base/message_loop_factory.h" | 
| +#include "media/base/pipeline.h" | 
| +#include "media/filters/video_frame_generator.h" | 
| + | 
| +namespace { | 
| + | 
| +static const int kVideoCaptureWidth = 352; | 
| +static const int kVideoCaptureHeight = 288; | 
| +static const int kVideoCaptureFrameDurationMs = 33; | 
| + | 
| +} // namespace | 
| + | 
| +namespace webkit_support { | 
| + | 
| +TestMediaStreamClient::TestMediaStreamClient(MediaStreamUtil* media_stream_util) | 
| + : media_stream_util_(media_stream_util) { | 
| +} | 
| + | 
| +scoped_refptr<media::VideoDecoder> TestMediaStreamClient::GetVideoDecoder( | 
| + const GURL& url, media::MessageLoopFactory* message_loop_factory) { | 
| + if (!media_stream_util_) | 
| + return NULL; | 
| + | 
| + bool raw_media = media_stream_util_->IsMockStream(url); | 
| + media::VideoDecoder* decoder = NULL; | 
| + 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.
 
 | 
| + gfx::Size size(kVideoCaptureWidth, kVideoCaptureHeight); | 
| + base::TimeDelta frame_duration = | 
| + base::TimeDelta::FromMilliseconds(kVideoCaptureFrameDurationMs); | 
| + | 
| + decoder = new media::VideoFrameGenerator( | 
| + message_loop_factory->GetMessageLoopProxy("CaptureVideoDecoder").get(), | 
| + size, frame_duration); | 
| + } | 
| + return decoder; | 
| +} | 
| + | 
| +} // namespace webkit_support | 
| Property changes on: webkit/support/test_media_stream_client.cc | 
| ___________________________________________________________________ | 
| Added: svn:eol-style | 
| + LF |