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,51 @@ |
+// Copyright (c) 2011 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/video/capture/fake_capture_video_decoder.h" |
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebUserMediaClientMock.h" |
+ |
+namespace { |
+ |
+static const int kVideoCaptureWidth = 352; |
+static const int kVideoCaptureHeight = 288; |
+static const int kVideoCaptureFramePerSecond = 30; |
+ |
+} // namespace |
+ |
+namespace webkit_support { |
+ |
+TestMediaStreamClient::TestMediaStreamClient( |
+ WebKit::WebUserMediaClientMock* userMediaClientMock) |
+ : m_userMediaClientMock(userMediaClientMock) { |
+} |
+ |
+scoped_refptr<media::VideoDecoder> TestMediaStreamClient::GetVideoDecoder( |
+ const GURL& url, media::MessageLoopFactory* message_loop_factory) { |
+ if (!m_userMediaClientMock) |
+ return NULL; |
+ |
+ bool raw_media = m_userMediaClientMock->isStream(url); |
+ media::VideoDecoder* decoder = NULL; |
+ if (raw_media) { |
+ media::VideoCapture::VideoCaptureCapability capability; |
+ capability.width = kVideoCaptureWidth; |
+ capability.height = kVideoCaptureHeight; |
+ capability.max_fps = kVideoCaptureFramePerSecond; |
+ capability.expected_capture_delay = 0; |
+ capability.raw_type = media::VideoFrame::I420; |
+ capability.interlaced = false; |
+ |
+ decoder = new media::FakeCaptureVideoDecoder( |
+ message_loop_factory->GetMessageLoopProxy("CaptureVideoDecoder").get(), |
+ capability); |
+ } |
+ return decoder; |
+} |
+ |
+} // namespace webkit_support |
Property changes on: webkit/support/test_media_stream_client.cc |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |