| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/support/test_media_stream_client.h" | 5 #include "webkit/support/test_media_stream_client.h" |
| 6 | 6 |
| 7 #include "googleurl/src/gurl.h" | 7 #include "googleurl/src/gurl.h" |
| 8 #include "media/base/pipeline.h" | 8 #include "media/base/pipeline.h" |
| 9 #include "media/filters/video_frame_generator.h" | 9 #include "media/filters/video_frame_generator.h" |
| 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStream.h" | 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStream.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 if (!IsMockMediaStreamWithVideo(url)) | 52 if (!IsMockMediaStreamWithVideo(url)) |
| 53 return NULL; | 53 return NULL; |
| 54 | 54 |
| 55 return new webkit_media::SimpleVideoFrameProvider( | 55 return new webkit_media::SimpleVideoFrameProvider( |
| 56 gfx::Size(kVideoCaptureWidth, kVideoCaptureHeight), | 56 gfx::Size(kVideoCaptureWidth, kVideoCaptureHeight), |
| 57 base::TimeDelta::FromMilliseconds(kVideoCaptureFrameDurationMs), | 57 base::TimeDelta::FromMilliseconds(kVideoCaptureFrameDurationMs), |
| 58 error_cb, | 58 error_cb, |
| 59 repaint_cb); | 59 repaint_cb); |
| 60 } | 60 } |
| 61 | 61 |
| 62 scoped_refptr<media::VideoDecoder> TestMediaStreamClient::GetVideoDecoder( | |
| 63 const GURL& url, | |
| 64 const scoped_refptr<base::MessageLoopProxy>& message_loop) { | |
| 65 // This class is installed in a chain of possible VideoDecoder creators | |
| 66 // which are called in order until one returns an object. | |
| 67 // Make sure we are dealing with a Mock MediaStream. If not, bail out. | |
| 68 if (!IsMockMediaStreamWithVideo(url)) | |
| 69 return NULL; | |
| 70 | |
| 71 return new media::VideoFrameGenerator( | |
| 72 message_loop, | |
| 73 gfx::Size(kVideoCaptureWidth, kVideoCaptureHeight), | |
| 74 base::TimeDelta::FromMilliseconds(kVideoCaptureFrameDurationMs)); | |
| 75 } | |
| 76 | |
| 77 scoped_refptr<webkit_media::MediaStreamAudioRenderer> | 62 scoped_refptr<webkit_media::MediaStreamAudioRenderer> |
| 78 TestMediaStreamClient::GetAudioRenderer(const GURL& url) { | 63 TestMediaStreamClient::GetAudioRenderer(const GURL& url) { |
| 79 return NULL; | 64 return NULL; |
| 80 } | 65 } |
| 81 | 66 |
| 82 } // namespace webkit_support | 67 } // namespace webkit_support |
| OLD | NEW |