summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqinmin@chromium.org <qinmin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-29 21:59:43 +0000
committerqinmin@chromium.org <qinmin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-29 21:59:43 +0000
commit5c23e954bbd14f139cc82846d55cd0fba5e1a9de (patch)
tree782299d10216906bca638dfb878ef14b0bd06eac
parent7fdda6c3b2acfa653938eb19673b2394e672f91a (diff)
downloadchromium_src-5c23e954bbd14f139cc82846d55cd0fba5e1a9de.zip
chromium_src-5c23e954bbd14f139cc82846d55cd0fba5e1a9de.tar.gz
chromium_src-5c23e954bbd14f139cc82846d55cd0fba5e1a9de.tar.bz2
Adding android implementation for CreateMediaPlayer() in webkit_support.cc
BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10696051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145003 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/support/test_stream_texture_factory_android.cc21
-rw-r--r--webkit/support/test_stream_texture_factory_android.h37
-rw-r--r--webkit/support/webkit_support.cc10
-rw-r--r--webkit/support/webkit_support.gypi2
4 files changed, 68 insertions, 2 deletions
diff --git a/webkit/support/test_stream_texture_factory_android.cc b/webkit/support/test_stream_texture_factory_android.cc
new file mode 100644
index 0000000..3c7bd46
--- /dev/null
+++ b/webkit/support/test_stream_texture_factory_android.cc
@@ -0,0 +1,21 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "webkit/support/test_stream_texture_factory_android.h"
+
+namespace webkit_support {
+
+webkit_media::StreamTextureProxy* TestStreamTextureFactory::CreateProxy() {
+ return NULL;
+}
+
+unsigned TestStreamTextureFactory::CreateStreamTexture(unsigned* texture_id) {
+ texture_id = 0;
+ return 0;
+}
+
+void TestStreamTextureFactory::DestroyStreamTexture(unsigned texture_id) {
+}
+
+} // namespace webkit_support
diff --git a/webkit/support/test_stream_texture_factory_android.h b/webkit/support/test_stream_texture_factory_android.h
new file mode 100644
index 0000000..6ae77fa
--- /dev/null
+++ b/webkit/support/test_stream_texture_factory_android.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WEBKIT_SUPPORT_TEST_STREAM_TEXTURE_FACTORY_ANDROID_H_
+#define WEBKIT_SUPPORT_TEST_STREAM_TEXTURE_FACTORY_ANDROID_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "webkit/media/android/stream_texture_factory_android.h"
+
+namespace webkit_support {
+
+// An implementation of StreamTextureFactory for tests.
+class TestStreamTextureFactory
+ : public webkit_media::StreamTextureFactory {
+ public:
+ TestStreamTextureFactory() { }
+ virtual ~TestStreamTextureFactory() { }
+
+ // webkit_media::StreamTextureFactory implementation:
+ virtual webkit_media::StreamTextureProxy* CreateProxy() OVERRIDE;
+
+ virtual void EstablishPeer(int stream_id, int player_id) OVERRIDE { }
+
+ virtual unsigned CreateStreamTexture(unsigned* texture_id) OVERRIDE;
+
+ virtual void DestroyStreamTexture(unsigned texture_id) OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TestStreamTextureFactory);
+};
+
+} // namespace webkit_support
+
+#endif // WEBKIT_SUPPORT_TEST_STREAM_TEXTURE_FACTORY_ANDROID_H_
diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc
index 66da94e..048ef4e 100644
--- a/webkit/support/webkit_support.cc
+++ b/webkit/support/webkit_support.cc
@@ -58,6 +58,7 @@
#include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
#include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
#if defined(OS_ANDROID)
+#include "webkit/media/android/webmediaplayer_android.h"
#include "webkit/media/android/webmediaplayer_manager_android.h"
#endif
#include "webkit/media/webmediaplayer_impl.h"
@@ -76,6 +77,7 @@
#if defined(OS_ANDROID)
#include "base/test/test_support_android.h"
+#include "webkit/support/test_stream_texture_factory_android.h"
#endif
using WebKit::WebCString;
@@ -370,8 +372,12 @@ WebKit::WebMediaPlayer* CreateMediaPlayer(
WebMediaPlayerClient* client,
webkit_media::MediaStreamClient* media_stream_client) {
#if defined(OS_ANDROID)
- // TODO: Implement the WebMediaPlayer that will be used for Android.
- return NULL;
+ return new webkit_media::WebMediaPlayerAndroid(
+ frame,
+ client,
+ GetWebKitPlatformSupport()->cookieJar(),
+ test_environment->media_player_manager(),
+ new webkit_support::TestStreamTextureFactory());
#else
scoped_ptr<media::MessageLoopFactory> message_loop_factory(
new media::MessageLoopFactory());
diff --git a/webkit/support/webkit_support.gypi b/webkit/support/webkit_support.gypi
index 64f3be1..3b46223 100644
--- a/webkit/support/webkit_support.gypi
+++ b/webkit/support/webkit_support.gypi
@@ -49,6 +49,8 @@
'platform_support_win.cc',
'test_media_stream_client.cc',
'test_media_stream_client.h',
+ 'test_stream_texture_factory_android.cc',
+ 'test_stream_texture_factory_android.h',
'test_webkit_platform_support.cc',
'test_webkit_platform_support.h',
'test_webmessageportchannel.cc',