summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebCore/Android.derived.mk6
-rw-r--r--WebCore/Android.mk14
-rw-r--r--WebCore/config.h2
-rw-r--r--WebCore/platform/graphics/MediaPlayer.cpp2
-rw-r--r--WebCore/platform/graphics/android/MediaPlayerPrivateAndroid.cpp164
-rw-r--r--WebCore/platform/graphics/android/MediaPlayerPrivateAndroid.h89
6 files changed, 266 insertions, 11 deletions
diff --git a/WebCore/Android.derived.mk b/WebCore/Android.derived.mk
index 0e75e41..a28bbd2 100644
--- a/WebCore/Android.derived.mk
+++ b/WebCore/Android.derived.mk
@@ -160,7 +160,7 @@ LOCAL_GENERATED_SOURCES += $(GEN)
# user agent style sheets
-style_sheets := $(LOCAL_PATH)/css/html4.css $(LOCAL_PATH)/css/quirks.css $(LOCAL_PATH)/css/view-source.css
+style_sheets := $(LOCAL_PATH)/css/html4.css $(LOCAL_PATH)/css/quirks.css $(LOCAL_PATH)/css/view-source.css $(LOCAL_PATH)/css/mediaControls.css
ifeq ($(ENABLE_SVG), true)
style_sheets := $(style_sheets) $(LOCAL_PATH)/css/svg.css
endif
@@ -214,7 +214,7 @@ js_binding_scripts := $(addprefix $(LOCAL_PATH)/,\
bindings/scripts/generate-bindings.pl \
)
-FEATURE_DEFINES := ANDROID_ORIENTATION_SUPPORT ENABLE_TOUCH_EVENTS=1 ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1
+FEATURE_DEFINES := ANDROID_ORIENTATION_SUPPORT ENABLE_TOUCH_EVENTS=1 ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1 ENABLE_VIDEO=1
GEN := \
$(intermediates)/css/JSCSSCharsetRule.h \
@@ -690,7 +690,7 @@ $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/xml/%.cpp : $(intermediates)/xml/
GEN:= $(intermediates)/HTMLNames.cpp $(intermediates)/HTMLElementFactory.cpp $(intermediates)/JSHTMLElementWrapperFactory.cpp
$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
-$(GEN): PRIVATE_CUSTOM_TOOL = perl -I $(PRIVATE_PATH)/bindings/scripts $< --tags $(html_tags) --attrs $(html_attrs) --factory --wrapperFactory --output $(dir $@)
+$(GEN): PRIVATE_CUSTOM_TOOL = perl -I $(PRIVATE_PATH)/bindings/scripts $< --tags $(html_tags) --attrs $(html_attrs) --extraDefines "$(FEATURE_DEFINES)" --factory --wrapperFactory --output $(dir $@)
$(GEN): html_tags := $(LOCAL_PATH)/html/HTMLTagNames.in
$(GEN): html_attrs := $(LOCAL_PATH)/html/HTMLAttributeNames.in
$(GEN): $(LOCAL_PATH)/dom/make_names.pl $(html_tags) $(html_attrs)
diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index 8ecb7e0..ffb4a82 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -24,7 +24,6 @@
# WebCorePrefix.cpp \
# accessibility/*.cpp \
# bindings/js/JSCustomVersionChangeCallback.cpp \
-# bindings/js/JSHTMLAudioElementConstructor.cpp \
# bindings/js/JSInspectorControllerCustom.cpp \
# bindings/js/JSXSLTProcessor*.cpp \
# bindings/js/JSWorker*.cpp \
@@ -41,11 +40,7 @@
# editing/SmartReplace*.cpp \
# history/BackForwardListChromium.cpp \
# html/FileList.cpp \
-# html/HTMLElementsAllInOne.cpp \
-# html/HTMLAudioElement.cpp \
-# html/HTMLMediaElement.cpp \
-# html/HTMLSourceElement.cpp \
-# html/HTMLVideoElement.cpp \
+# html/HTMLElementsAllInOne.cpp \
# loader/CachedXBLDocument.cpp \
# loader/CachedXSLStyleSheet.cpp \
# loader/FTP*.cpp \
@@ -62,7 +57,6 @@
# rendering/RenderThemeChromium*.cpp \
# rendering/RenderThemeSafari.cpp \
# rendering/RenderThemeWin.cpp \
-# rendering/RenderVideo.cpp \
# svg/SVGAllInOne.cpp \
# xml/Access*.cpp \
# xml/NativeXPathNSResolver.cpp \
@@ -460,6 +454,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
html/HTMLAnchorElement.cpp \
html/HTMLAppletElement.cpp \
html/HTMLAreaElement.cpp \
+ html/HTMLAudioElement.cpp \
html/HTMLBRElement.cpp \
html/HTMLBaseElement.cpp \
html/HTMLBaseFontElement.cpp \
@@ -499,6 +494,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
html/HTMLLinkElement.cpp \
html/HTMLMapElement.cpp \
html/HTMLMarqueeElement.cpp \
+ html/HTMLMediaElement.cpp \
html/HTMLMenuElement.cpp \
html/HTMLMetaElement.cpp \
html/HTMLModElement.cpp \
@@ -519,6 +515,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
html/HTMLQuoteElement.cpp \
html/HTMLScriptElement.cpp \
html/HTMLSelectElement.cpp \
+ html/HTMLSourceElement.cpp \
html/HTMLStyleElement.cpp \
html/HTMLTableCaptionElement.cpp \
html/HTMLTableCellElement.cpp \
@@ -532,6 +529,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
html/HTMLTitleElement.cpp \
html/HTMLTokenizer.cpp \
html/HTMLUListElement.cpp \
+ html/HTMLVideoElement.cpp \
html/HTMLViewSourceDocument.cpp \
html/ImageData.cpp \
html/PreloadScanner.cpp \
@@ -716,6 +714,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
platform/graphics/android/ImageAndroid.cpp \
platform/graphics/android/ImageBufferAndroid.cpp \
platform/graphics/android/ImageSourceAndroid.cpp \
+ platform/graphics/android/MediaPlayerPrivateAndroid.cpp \
platform/graphics/android/PathAndroid.cpp \
platform/graphics/android/PatternAndroid.cpp \
platform/graphics/android/PlatformGraphicsContext.cpp \
@@ -863,6 +862,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
rendering/RenderPath.cpp \
rendering/RenderReplaced.cpp \
rendering/RenderReplica.cpp \
+ rendering/RenderVideo.cpp \
ifeq ($(ENABLE_SVG), true)
LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
diff --git a/WebCore/config.h b/WebCore/config.h
index 362edb8..95295aa 100644
--- a/WebCore/config.h
+++ b/WebCore/config.h
@@ -120,7 +120,7 @@
#define ENABLE_XBL 0
#define ENABLE_XPATH 0
#define ENABLE_XSLT 0
-#define ENABLE_VIDEO 0
+#define ENABLE_VIDEO 1
#undef ENABLE_ARCHIVE
#define ENABLE_ARCHIVE 0 // ANDROID addition: allow web archive to be disabled
#define ENABLE_OFFLINE_WEB_APPLICATIONS 1
diff --git a/WebCore/platform/graphics/MediaPlayer.cpp b/WebCore/platform/graphics/MediaPlayer.cpp
index b580474..fb7225a 100644
--- a/WebCore/platform/graphics/MediaPlayer.cpp
+++ b/WebCore/platform/graphics/MediaPlayer.cpp
@@ -46,6 +46,8 @@
#include "MediaPlayerPrivatePhonon.h"
#elif PLATFORM(CHROMIUM)
#include "MediaPlayerPrivateChromium.h"
+#elif PLATFORM(ANDROID)
+#include "MediaPlayerPrivateAndroid.h"
#endif
namespace WebCore {
diff --git a/WebCore/platform/graphics/android/MediaPlayerPrivateAndroid.cpp b/WebCore/platform/graphics/android/MediaPlayerPrivateAndroid.cpp
new file mode 100644
index 0000000..75bb578
--- /dev/null
+++ b/WebCore/platform/graphics/android/MediaPlayerPrivateAndroid.cpp
@@ -0,0 +1,164 @@
+/*
+ * Copyright 2009, The Android Open Source Project
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(VIDEO)
+
+#include "MediaPlayerPrivateAndroid.h"
+
+namespace WebCore {
+
+void MediaPlayerPrivate::registerMediaEngine(MediaEngineRegistrar registrar)
+{
+ registrar(create, getSupportedTypes, supportsType);
+}
+
+void MediaPlayerPrivate::load(const String& url)
+{
+}
+
+void MediaPlayerPrivate::cancelLoad()
+{
+}
+
+void MediaPlayerPrivate::play()
+{
+}
+
+void MediaPlayerPrivate::pause()
+{
+}
+
+IntSize MediaPlayerPrivate::naturalSize() const
+{
+ return IntSize();
+}
+
+bool MediaPlayerPrivate::hasVideo() const
+{
+ return false;
+}
+
+void MediaPlayerPrivate::setVisible(bool)
+{
+}
+
+float MediaPlayerPrivate::duration() const
+{
+ return 0;
+}
+
+float MediaPlayerPrivate::currentTime() const
+{
+ return 0;
+}
+
+void MediaPlayerPrivate::seek(float time)
+{
+}
+
+bool MediaPlayerPrivate::seeking() const
+{
+ return false;
+}
+
+void MediaPlayerPrivate::setEndTime(float time)
+{
+}
+
+void MediaPlayerPrivate::setRate(float)
+{
+}
+
+bool MediaPlayerPrivate::paused() const
+{
+ return false;
+}
+
+void MediaPlayerPrivate::setVolume(float)
+{
+}
+
+MediaPlayer::NetworkState MediaPlayerPrivate::networkState() const
+{
+ return MediaPlayer::Empty;
+}
+
+MediaPlayer::ReadyState MediaPlayerPrivate::readyState() const
+{
+ return MediaPlayer::HaveNothing;
+}
+
+float MediaPlayerPrivate::maxTimeSeekable() const
+{
+ return 0;
+}
+
+float MediaPlayerPrivate::maxTimeBuffered() const
+{
+ return 0;
+}
+
+int MediaPlayerPrivate::dataRate() const
+{
+ return 0;
+}
+
+unsigned MediaPlayerPrivate::totalBytes() const
+{
+ return 0;
+}
+
+unsigned MediaPlayerPrivate::bytesLoaded() const
+{
+ return 0;
+}
+
+void MediaPlayerPrivate::setSize(const IntSize&)
+{
+}
+
+void MediaPlayerPrivate::paint(GraphicsContext*, const IntRect&)
+{
+}
+
+MediaPlayerPrivateInterface* MediaPlayerPrivate::create(MediaPlayer* player)
+{
+ return new MediaPlayerPrivate();
+}
+
+void MediaPlayerPrivate::getSupportedTypes(HashSet<String>&)
+{
+}
+
+MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String& type, const String& codecs)
+{
+ return MediaPlayer::IsNotSupported;
+}
+
+}
+
+#endif // VIDEO
diff --git a/WebCore/platform/graphics/android/MediaPlayerPrivateAndroid.h b/WebCore/platform/graphics/android/MediaPlayerPrivateAndroid.h
new file mode 100644
index 0000000..9324699
--- /dev/null
+++ b/WebCore/platform/graphics/android/MediaPlayerPrivateAndroid.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2009, The Android Open Source Project
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MediaPlayerPrivateAndroid_h
+#define MediaPlayerPrivateAndroid_h
+
+#if ENABLE(VIDEO)
+
+#include "MediaPlayerPrivate.h"
+
+namespace WebCore {
+
+class MediaPlayerPrivate : public MediaPlayerPrivateInterface {
+public:
+ static void registerMediaEngine(MediaEngineRegistrar);
+
+ virtual void load(const String& url);
+ virtual void cancelLoad();
+
+ virtual void play();
+ virtual void pause();
+
+ virtual IntSize naturalSize() const;
+
+ virtual bool hasVideo() const;
+
+ virtual void setVisible(bool);
+
+ virtual float duration() const;
+
+ virtual float currentTime() const;
+ virtual void seek(float time);
+ virtual bool seeking() const;
+
+ virtual void setEndTime(float time);
+
+ virtual void setRate(float);
+ virtual bool paused() const;
+
+ virtual void setVolume(float);
+
+ virtual MediaPlayer::NetworkState networkState() const;
+ virtual MediaPlayer::ReadyState readyState() const;
+
+ virtual float maxTimeSeekable() const;
+ virtual float maxTimeBuffered() const;
+
+ virtual int dataRate() const;
+
+ virtual bool totalBytesKnown() const { return totalBytes() > 0; }
+ virtual unsigned totalBytes() const;
+ virtual unsigned bytesLoaded() const;
+
+ virtual void setSize(const IntSize&);
+
+ virtual void paint(GraphicsContext*, const IntRect&);
+private:
+ static MediaPlayerPrivateInterface* create(MediaPlayer* player);
+ static void getSupportedTypes(HashSet<String>&);
+ static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs);
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // MediaPlayerPrivateAndroid_h