Index: webkit/mocks/test_media_stream_client.cc |
=================================================================== |
--- webkit/mocks/test_media_stream_client.cc (revision 191708) |
+++ webkit/mocks/test_media_stream_client.cc (working copy) |
@@ -2,9 +2,10 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "webkit/support/test_media_stream_client.h" |
+#include "webkit/mocks/test_media_stream_client.h" |
#include "googleurl/src/gurl.h" |
+#include "media/base/media_log.h" |
#include "media/base/pipeline.h" |
#include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStream.h" |
#include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamTrack.h" |
@@ -12,6 +13,9 @@ |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaStreamRegistry.h" |
#include "webkit/media/media_stream_audio_renderer.h" |
#include "webkit/media/simple_video_frame_provider.h" |
+#include "webkit/media/webmediaplayer_impl.h" |
+#include "webkit/media/webmediaplayer_ms.h" |
+#include "webkit/media/webmediaplayer_params.h" |
using namespace WebKit; |
@@ -22,6 +26,7 @@ |
static const int kVideoCaptureFrameDurationMs = 33; |
bool IsMockMediaStreamWithVideo(const WebURL& url) { |
+#if ENABLE_WEBRTC |
WebMediaStream descriptor( |
WebMediaStreamRegistry::lookupMediaStreamDescriptor(url)); |
if (descriptor.isNull()) |
@@ -29,12 +34,42 @@ |
WebVector<WebMediaStreamTrack> videoSources; |
descriptor.videoSources(videoSources); |
return videoSources.size() > 0; |
+#else |
+ return false; |
+#endif |
} |
} // namespace |
-namespace webkit_support { |
+namespace webkit_glue { |
+WebKit::WebMediaPlayer* CreateMediaPlayer( |
+ WebFrame* frame, |
+ const WebURL& url, |
+ WebMediaPlayerClient* client, |
+ webkit_media::MediaStreamClient* media_stream_client) { |
+ if (media_stream_client && media_stream_client->IsMediaStream(url)) { |
+ return new webkit_media::WebMediaPlayerMS( |
+ frame, |
+ client, |
+ base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(), |
+ media_stream_client, |
+ new media::MediaLog()); |
+ } |
+ |
+#if defined(OS_ANDROID) |
+ return NULL; |
+#else |
+ webkit_media::WebMediaPlayerParams params( |
+ NULL, NULL, new media::MediaLog()); |
+ return new webkit_media::WebMediaPlayerImpl( |
+ frame, |
+ client, |
+ base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(), |
+ params); |
+#endif |
+} |
+ |
TestMediaStreamClient::TestMediaStreamClient() {} |
TestMediaStreamClient::~TestMediaStreamClient() {} |
@@ -63,4 +98,4 @@ |
return NULL; |
} |
-} // namespace webkit_support |
+} // namespace webkit_glue |