platform/graphics/surfaces/wayland/WaylandDisplay.cpp
platform/graphics/surfaces/wayland/WaylandSurface.cpp
platform/graphics/surfaces/wayland/GraphicsSurfaceWayland.cpp
+ platform/graphics/surfaces/tizen/SharedVideoPlatformSurfaceTizenWayland.cpp
)
ENDIF()
ENDIF()
if (GST_MESSAGE_TYPE(message) != GST_MESSAGE_ELEMENT)
return GST_BUS_PASS;
#ifdef GST_API_VERSION_1
- if (gst_is_video_overlay_prepare_window_handle_message(message))
+ if (!gst_is_video_overlay_prepare_window_handle_message(message))
#else
if (!gst_structure_has_name (message->structure, "prepare-xid"))
#endif
LOG_MEDIA_MESSAGE("Duration changed");
durationChanged();
break;
+ case GST_MESSAGE_ELEMENT:
+#ifdef GST_API_VERSION_1
+ if (gst_structure_has_name (structure, "frame-rendered")) {
+#else
+ if (gst_structure_has_name (message->structure, "frame-rendered")) {
+#endif
+ m_videoLayer->notifySyncRequired();
+ }
+ break;
default:
LOG_MEDIA_MESSAGE("Unhandled GStreamer message type: %s",
GST_MESSAGE_TYPE_NAME(message));
#endif
void MediaPlayerPrivateGStreamer::xWindowIdPrepared(GstMessage* message)
{
+#if !PLATFORM(WAYLAND)
#if USE(ACCELERATED_VIDEO_VAAPI)
int displayWidth, displayHeight;
#endif
m_videoSize = IntSize(videoWidth, videoHeight);
#endif
m_videoLayer->setOverlay(m_videoSize);
+#else
+ m_videoLayer->setOverlay(IntSize(1,1));
+#endif
}
#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
#if PLATFORM(X11)
#include "SharedVideoPlatformSurfaceTizenX.h"
+#elif PLATFORM(WAYLAND)
+#include "SharedVideoPlatformSurfaceTizenWayland.h"
#endif
namespace WebCore {
{
#if PLATFORM(X11)
return adoptPtr(new SharedVideoPlatformSurfaceTizenX(size));
+#elif PLATFORM(WAYLAND)
+ return adoptPtr(new SharedVideoPlatformSurfaceTizenWayland(size));
#else
return nullptr;
#endif
void copySurface(SharedVideoPlatformSurfaceTizen*, CopySurfaceType);
void platformSurfaceUpdated();
int graphicsSurfaceFlags() const;
+ virtual void *nativeVideoSurface() {return (void*)m_bufferHandle;};
protected:
SharedVideoPlatformSurfaceTizen(const IntSize&);
#endif
#include <gst/video/gstvideosink.h>
#include <gst/video/video.h>
+#if PLATFORM(X11)
+// no header file is required for X, becase media pipeline creates X connecttion of its own.
+#elif PLATFORM(WAYLAND)
+#include "WaylandDisplay.h"
+#endif
#else
+#if PLATFORM(X11)
#include <cairo-xlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
+#elif PLATFORM(WAYLAND)
+// note-1:
+// there is no implementation of wayland platform for !TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE,
+// because it is not possible to composite wl_surface by cairo.
+#endif
#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
#if !ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) || USE(TIZEN_GSTREAMER_VIDEO_SET_SINK)
+#if PLATFORM(X11)
static Display* g_nativeDisplay = 0;
+#elif PLATFORM(WAYLAND)
+// see above note-1
+#endif
#endif
namespace WebCore {
#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && !USE(TIZEN_GSTREAMER_VIDEO_SET_SINK)
: m_videoSink(0)
#else
+#if PLATFORM(X11)
: m_platformSurfaceID(0)
, m_nativeWindow(0)
+#elif PLATFORM(WAYLAND)
+// see above note-1
+#endif
#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
, m_media(media)
{
-#if !ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) || USE(TIZEN_GSTREAMER_VIDEO_SET_SINK)
+#if (!ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) || USE(TIZEN_GSTREAMER_VIDEO_SET_SINK))
+#if PLATFORM(X11)
if (!g_nativeDisplay)
g_nativeDisplay = XOpenDisplay(0);
0, 0, 1, 1, 0,
BlackPixel(g_nativeDisplay, 0), WhitePixel(g_nativeDisplay, 0));
XFlush(g_nativeDisplay);
+#elif PLATFORM(WAYLAND)
+// see above note-1
+#endif
#endif
}
m_videoSink = 0;
#else
+#if PLATFORM(X11)
if (m_platformSurfaceID) {
XFreePixmap(g_nativeDisplay, m_platformSurfaceID);
m_platformSurfaceID = 0;
XDestroyWindow(g_nativeDisplay, m_nativeWindow);
m_nativeWindow = 0;
}
+#elif PLATFORM(WAYLAND)
+// see above note-1
+#endif
#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
}
#else
setVaapiEnv();
GstElement* videoSink = gst_element_factory_make("vaapisink", "vaapisink");
+#if PLATFORM(X11)
g_object_set(videoSink, "is-pixmap", 1, NULL);
+#elif PLATFORM(WAYLAND)
+ g_object_set(videoSink, "wl-display", WaylandDisplay::instance()->nativeDisplay(), NULL);
+#endif
#endif
m_videoSink = videoSink;
m_platformSurface->copySurface(m_platformSurfaceToBeRemoved.get(), SharedVideoPlatformSurfaceTizen::FitToWidth);
#ifdef GST_API_VERSION_1
- gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(m_videoSink), m_platformSurface->handle());
+ gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(m_videoSink), (guintptr)m_platformSurface->nativeVideoSurface());
#else
- gst_x_overlay_set_window_handle(GST_X_OVERLAY(m_videoSink), m_platformSurface->handle());
+ gst_x_overlay_set_window_handle(GST_X_OVERLAY(m_videoSink), (guintptr)m_platformSurface->nativeVideoSurface());
#endif
#if !USE(ACCELERATED_VIDEO_VAAPI)
g_object_set(m_videoSink, "rotate", 0, NULL);
-#else
- g_object_set(m_videoSink, "is-pixmap", 1, NULL);
#endif
}
if (m_platformSurface)
m_platformSurface->paintCurrentFrameInContext(context, rect);
}
-
#else
-
void VideoLayerTizen::paintVideoLayer(IntSize videoSize)
{
+#if PLATFORM(X11)
if (videoSize.isEmpty())
return;
XFlush(g_nativeDisplay);
syncLayer(this);
+#elif PLATFORM(WAYLAND)
+ notImplemented();
+#endif
}
#endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
--- /dev/null
+/*
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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 PLATFORM(WAYLAND) && USE(EGL)
+#include "SharedVideoPlatformSurfaceTizenWayland.h"
+#include "GraphicsSurface.h"
+#include "WaylandDisplay.h"
+#include "NotImplemented.h"
+
+namespace WebCore {
+
+SharedVideoPlatformSurfaceTizenWayland::SharedVideoPlatformSurfaceTizenWayland(const IntSize& size)
+ : SharedVideoPlatformSurfaceTizen(size)
+{
+ m_surface = WaylandDisplay::instance()->createSurface();
+
+ if (!m_surface) {
+ LOG_ERROR("Failed to create surface.");
+ destroy();
+ return;
+ }
+
+ m_bufferHandle = m_surface->handle();
+}
+
+SharedVideoPlatformSurfaceTizenWayland::~SharedVideoPlatformSurfaceTizenWayland()
+{
+ destroy();
+}
+
+void *SharedVideoPlatformSurfaceTizenWayland::nativeVideoSurface()
+{
+ return m_surface->wlSurface();
+}
+
+void SharedVideoPlatformSurfaceTizenWayland::destroy()
+{
+ if (m_surface)
+ m_surface->deleteFrameCallBack();
+
+ m_surface = nullptr;
+ m_bufferHandle = 0;
+}
+
+void SharedVideoPlatformSurfaceTizenWayland::platformPaintCurrentFrameInContext(GraphicsContext* context, const IntRect& rect)
+{
+ notImplemented();
+}
+
+void SharedVideoPlatformSurfaceTizenWayland::platformCopySurface(SharedVideoPlatformSurfaceTizen* other, float xPosition, float xScale, float yPosition, float yScale)
+{
+ notImplemented();
+}
+
+void SharedVideoPlatformSurfaceTizenWayland::clearPlatformSurface()
+{
+ notImplemented();
+}
+
+}
+
+#endif
--- /dev/null
+/*
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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 SharedVideoPlatformSurfaceTizenWayland_h
+#define SharedVideoPlatformSurfaceTizenWayland_h
+
+#if PLATFORM(WAYLAND)
+
+#include "SharedVideoPlatformSurfaceTizen.h"
+#include "WaylandSurface.h"
+
+namespace WebCore {
+
+class SharedVideoPlatformSurfaceTizenWayland : public SharedVideoPlatformSurfaceTizen {
+public:
+ SharedVideoPlatformSurfaceTizenWayland(const IntSize&);
+ virtual ~SharedVideoPlatformSurfaceTizenWayland();
+ virtual void* nativeVideoSurface();
+
+protected:
+ virtual void platformCopySurface(SharedVideoPlatformSurfaceTizen* other, float xPosition, float xScale, float yPosition, float yScale) OVERRIDE;
+ virtual void platformPaintCurrentFrameInContext(GraphicsContext* context, const IntRect& rect) OVERRIDE;
+ virtual void destroy();
+private:
+ void clearPlatformSurface();
+ void registerDamageHandler();
+ void unregisterDamageHandler();
+
+ OwnPtr<WaylandSurface> m_surface;
+};
+
+}
+
+#endif
+
+#endif
+
ADD_DEFINITIONS(-DWTF_USE_TEXTURE_MAPPER=1)
ENDIF ()
-IF (ENABLE_TIZEN_GSTREAMER_VIDEO_SET_SINK)
+IF (ENABLE_TIZEN_GSTREAMER_VIDEO_SET_SINK AND NOT ("${EFL_TARGET}" STREQUAL "i386"))
SET(WTF_USE_TIZEN_GSTREAMER_VIDEO_SET_SINK 1)
ADD_DEFINITIONS(-DWTF_USE_TIZEN_GSTREAMER_VIDEO_SET_SINK=1)
ENDIF ()