[with_tizen_65_or_greater=yes],
[with_tizen_65_or_greater=no])
+AC_ARG_WITH([tizen_90_or_greater],
+ [AC_HELP_STRING([--with-tizen-90-or-greater],
+ [Use this conditional when Tizen version is 9.0 or greater])],
+ [with_tizen_90_or_greater=yes],
+ [with_tizen_90_or_greater=no])
+
AC_ARG_ENABLE([debug],
[AC_HELP_STRING([--enable-debug],
[Turns on debugging])],
DALI_CFLAGS="$DALI_CFLAGS -DDEBUG_ENABLED"
fi
+if test "x$with_tizen_90_or_greater" = "xyes"; then
+ DALI_CFLAGS="$DALI_CFLAGS -DOVER_TIZEN_VERSION_9"
+fi
+
PKG_CHECK_MODULES([DALI], [dali2-core dali2-adaptor dali2-toolkit])
PKG_CHECK_MODULES(RLOTTIE, rlottie)
DALI_CFLAGS="$DALI_CFLAGS -DDEBUG_ENABLED"
fi
+if test "x$with_tizen_90_or_greater" = "xyes"; then
+ DALI_CFLAGS="$DALI_CFLAGS -DOVER_TIZEN_VERSION_9"
+fi
+
PKG_CHECK_MODULES([DALI], [dali2-core dali2-adaptor dali2-toolkit])
PKG_CHECK_MODULES(CAPI_MEDIA_PLAYER, capi-media-player)
PKG_CHECK_MODULES(CAPI_SYSTEM_INFO, capi-system-info)
DALI_CFLAGS="$DALI_CFLAGS -DDEBUG_ENABLED"
fi
+if test "x$with_tizen_90_or_greater" = "xyes"; then
+ DALI_CFLAGS="$DALI_CFLAGS -DOVER_TIZEN_VERSION_9"
+fi
+
PKG_CHECK_MODULES([DALI], [dali2-core dali2-adaptor dali2-toolkit])
PKG_CHECK_MODULES(WAYLAND, libtbm)
PKG_CHECK_MODULES(WEB_ENGINE_CHROMIUM, chromium-efl)
DALI_CFLAGS="$DALI_CFLAGS -DDEBUG_ENABLED"
fi
+if test "x$with_tizen_90_or_greater" = "xyes"; then
+ DALI_CFLAGS="$DALI_CFLAGS -DOVER_TIZEN_VERSION_9"
+fi
+
PKG_CHECK_MODULES([DALI], [dali2-core dali2-adaptor dali2-toolkit])
PKG_CHECK_MODULES(WAYLAND, libtbm)
PKG_CHECK_MODULES([WEB_ENGINE_LWE], [lightweight-web-engine])
ADD_DEFINITIONS("-DTRACE_ENABLED")
ENDIF()
+# Hijack the information of tizen version here
+ADD_DEFINITIONS("-DOVER_TIZEN_VERSION_9")
+
INCLUDE(CheckCXXCompilerFlag)
ADD_COMPILE_OPTIONS( -Werror -Wall -Wextra -Wno-unused-parameter -Wfloat-equal )
}
case VectorProperty::TRIM_START:
{
+#ifdef OVER_TIZEN_VERSION_9
mVectorRenderer->setValue<rlottie::Property::TrimStart>(keyPath,
[property, callback, id](const rlottie::FrameInfo& info) {
Property::Value value = CallbackBase::ExecuteReturn<Property::Value>(*callback, id, property, info.curFrame());
}
return 0.0f;
});
+#endif
break;
}
case VectorProperty::TRIM_END:
{
+#ifdef OVER_TIZEN_VERSION_9
mVectorRenderer->setValue<rlottie::Property::TrimEnd>(keyPath,
- [property, callback, id](const rlottie::FrameInfo& info) {
- Property::Value value = CallbackBase::ExecuteReturn<Property::Value>(*callback, id, property, info.curFrame());
- Vector2 position;
- if(value.Get(position))
- {
- return rlottie::Point(position.x, position.y);
- }
- return rlottie::Point(0.0f, 100.0f);
- });
+ [property, callback, id](const rlottie::FrameInfo& info) {
+ Property::Value value = CallbackBase::ExecuteReturn<Property::Value>(*callback, id, property, info.curFrame());
+ Vector2 position;
+ if(value.Get(position))
+ {
+ return rlottie::Point(position.x, position.y);
+ }
+ return rlottie::Point(0.0f, 100.0f);
+ });
+#endif
break;
}
}
#include <dali/devel-api/threading/mutex.h>
#include <dali/integration-api/debug.h>
#include <system_info.h>
+
+#ifdef OVER_TIZEN_VERSION_9
#include <wayland-egl-tizen.h>
+#endif
// INTERNAL INCLUDES
const char* const VIDEO_PLAYER_SIZE_NAME("videoPlayerSize");
+#ifdef OVER_TIZEN_VERSION_9
struct BufferCommitData
{
Ecore_Wl2_VideoShell_Surface_Wrapper* ecoreVideoShellSurfaceWrapper;
float mHalfScreenWidth;
float mHalfScreenHeight;
};
+#endif
/**
* @brief Whether set play positoin accurately or not.
mSyncMode(syncMode),
mIsMovedHandle(false),
mIsSceneConnected(false),
+#ifdef OVER_TIZEN_VERSION_9
mEcoreVideoShellSurface(nullptr),
+#endif
mVideoShellSizePropertyIndex(Property::INVALID_INDEX)
{
}
mEcoreSubVideoWindow = nullptr;
}
+#ifdef OVER_TIZEN_VERSION_9
if(mEcoreVideoShellSurface)
{
Ecore_Wl2_VideoShell_Surface_del(mEcoreVideoShellSurface);
mEcoreVideoShellSurface = nullptr;
}
+#endif
DestroyPlayer();
}
void TizenVideoPlayer::InitializeVideoShell(Ecore_Wl2_Window* ecoreWlWindow)
{
+#ifdef OVER_TIZEN_VERSION_9
if(mEcoreWlWindow != ecoreWlWindow)
{
mEcoreWlWindow = ecoreWlWindow;
DALI_LOG_RELEASE_INFO("VideoShell(%p) handle: %s\n", mEcoreVideoShellSurface, videoShellHandle);
}
+#else
+ DALI_LOG_ERROR("InitializeVideoShell, ecore_wl2_subsurface_new() NOT SUPPORT THIS TIZEN VERSION!\n");
+#endif
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void TizenVideoPlayer::CreateVideoShellConstraint()
{
+#ifdef OVER_TIZEN_VERSION_9
DALI_LOG_RELEASE_INFO("Create Video Shell Constraint\n");
if(mVideoShellSizePropertyIndex == Property::INVALID_INDEX)
{
mVideoShellSizePropertyConstraint.AddSource(LocalSource(Actor::Property::WORLD_POSITION));
}
}
+#else
+ DALI_LOG_ERROR("Video Shell Constraint NOT SUPPORT THIS TIZEN VERSION!\n");
+#endif
}
void TizenVideoPlayer::DestroyVideoShellConstraint()
{
+#ifdef OVER_TIZEN_VERSION_9
DALI_LOG_RELEASE_INFO("Destroy VideoShell Constraint: %d\n", mVideoShellSizePropertyIndex);
if(mVideoShellSizePropertyIndex != Property::INVALID_INDEX)
{
mVideoShellSizePropertyConstraint.Remove();
mVideoShellSizePropertyIndex = Property::INVALID_INDEX;
}
+#else
+ DALI_LOG_ERROR("Video Shell Constraint NOT SUPPORT THIS TIZEN VERSION!\n");
+#endif
}
void TizenVideoPlayer::RaiseAbove(Any videoSurface)
if(mSyncMode == Dali::VideoSyncMode::ENABLED && mVideoShellSizePropertyIndex == Property::INVALID_INDEX)
{
- DALI_LOG_RELEASE_INFO("mVideoShellSizePropertyConstraint(%d).ApplyPost()\n", mVideoShellSizePropertyIndex);
CreateVideoShellConstraint();
- mVideoShellSizePropertyConstraint.ApplyPost();
+ if(mVideoShellSizePropertyConstraint)
+ {
+ DALI_LOG_RELEASE_INFO("mVideoShellSizePropertyConstraint(%d).ApplyPost()\n", mVideoShellSizePropertyIndex);
+ mVideoShellSizePropertyConstraint.ApplyPost();
+ }
+ else
+ {
+ DALI_LOG_ERROR("mVideoShellSizePropertyConstraint() creation failed!\n");
+ }
}
mIsSceneConnected = true;
}
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/object/weak-handle.h>
#include <player.h>
-#include <string>
#include <list>
+#include <string>
#ifndef HAVE_WAYLAND
#define HAVE_WAYLAND
Dali::Vector4 mBackgroundColor; ///< Current background color, which texturestream mode needs.
RenderingTargetType mTargetType; ///< Current rendering target type
- Dali::Mutex mPacketMutex;
- std::list<media_packet_h> mPacketList; ///< Container for media packet handle from Tizen player callback
+ Dali::Mutex mPacketMutex;
+ std::list<media_packet_h> mPacketList; ///< Container for media packet handle from Tizen player callback
sound_stream_info_h mStreamInfo;
sound_stream_type_e mStreamType;
Property::Index mVideoSizePropertyIndex;
Dali::VideoSyncMode mSyncMode;
- bool mIsMovedHandle; ///< the flag for moved the handle
+ bool mIsMovedHandle; ///< the flag for moved the handle
bool mIsSceneConnected;
-
- Ecore_Wl2_VideoShell_Surface* mEcoreVideoShellSurface;
- Constraint mVideoShellSizePropertyConstraint;
- Property::Index mVideoShellSizePropertyIndex;
+#ifdef OVER_TIZEN_VERSION_9
+ Ecore_Wl2_VideoShell_Surface* mEcoreVideoShellSurface;
+#endif
+ Constraint mVideoShellSizePropertyConstraint;
+ Property::Index mVideoShellSizePropertyIndex;
public:
Dali::VideoPlayerPlugin::VideoPlayerSignalType mFinishedSignal;
#include "tizen-web-engine-user-media-permission-request.h"
#include <Ecore_Evas.h>
-#include <Ecore_Wl2.h>
#include <Ecore_Input_Evas.h>
+#include <Ecore_Wl2.h>
#include <dali/devel-api/common/stage.h>
#include <dali/integration-api/adaptor-framework/adaptor.h>
point.y = touch.GetScreenPosition(i).y;
point.state = state;
pointList = eina_list_append(pointList, &point);
- fed = ewk_view_feed_touch_event(mWebView, type, pointList, 0);
+ fed = ewk_view_feed_touch_event(mWebView, type, pointList, 0);
eina_list_free(pointList);
if(!fed)
{
memset(&downEvent, 0, sizeof(Evas_Event_Key_Down));
downEvent.timestamp = keyEvent.GetTime();
- downEvent.keyname = const_cast<char *>(keyEvent.GetKeyName().c_str());
- downEvent.key = keyEvent.GetLogicalKey().c_str();
- downEvent.string = keyEvent.GetKeyString().c_str();
- downEvent.keycode = keyEvent.GetKeyCode();
- Evas* evas = ecore_evas_get(WebEngineManager::Get().GetWindow());
+ downEvent.keyname = const_cast<char*>(keyEvent.GetKeyName().c_str());
+ downEvent.key = keyEvent.GetLogicalKey().c_str();
+ downEvent.string = keyEvent.GetKeyString().c_str();
+ downEvent.keycode = keyEvent.GetKeyCode();
+ Evas* evas = ecore_evas_get(WebEngineManager::Get().GetWindow());
ecore_event_evas_modifier_lock_update(evas, (unsigned int)keyEvent.GetKeyModifier());
downEvent.modifiers = const_cast<Evas_Modifier*>(evas_key_modifier_get(evas));
- downEvent.locks = const_cast<Evas_Lock*>(evas_key_lock_get(evas));
- downEvent.dev = evas_device_get(evas, keyEvent.GetDeviceName().c_str());
+ downEvent.locks = const_cast<Evas_Lock*>(evas_key_lock_get(evas));
+ downEvent.dev = evas_device_get(evas, keyEvent.GetDeviceName().c_str());
evasKeyEvent = static_cast<void*>(&downEvent);
ewk_view_send_key_event(mWebView, evasKeyEvent, true);
memset(&upEvent, 0, sizeof(Evas_Event_Key_Up));
upEvent.timestamp = keyEvent.GetTime();
- upEvent.keyname = const_cast<char *>(keyEvent.GetKeyName().c_str());
- upEvent.key = keyEvent.GetLogicalKey().c_str();
- upEvent.string = keyEvent.GetKeyString().c_str();
- upEvent.keycode = keyEvent.GetKeyCode();
- Evas* evas = ecore_evas_get(WebEngineManager::Get().GetWindow());
+ upEvent.keyname = const_cast<char*>(keyEvent.GetKeyName().c_str());
+ upEvent.key = keyEvent.GetLogicalKey().c_str();
+ upEvent.string = keyEvent.GetKeyString().c_str();
+ upEvent.keycode = keyEvent.GetKeyCode();
+ Evas* evas = ecore_evas_get(WebEngineManager::Get().GetWindow());
ecore_event_evas_modifier_lock_update(evas, (unsigned int)keyEvent.GetKeyModifier());
upEvent.modifiers = const_cast<Evas_Modifier*>(evas_key_modifier_get(evas));
- upEvent.locks = const_cast<Evas_Lock*>(evas_key_lock_get(evas));
- upEvent.dev = evas_device_get(evas, keyEvent.GetDeviceName().c_str());
+ upEvent.locks = const_cast<Evas_Lock*>(evas_key_lock_get(evas));
+ upEvent.dev = evas_device_get(evas, keyEvent.GetDeviceName().c_str());
evasKeyEvent = static_cast<void*>(&upEvent);
ewk_view_send_key_event(mWebView, evasKeyEvent, false);
void TizenWebEngineChromium::WebAuthenticationCancel()
{
+#ifdef OVER_TIZEN_VERSION_9
ewk_view_webauthn_cancel(mWebView);
+#endif
}
void TizenWebEngineChromium::RegisterGeolocationPermissionCallback(GeolocationPermissionCallback callback)
ewk_view_user_media_permission_callback_set(mWebView, &TizenWebEngineChromium::OnUserMediaPermissonRequest, this);
}
-
-
void TizenWebEngineChromium::UpdateDisplayArea(Dali::Rect<int32_t> displayArea)
{
// Size was changed. Destroy previous native image source, and create new one.
void TizenWebEngineChromium::OnTextFound(void* data, Evas_Object*, void* eventInfo)
{
- auto pThis = static_cast<TizenWebEngineChromium*>(data);
+ auto pThis = static_cast<TizenWebEngineChromium*>(data);
uint32_t count = *((uint32_t*)(eventInfo));
DALI_LOG_RELEASE_INFO("#TextFound, count:%u.\n", count);
ExecuteCallback(pThis->mTextFoundCallback, count);
void TizenWebEngineChromium::OnWebAuthDisplayQR(void* data, Evas_Object*, void* contents)
{
- auto pThis = static_cast<TizenWebEngineChromium*>(data);
+ auto pThis = static_cast<TizenWebEngineChromium*>(data);
std::string result;
if(contents != nullptr)
{
resultText = static_cast<char*>(message.body);
}
- std::string key = static_cast<const char*>(message.name);
- auto targetCallback = pThis->mJavaScriptInjectedCallbacks.find(key);
+ std::string key = static_cast<const char*>(message.name);
+ auto targetCallback = pThis->mJavaScriptInjectedCallbacks.find(key);
- if (targetCallback != pThis->mJavaScriptInjectedCallbacks.end())
+ if(targetCallback != pThis->mJavaScriptInjectedCallbacks.end())
{
ExecuteCallback(targetCallback->second, resultText);
}
Eina_Bool TizenWebEngineChromium::OnUserMediaPermissonRequest(Evas_Object*, Ewk_User_Media_Permission_Request* request, void* data)
{
- auto pThis = static_cast<TizenWebEngineChromium*>(data);
+ auto pThis = static_cast<TizenWebEngineChromium*>(data);
std::unique_ptr<Dali::WebEngineUserMediaPermissionRequest> webUserMediaPermissionRequest(new TizenWebEngineUserMediaPermissionRequest(request));
DALI_LOG_RELEASE_INFO("#UserMediaPermissonRequest: pThis:%p, permission:%p\n", pThis, request);
std::string msg = ewk_user_media_permission_request_message_get(request);
ExecuteCallback(pThis->mUserMediaPermissionRequestCallback, std::move(webUserMediaPermissionRequest), msg);
- return msg.empty()? false: true;
+ return msg.empty() ? false : true;
}
-
-
} // namespace Plugin
} // namespace Dali
}
}
+namespace
+{
+#ifndef OVER_TIZEN_VERSION_9
+#define DB_NAME_LOCAL_STORAGE "LWE_localStorage.db"
+#define DB_NAME_COOKIES "LWE_Cookies.db"
+#define DB_NAME_CACHE "LWE_Cache.db"
+
+class Locker
+{
+public:
+ Locker(pthread_mutex_t& lock)
+ : m_lock(lock)
+ {
+ pthread_mutex_lock(&m_lock);
+ }
+
+ ~Locker()
+ {
+ pthread_mutex_unlock(&m_lock);
+ }
+
+protected:
+ pthread_mutex_t m_lock;
+};
+#endif
+} // namespace
+
namespace Dali
{
namespace Plugin
mIsMouseLbuttonDown(false),
mCanGoBack(false),
mCanGoForward(false),
+#ifndef OVER_TIZEN_VERSION_9
+ mOutputWidth(0),
+ mOutputHeight(0),
+ mOutputStride(0),
+ mOutputBuffer(nullptr),
+ mTbmSurface(nullptr),
+ mUpdateBufferTrigger(MakeCallback(this, &TizenWebEngineLWE::LegacyUpdateBuffer)),
+#endif
mWebContainer(NULL),
mDaliImageSrc(NativeImageSource::New(0, 0, NativeImageSource::COLOR_DEPTH_DEFAULT)),
mNativeDisplay(NULL),
mLoadStartedCallback(nullptr),
mLoadFinishedCallback(nullptr)
{
+#ifndef OVER_TIZEN_VERSION_9
+ pthread_mutex_init(&mOutputBufferMutex, NULL);
+#endif
}
TizenWebEngineLWE::~TizenWebEngineLWE()
{
+#ifndef OVER_TIZEN_VERSION_9
+ pthread_mutex_destroy(&mOutputBufferMutex);
+#endif
}
static std::string Langset()
void TizenWebEngineLWE::Create(uint32_t width, uint32_t height, uint32_t argc, char** argv)
{
+#ifdef OVER_TIZEN_VERSION_9
for(uint32_t idx = 0; idx < argc; ++idx)
{
if(argv[idx])
}
}
}
+#endif
Create(width, height, Langset(), Timezone());
}
void TizenWebEngineLWE::Create(uint32_t width, uint32_t height, const std::string& locale, const std::string& timezoneId)
{
+#ifndef OVER_TIZEN_VERSION_9
+ mOutputWidth = width;
+ mOutputHeight = height;
+ mOutputStride = width * sizeof(uint32_t);
+ mOutputBuffer = (uint8_t*)malloc(width * height * sizeof(uint32_t));
+
+ mOnRenderedHandler = [this](LWE::WebContainer* c, const LWE::WebContainer::RenderResult& renderResult) {
+ size_t w = mOutputWidth;
+ size_t h = mOutputHeight;
+ if(renderResult.updatedWidth != w || renderResult.updatedHeight != h)
+ {
+ return;
+ }
+ Locker l(mOutputBufferMutex);
+ uint8_t* dstBuffer;
+ size_t dstStride;
+
+ tbm_surface_info_s tbmSurfaceInfo;
+ if(tbm_surface_map(mTbmSurface, TBM_SURF_OPTION_READ | TBM_SURF_OPTION_WRITE, &tbmSurfaceInfo) != TBM_SURFACE_ERROR_NONE)
+ {
+ DALI_LOG_ERROR("Fail to map tbm_surface\n");
+ }
+
+ DALI_ASSERT_ALWAYS(tbmSurfaceInfo.format == TBM_FORMAT_ARGB8888 && "Unsupported TizenWebEngineLWE tbm format");
+ dstBuffer = tbmSurfaceInfo.planes[0].ptr;
+ dstStride = tbmSurfaceInfo.planes[0].stride;
+
+ uint32_t srcStride = static_cast<uint32_t>(renderResult.updatedWidth * sizeof(uint32_t));
+ uint8_t* srcBuffer = static_cast<uint8_t*>(renderResult.updatedBufferAddress);
+
+ if(dstStride == srcStride)
+ {
+ memcpy(dstBuffer, srcBuffer, tbmSurfaceInfo.planes[0].size);
+ }
+ else
+ {
+ for(auto y = renderResult.updatedY; y < (renderResult.updatedHeight + renderResult.updatedY); y++)
+ {
+ auto start = renderResult.updatedX;
+ memcpy(dstBuffer + (y * dstStride) + (start * 4), srcBuffer + (y * srcStride) + (start * 4), srcStride);
+ }
+ }
+
+ if(tbm_surface_unmap(mTbmSurface) != TBM_SURFACE_ERROR_NONE)
+ {
+ DALI_LOG_ERROR("Fail to unmap tbm_surface\n");
+ }
+ mUpdateBufferTrigger.Trigger();
+ };
+#endif
mOnReceivedError = [](LWE::WebContainer* container, LWE::ResourceError error) {
};
if(!LWE::LWE::IsInitialized())
{
std::string dataPath = DevelApplication::GetDataPath();
+#ifdef OVER_TIZEN_VERSION_9
LWE::LWE::Initialize((dataPath + "/StarFishStorage").c_str());
+#else
+ LWE::LWE::Initialize((dataPath + DB_NAME_LOCAL_STORAGE).c_str(),
+ (dataPath + DB_NAME_COOKIES).c_str(),
+ (dataPath + DB_NAME_CACHE).c_str());
+#endif
gEglCreateSyncKHR = (PFNEGLCREATESYNCKHRPROC)eglGetProcAddress("eglCreateSyncKHR");
gEglDestroySyncKHR = (PFNEGLDESTROYSYNCKHRPROC)eglGetProcAddress("eglDestroySyncKHR");
gEglClientWaitSyncKHR = (PFNEGLCLIENTWAITSYNCKHRPROC)eglGetProcAddress("eglClientWaitSyncKHR");
}
+#ifdef OVER_TIZEN_VERSION_9
LWE::WebContainer::WebContainerArguments args{
.width = static_cast<unsigned>(width),
.height = static_cast<unsigned>(height),
mWebContainer = LWE::WebContainer::CreateGL(args, config);
+ mWebContainer->RegisterSetNeedsRenderingCallback(
+ [this](LWE::WebContainer*, const std::function<void()>& doRenderingFunction) {
+ if(!mLWERenderingFunction)
+ {
+ mLWERenderingFunction = doRenderingFunction;
+ }
+
+ if(!mLWERenderingRequested.exchange(true))
+ {
+ PrepareLWERendering();
+ }
+ });
+
+ mWebContainer->RegisterOnIdleHandler(
+ [this](LWE::WebContainer*) {
+ OnIdle();
+ });
+
+ auto settings = mWebContainer->GetSettings();
+ settings.SetWebSecurityMode(LWE::WebSecurityMode::Disable);
+ mWebContainer->SetSettings(settings);
+
+ mWebContainer->LoadURL("about:blank");
+#else
+ mWebContainer = LWE::WebContainer::Create(mOutputWidth, mOutputHeight, 1.0, "", locale.data(), timezoneId.data());
+
+ mWebContainer->RegisterPreRenderingHandler(
+ [this]() -> LWE::WebContainer::RenderInfo {
+ if(mOutputBuffer == NULL)
+ {
+ mOutputBuffer = (uint8_t*)malloc(mOutputWidth * mOutputHeight * sizeof(uint32_t));
+ mOutputStride = mOutputWidth * sizeof(uint32_t);
+ }
+
+ ::LWE::WebContainer::RenderInfo result;
+ result.updatedBufferAddress = mOutputBuffer;
+ result.bufferStride = mOutputStride;
+
+ return result;
+ });
+
+ mWebContainer->RegisterOnRenderedHandler(
+ [this](LWE::WebContainer* container, const LWE::WebContainer::RenderResult& renderResult) {
+ mOnRenderedHandler(container, renderResult);
+ });
+#endif
+
mWebContainer->RegisterOnReceivedErrorHandler(
[this](LWE::WebContainer* container, LWE::ResourceError error) {
mCanGoBack = container->CanGoBack();
mCanGoForward = container->CanGoForward();
mOnLoadResourceHandler(container, url);
});
-
- mWebContainer->RegisterSetNeedsRenderingCallback(
- [this](LWE::WebContainer*, const std::function<void()>& doRenderingFunction) {
- if(!mLWERenderingFunction)
- {
- mLWERenderingFunction = doRenderingFunction;
- }
-
- if(!mLWERenderingRequested.exchange(true))
- {
- PrepareLWERendering();
- }
- });
-
- mWebContainer->RegisterOnIdleHandler(
- [this](LWE::WebContainer*) {
- OnIdle();
- });
-
- auto settings = mWebContainer->GetSettings();
- settings.SetWebSecurityMode(LWE::WebSecurityMode::Disable);
- mWebContainer->SetSettings(settings);
-
- mWebContainer->LoadURL("about:blank");
}
void TizenWebEngineLWE::TryRendering()
return;
}
+#ifndef OVER_TIZEN_VERSION_9
+ if(mTbmSurface != NULL && tbm_surface_destroy(mTbmSurface) != TBM_SURFACE_ERROR_NONE)
+ {
+ DALI_LOG_ERROR("Failed to destroy tbm_surface\n");
+ }
+#endif
+
DestroyInstance();
mWebContainer = NULL;
}
}
}
+#ifndef OVER_TIZEN_VERSION_9
+void TizenWebEngineLWE::LegacyUpdateBuffer()
+{
+ UpdateImage(mTbmSurface);
+}
+#endif
+
void TizenWebEngineLWE::UpdateImage(tbm_surface_h image)
{
DALI_ASSERT_ALWAYS(mWebContainer);
if((int)mWebContainer->Width() == tbm_surface_get_width(image) ||
(int)mWebContainer->Height() == tbm_surface_get_height(image))
{
- Any source(image);
- mDaliImageSrc->SetSource(source);
- Dali::Stage::GetCurrent().KeepRendering(0.0f);
+#ifndef OVER_TIZEN_VERSION_9
+ {
+ Locker l(mOutputBufferMutex);
+#endif
+ Any source(image);
+ mDaliImageSrc->SetSource(source);
+ Dali::Stage::GetCurrent().KeepRendering(0.0f);
+#ifndef OVER_TIZEN_VERSION_9
+ }
+#endif
if(mFrameRenderedCallback)
{
{
mWebContainer->ResizeTo(width, height);
}
+
+#ifndef OVER_TIZEN_VERSION_9
+ if(mOutputWidth != (size_t)width || mOutputHeight != (size_t)height)
+ {
+ mOutputWidth = width;
+ mOutputHeight = height;
+ mOutputStride = width * sizeof(uint32_t);
+
+ tbm_surface_h prevTbmSurface = mTbmSurface;
+ mTbmSurface = tbm_surface_create(width, height, TBM_FORMAT_ARGB8888);
+ Dali::Any source(mTbmSurface);
+ mDaliImageSrc->SetSource(source);
+ if(prevTbmSurface != NULL && tbm_surface_destroy(prevTbmSurface) != TBM_SURFACE_ERROR_NONE)
+ {
+ DALI_LOG_ERROR("Failed to destroy tbm_surface\n");
+ }
+
+ auto oldOutputBuffer = mOutputBuffer;
+ mOutputBuffer = (uint8_t*)malloc(mOutputWidth * mOutputHeight * sizeof(uint32_t));
+ mOutputStride = mOutputWidth * sizeof(uint32_t);
+ mWebContainer->ResizeTo(mOutputWidth, mOutputHeight);
+
+ if(oldOutputBuffer)
+ {
+ free(oldOutputBuffer);
+ }
+ }
+#endif
}
void TizenWebEngineLWE::SetDocumentBackgroundColor(Dali::Vector4 color)
void TizenWebEngineLWE::RegisterWebAuthDisplayQRCallback(WebEngineWebAuthDisplayQRCallback callback)
{
- // NOT IMPLEMENTED
+ // NOT IMPLEMENTED
}
void TizenWebEngineLWE::RegisterWebAuthResponseCallback(WebEngineWebAuthResponseCallback callback)
#include <dali/devel-api/adaptor-framework/web-engine/web-engine-plugin.h>
#include <dali/public-api/adaptor-framework/timer.h>
+#include <tbm_dummy_display.h>
#include <tbm_surface.h>
#include <tbm_surface_internal.h>
#include <tbm_surface_queue.h>
-#include <tbm_dummy_display.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
{
namespace Plugin
{
-
/**
* @brief Implementation of the Tizen WebEngineLWE class which has Tizen
* platform dependency.
void RegisterUserMediaPermissionRequestCallback(WebEngineUserMediaPermissionRequestCallback callback) override;
private:
+#ifndef OVER_TIZEN_VERSION_9
+ void LegacyUpdateBuffer();
+#endif
+
void DestroyInstance();
void DispatchMouseDownEvent(float x, float y);
void UpdateImage(tbm_surface_h image);
private:
- std::string mUrl;
- bool mIsMouseLbuttonDown;
- bool mCanGoBack;
- bool mCanGoForward;
+ std::string mUrl;
+
+ bool mIsMouseLbuttonDown;
+ bool mCanGoBack;
+ bool mCanGoForward;
+
+#ifndef OVER_TIZEN_VERSION_9
+ size_t mOutputWidth;
+ size_t mOutputHeight;
+ size_t mOutputStride;
+ uint8_t* mOutputBuffer;
+
+ pthread_mutex_t mOutputBufferMutex;
+ tbm_surface_h mTbmSurface;
+
+ std::function<void(LWE::WebContainer*, const LWE::WebContainer::RenderResult&)> mOnRenderedHandler;
+
+ EventThreadCallback mUpdateBufferTrigger;
+#endif
std::function<void(LWE::WebContainer*, LWE::ResourceError)> mOnReceivedError;
std::function<void(LWE::WebContainer*, const std::string&)> mOnPageFinishedHandler;
std::function<void(LWE::WebContainer*, const std::string&)> mOnPageStartedHandler;
std::function<void(LWE::WebContainer*, const std::string&)> mOnLoadResourceHandler;
- LWE::WebContainer* mWebContainer;
- Dali::NativeImageSourcePtr mDaliImageSrc;
-
- EGLNativeDisplayType mNativeDisplay;
- EGLDisplay mEglDisplay;
- EGLConfig mEglConfig;
- EGLSurface mEglSurface;
- EGLContext mEglContext;
- EGLSyncKHR mEglSync;
-
- tbm_surface_queue_h mTbmQueue;
- tbm_surface_h mLastDrawnTbmSurface;
- tbm_surface_h mIdleTbmSurface;
-
- std::function<void ()> mLWERenderingFunction;
- std::atomic_bool mLWERenderingRequested;
- std::atomic_bool mInImageUpdateState;
- std::atomic_bool mInIdleState;
- std::atomic_bool mFirstRenderEnded;
- Dali::Signal<void ()> mFirstRenderSignal;
+ LWE::WebContainer* mWebContainer;
+ Dali::NativeImageSourcePtr mDaliImageSrc;
+
+ EGLNativeDisplayType mNativeDisplay;
+ EGLDisplay mEglDisplay;
+ EGLConfig mEglConfig;
+ EGLSurface mEglSurface;
+ EGLContext mEglContext;
+ EGLSyncKHR mEglSync;
+
+ tbm_surface_queue_h mTbmQueue;
+ tbm_surface_h mLastDrawnTbmSurface;
+ tbm_surface_h mIdleTbmSurface;
+
+ std::function<void()> mLWERenderingFunction;
+ std::atomic_bool mLWERenderingRequested;
+ std::atomic_bool mInImageUpdateState;
+ std::atomic_bool mInIdleState;
+ std::atomic_bool mFirstRenderEnded;
+ Dali::Signal<void()> mFirstRenderSignal;
WebEngineFrameRenderedCallback mFrameRenderedCallback;
WebEnginePageLoadCallback mLoadStartedCallback;
%define tizen_65_or_greater 1
%endif
+%if 0%{?tizen_version_major} >= 9
+%define tizen_90_or_greater 1
+%endif
+
%if %{undefined NO_WEB_FRAMEWORK}
%define enable_web_engine_plugin 1
%endif
Group: System/Libraries
BuildRequires: pkgconfig(capi-media-player)
BuildRequires: pkgconfig(capi-system-info)
-BuildRequires: pkgconfig(wayland-egl)
# dali-adaptor uses ecore mainloop
-%if 0%{?tizen_version_major} >= 5
+%if 0%{?tizen_50_or_greater}
BuildRequires: pkgconfig(ecore-wl2)
%else
BuildRequires: pkgconfig(ecore-wayland)
%endif
+%if 0%{?tizen_90_or_greater}
+BuildRequires: pkgconfig(wayland-egl)
+%endif
+
%description video-player-plugin
VideoPlayer plugin to play a video file for Dali
CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections -DGL_GLEXT_PROTOTYPES"
LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
-%if 0%{?tizen_version_major} >= 5
+%if 0%{?tizen_50_or_greater}
CFLAGS+=" -DECORE_WL2 -DEFL_BETA_API_SUPPORT"
CXXFLAGS+=" -DECORE_WL2 -DEFL_BETA_API_SUPPORT"
configure_flags="--enable-ecore-wl2"
%if 0%{?tizen_65_or_greater}
--with-tizen-65-or-greater \
%endif
+%if 0%{?tizen_90_or_greater}
+ --with-tizen-90-or-greater \
+%endif
%if 0%{?enable_web_engine_plugin} == 1
--enable-web-engine-plugin \
%endif