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

Unified 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: code review and final 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/support/test_media_stream_client.h ('k') | webkit/support/webkit_support.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,37 @@
+// 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_ || !media_stream_util_->IsMockStream(url))
+ return NULL;
+
+ return new media::VideoFrameGenerator(
+ message_loop_factory->GetMessageLoopProxy("CaptureVideoDecoder").get(),
+ gfx::Size(kVideoCaptureWidth, kVideoCaptureHeight),
+ base::TimeDelta::FromMilliseconds(kVideoCaptureFrameDurationMs));
+}
+
+} // namespace webkit_support
Property changes on: webkit/support/test_media_stream_client.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « webkit/support/test_media_stream_client.h ('k') | webkit/support/webkit_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698