| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/shell/renderer/shell_media_stream_client.h" | 5 #include "content/test/test_media_stream_client.h" |
| 6 | 6 |
| 7 #include "content/shell/renderer/shell_video_frame_provider.h" | 7 #include "content/test/test_video_frame_provider.h" |
| 8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
| 9 #include "third_party/WebKit/public/platform/WebMediaStream.h" | 9 #include "third_party/WebKit/public/platform/WebMediaStream.h" |
| 10 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 10 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 11 #include "third_party/WebKit/public/platform/WebVector.h" | 11 #include "third_party/WebKit/public/platform/WebVector.h" |
| 12 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" | 12 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" |
| 13 #include "webkit/renderer/media/media_stream_audio_renderer.h" | 13 #include "webkit/renderer/media/media_stream_audio_renderer.h" |
| 14 | 14 |
| 15 using namespace WebKit; | 15 using namespace WebKit; |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 31 return videoSources.size() > 0; | 31 return videoSources.size() > 0; |
| 32 #else | 32 #else |
| 33 return false; | 33 return false; |
| 34 #endif | 34 #endif |
| 35 } | 35 } |
| 36 | 36 |
| 37 } // namespace | 37 } // namespace |
| 38 | 38 |
| 39 namespace content { | 39 namespace content { |
| 40 | 40 |
| 41 ShellMediaStreamClient::ShellMediaStreamClient() {} | 41 TestMediaStreamClient::TestMediaStreamClient(RenderView* render_view) |
| 42 : RenderViewObserver(render_view) {} |
| 42 | 43 |
| 43 ShellMediaStreamClient::~ShellMediaStreamClient() {} | 44 TestMediaStreamClient::~TestMediaStreamClient() {} |
| 44 | 45 |
| 45 bool ShellMediaStreamClient::IsMediaStream(const GURL& url) { | 46 bool TestMediaStreamClient::IsMediaStream(const GURL& url) { |
| 46 return IsMockMediaStreamWithVideo(url); | 47 return IsMockMediaStreamWithVideo(url); |
| 47 } | 48 } |
| 48 | 49 |
| 49 scoped_refptr<webkit_media::VideoFrameProvider> | 50 scoped_refptr<webkit_media::VideoFrameProvider> |
| 50 ShellMediaStreamClient::GetVideoFrameProvider( | 51 TestMediaStreamClient::GetVideoFrameProvider( |
| 51 const GURL& url, | 52 const GURL& url, |
| 52 const base::Closure& error_cb, | 53 const base::Closure& error_cb, |
| 53 const webkit_media::VideoFrameProvider::RepaintCB& repaint_cb) { | 54 const webkit_media::VideoFrameProvider::RepaintCB& repaint_cb) { |
| 54 if (!IsMockMediaStreamWithVideo(url)) | 55 if (!IsMockMediaStreamWithVideo(url)) |
| 55 return NULL; | 56 return NULL; |
| 56 | 57 |
| 57 return new ShellVideoFrameProvider( | 58 return new TestVideoFrameProvider( |
| 58 gfx::Size(kVideoCaptureWidth, kVideoCaptureHeight), | 59 gfx::Size(kVideoCaptureWidth, kVideoCaptureHeight), |
| 59 base::TimeDelta::FromMilliseconds(kVideoCaptureFrameDurationMs), | 60 base::TimeDelta::FromMilliseconds(kVideoCaptureFrameDurationMs), |
| 60 error_cb, | 61 error_cb, |
| 61 repaint_cb); | 62 repaint_cb); |
| 62 } | 63 } |
| 63 | 64 |
| 64 scoped_refptr<webkit_media::MediaStreamAudioRenderer> | 65 scoped_refptr<webkit_media::MediaStreamAudioRenderer> |
| 65 ShellMediaStreamClient::GetAudioRenderer(const GURL& url) { | 66 TestMediaStreamClient::GetAudioRenderer(const GURL& url) { |
| 66 return NULL; | 67 return NULL; |
| 67 } | 68 } |
| 68 | 69 |
| 69 } // namespace content | 70 } // namespace content |
| OLD | NEW |