| 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/test/test_media_stream_client.h" | 5 #include "content/test/test_media_stream_renderer_factory.h" |
| 6 | 6 |
| 7 #include "content/renderer/media/media_stream_audio_renderer.h" | 7 #include "content/renderer/media/media_stream_audio_renderer.h" |
| 8 #include "content/test/test_video_frame_provider.h" | 8 #include "content/test/test_video_frame_provider.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/web/WebMediaStreamRegistry.h" | 11 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" |
| 12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 13 | 13 |
| 14 using namespace blink; | 14 using namespace blink; |
| 15 | 15 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 30 return video_tracks.size() > 0; | 30 return video_tracks.size() > 0; |
| 31 #else | 31 #else |
| 32 return false; | 32 return false; |
| 33 #endif | 33 #endif |
| 34 } | 34 } |
| 35 | 35 |
| 36 } // namespace | 36 } // namespace |
| 37 | 37 |
| 38 namespace content { | 38 namespace content { |
| 39 | 39 |
| 40 TestMediaStreamClient::TestMediaStreamClient(RenderFrame* render_frame) | 40 TestMediaStreamRendererFactory::TestMediaStreamRendererFactory() {} |
| 41 : RenderFrameObserver(render_frame) {} | |
| 42 | 41 |
| 43 TestMediaStreamClient::~TestMediaStreamClient() {} | 42 TestMediaStreamRendererFactory::~TestMediaStreamRendererFactory() {} |
| 44 | 43 |
| 45 bool TestMediaStreamClient::IsMediaStream(const GURL& url) { | 44 scoped_refptr<VideoFrameProvider> |
| 46 return IsMockMediaStreamWithVideo(url); | 45 TestMediaStreamRendererFactory::GetVideoFrameProvider( |
| 47 } | |
| 48 | |
| 49 scoped_refptr<VideoFrameProvider> TestMediaStreamClient::GetVideoFrameProvider( | |
| 50 const GURL& url, | 46 const GURL& url, |
| 51 const base::Closure& error_cb, | 47 const base::Closure& error_cb, |
| 52 const VideoFrameProvider::RepaintCB& repaint_cb) { | 48 const VideoFrameProvider::RepaintCB& repaint_cb) { |
| 53 if (!IsMockMediaStreamWithVideo(url)) | 49 if (!IsMockMediaStreamWithVideo(url)) |
| 54 return NULL; | 50 return NULL; |
| 55 | 51 |
| 56 return new TestVideoFrameProvider( | 52 return new TestVideoFrameProvider( |
| 57 gfx::Size(kVideoCaptureWidth, kVideoCaptureHeight), | 53 gfx::Size(kVideoCaptureWidth, kVideoCaptureHeight), |
| 58 base::TimeDelta::FromMilliseconds(kVideoCaptureFrameDurationMs), | 54 base::TimeDelta::FromMilliseconds(kVideoCaptureFrameDurationMs), |
| 59 error_cb, | 55 error_cb, |
| 60 repaint_cb); | 56 repaint_cb); |
| 61 } | 57 } |
| 62 | 58 |
| 63 scoped_refptr<MediaStreamAudioRenderer> TestMediaStreamClient::GetAudioRenderer( | 59 scoped_refptr<MediaStreamAudioRenderer> |
| 64 const GURL& url, int render_frame_id) { | 60 TestMediaStreamRendererFactory::GetAudioRenderer( |
| 61 const GURL& url, int render_view_id, int render_frame_id) { |
| 65 return NULL; | 62 return NULL; |
| 66 } | 63 } |
| 67 | 64 |
| 68 } // namespace content | 65 } // namespace content |
| OLD | NEW |