| 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/shell/renderer/shell_media_stream_client.h" |
| 6 | 6 |
| 7 #include "content/shell/renderer/shell_video_frame_provider.h" |
| 7 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
| 8 #include "third_party/WebKit/public/platform/WebMediaStream.h" | 9 #include "third_party/WebKit/public/platform/WebMediaStream.h" |
| 9 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 10 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 10 #include "third_party/WebKit/public/platform/WebVector.h" | 11 #include "third_party/WebKit/public/platform/WebVector.h" |
| 11 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" | 12 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" |
| 12 #include "webkit/renderer/media/media_stream_audio_renderer.h" | 13 #include "webkit/renderer/media/media_stream_audio_renderer.h" |
| 13 #include "webkit/renderer/media/simple_video_frame_provider.h" | |
| 14 | 14 |
| 15 using namespace WebKit; | 15 using namespace WebKit; |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 static const int kVideoCaptureWidth = 352; | 19 static const int kVideoCaptureWidth = 352; |
| 20 static const int kVideoCaptureHeight = 288; | 20 static const int kVideoCaptureHeight = 288; |
| 21 static const int kVideoCaptureFrameDurationMs = 33; | 21 static const int kVideoCaptureFrameDurationMs = 33; |
| 22 | 22 |
| 23 bool IsMockMediaStreamWithVideo(const WebURL& url) { | 23 bool IsMockMediaStreamWithVideo(const WebURL& url) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 47 } | 47 } |
| 48 | 48 |
| 49 scoped_refptr<webkit_media::VideoFrameProvider> | 49 scoped_refptr<webkit_media::VideoFrameProvider> |
| 50 ShellMediaStreamClient::GetVideoFrameProvider( | 50 ShellMediaStreamClient::GetVideoFrameProvider( |
| 51 const GURL& url, | 51 const GURL& url, |
| 52 const base::Closure& error_cb, | 52 const base::Closure& error_cb, |
| 53 const webkit_media::VideoFrameProvider::RepaintCB& repaint_cb) { | 53 const webkit_media::VideoFrameProvider::RepaintCB& repaint_cb) { |
| 54 if (!IsMockMediaStreamWithVideo(url)) | 54 if (!IsMockMediaStreamWithVideo(url)) |
| 55 return NULL; | 55 return NULL; |
| 56 | 56 |
| 57 return new webkit_media::SimpleVideoFrameProvider( | 57 return new ShellVideoFrameProvider( |
| 58 gfx::Size(kVideoCaptureWidth, kVideoCaptureHeight), | 58 gfx::Size(kVideoCaptureWidth, kVideoCaptureHeight), |
| 59 base::TimeDelta::FromMilliseconds(kVideoCaptureFrameDurationMs), | 59 base::TimeDelta::FromMilliseconds(kVideoCaptureFrameDurationMs), |
| 60 error_cb, | 60 error_cb, |
| 61 repaint_cb); | 61 repaint_cb); |
| 62 } | 62 } |
| 63 | 63 |
| 64 scoped_refptr<webkit_media::MediaStreamAudioRenderer> | 64 scoped_refptr<webkit_media::MediaStreamAudioRenderer> |
| 65 ShellMediaStreamClient::GetAudioRenderer(const GURL& url) { | 65 ShellMediaStreamClient::GetAudioRenderer(const GURL& url) { |
| 66 return NULL; | 66 return NULL; |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace content | 69 } // namespace content |
| OLD | NEW |