Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: content/shell/renderer/shell_media_stream_client.cc

Issue 18590002: Migrate MediaStream test code from content/shell/renderer/ to content/test/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/public/renderer/media_stream_audio_renderer.h"
7 #include "content/shell/renderer/shell_video_frame_provider.h" 8 #include "content/shell/renderer/shell_video_frame_provider.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"
12 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" 11 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h"
13 #include "webkit/renderer/media/media_stream_audio_renderer.h"
14 12
15 using namespace WebKit; 13 using namespace WebKit;
16 14
17 namespace { 15 namespace {
18 16
19 static const int kVideoCaptureWidth = 352; 17 static const int kVideoCaptureWidth = 352;
20 static const int kVideoCaptureHeight = 288; 18 static const int kVideoCaptureHeight = 288;
21 static const int kVideoCaptureFrameDurationMs = 33; 19 static const int kVideoCaptureFrameDurationMs = 33;
22 20
23 bool IsMockMediaStreamWithVideo(const WebURL& url) { 21 bool IsMockMediaStreamWithVideo(const WebURL& url) {
(...skipping 15 matching lines...) Expand all
39 namespace content { 37 namespace content {
40 38
41 ShellMediaStreamClient::ShellMediaStreamClient() {} 39 ShellMediaStreamClient::ShellMediaStreamClient() {}
42 40
43 ShellMediaStreamClient::~ShellMediaStreamClient() {} 41 ShellMediaStreamClient::~ShellMediaStreamClient() {}
44 42
45 bool ShellMediaStreamClient::IsMediaStream(const GURL& url) { 43 bool ShellMediaStreamClient::IsMediaStream(const GURL& url) {
46 return IsMockMediaStreamWithVideo(url); 44 return IsMockMediaStreamWithVideo(url);
47 } 45 }
48 46
49 scoped_refptr<webkit_media::VideoFrameProvider> 47 scoped_refptr<VideoFrameProvider>
50 ShellMediaStreamClient::GetVideoFrameProvider( 48 ShellMediaStreamClient::GetVideoFrameProvider(
51 const GURL& url, 49 const GURL& url,
52 const base::Closure& error_cb, 50 const base::Closure& error_cb,
53 const webkit_media::VideoFrameProvider::RepaintCB& repaint_cb) { 51 const VideoFrameProvider::RepaintCB& repaint_cb) {
54 if (!IsMockMediaStreamWithVideo(url)) 52 if (!IsMockMediaStreamWithVideo(url))
55 return NULL; 53 return NULL;
56 54
57 return new ShellVideoFrameProvider( 55 return new ShellVideoFrameProvider(
58 gfx::Size(kVideoCaptureWidth, kVideoCaptureHeight), 56 gfx::Size(kVideoCaptureWidth, kVideoCaptureHeight),
59 base::TimeDelta::FromMilliseconds(kVideoCaptureFrameDurationMs), 57 base::TimeDelta::FromMilliseconds(kVideoCaptureFrameDurationMs),
60 error_cb, 58 error_cb,
61 repaint_cb); 59 repaint_cb);
62 } 60 }
63 61
64 scoped_refptr<webkit_media::MediaStreamAudioRenderer> 62 scoped_refptr<MediaStreamAudioRenderer>
65 ShellMediaStreamClient::GetAudioRenderer(const GURL& url) { 63 ShellMediaStreamClient::GetAudioRenderer(const GURL& url) {
66 return NULL; 64 return NULL;
67 } 65 }
68 66
69 } // namespace content 67 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698