// EXTERNAL INCLUDES
#include <dali/public-api/signals/dali-signal.h>
#include <dali/public-api/math/rect.h>
+#include <dali/public-api/actors/actor.h>
namespace Dali
{
*/
virtual Any GetMediaPlayer() = 0;
+ /**
+ * @brief calls synchronization function in window system
+ * This function is called, the synchronization is started between UI(transparent hole) and video player.
+ */
+ virtual void StartSynchronization() = 0;
+
+ /**
+ * @brief calls desynchronization function in window system
+ * This function is called, the synchronization is finished between UI(transparent hole) and video player.
+ */
+ virtual void FinishSynchronization() = 0;
+
};
} // namespace Dali;
if( player )
{
- player->Initialize();
+ Dali::Actor actor;
+ player->Initialize( actor, VideoSyncMode::DISABLED );
+ }
+
+ return VideoPlayer( player.Get() );
+}
+
+VideoPlayer VideoPlayer::New( Dali::Actor actor, VideoSyncMode syncMode )
+{
+ Internal::Adaptor::VideoPlayerPtr player = Internal::Adaptor::VideoPlayer::New();
+
+ if( player )
+ {
+ player->Initialize( actor, syncMode );
}
return VideoPlayer( player.Get() );
return GetImplementation( *this ).GetMediaPlayer();
}
+void VideoPlayer::StartSynchronization()
+{
+ GetImplementation( *this ).StartSynchronization();
+}
+
+void VideoPlayer::FinishSynchronization()
+{
+ GetImplementation( *this ).FinishSynchronization();
+}
+
} // namespace Dali;
// EXTERNAL INCLUDES
#include <dali/public-api/object/base-handle.h>
+#include <dali/devel-api/adaptor-framework/video-sync-mode.h>
//INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/video-player-plugin.h>
*/
static VideoPlayer New();
+ /**
+ * @brief Creates a new instance of a VideoPlayer.
+ *
+ * If you want the video player works with Ui synchronous when video player is resized/moved,
+ * put the video view actor and the enabled syncMode.
+ *
+ * @param[in] actor video view's actor instance
+ * @param[in] syncMode The synchronization mode between the UI (transparent hole) and VideoPlayer.
+ */
+ static VideoPlayer New( Dali::Actor actor, VideoSyncMode syncMode );
+
/**
* @brief Copy constructor.
*
*/
Any GetMediaPlayer();
+ /**
+ * @brief calls synchronization function in window system
+ * This function is called, the synchronization is started between UI(transparent hole) and video player.
+ */
+ void StartSynchronization();
+
+ /**
+ * @brief calls desynchronization function in window system
+ * This function is called, the synchronization is ended between UI(transparent hole) and video player.
+ */
+ void FinishSynchronization();
+
private: // Not intended for application developers
/**
--- /dev/null
+#ifndef DALI_VIDEO_SYNC_MODE
+#define DALI_VIDEO_SYNC_MODE
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+namespace Dali
+{
+ /**
+ * @brief Enumeration for the synchronization is ended between UI(transparent hole) and video player.
+ */
+ enum class VideoSyncMode
+ {
+ DISABLED = 0,
+ ENABLED
+ };
+
+} // Dali
+#endif // DALI_VIDEO_SYNC_MODE
+
namespace Dali
{
-class KeyEvent;
+struct KeyEvent;
class TouchData;
-class WheelEvent;
+struct WheelEvent;
class RenderTaskList;
namespace DevelWindow
${adaptor_devel_api_dir}/adaptor-framework/thread-settings.h
${adaptor_devel_api_dir}/adaptor-framework/window-devel.h
${adaptor_devel_api_dir}/adaptor-framework/component-application.h
+ ${adaptor_devel_api_dir}/adaptor-framework/video-sync-mode.h
)
#define DALI_INTEGRATION_NATIVE_RENDER_SURFACE_FACTORY_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Factory function for native surface
* A native surface is created.
*
- * @param [in] positionSize the position and size of the surface to create
+ * @param [in] surfaceSize the size of the surface to create
+ * @param [in] surface the native surface handle of your platform.
+ * If you don't pass this, a native surface will be created.
* @param [in] isTransparent Whether the surface has an alpha channel
*/
-NativeRenderSurface* CreateNativeSurface( PositionSize positionSize,
+NativeRenderSurface* CreateNativeSurface( SurfaceSize surfaceSize, Any surface,
bool isTransparent );
} // namespace Dali
#include <dali/public-api/object/any.h>
#include <dali/public-api/object/weak-handle.h>
#include <dali/integration-api/scene.h>
+#include <dali/public-api/math/uint-16-pair.h>
namespace Dali
{
/**
* @brief The position and size of the render surface.
*/
-typedef Dali::Rect<int> PositionSize;
+using PositionSize = Dali::Rect<int>;
+using SurfaceSize = Uint16Pair;
/**
* @brief Interface for a render surface onto which Dali draws.
else
{
unsigned int maxTextureSize = mConfigurationManager->GetMaxTextureSize();
- setenv( DALI_ENV_MAX_TEXTURE_SIZE, std::to_string( maxTextureSize ).c_str(), 1 );
Dali::TizenPlatform::ImageLoader::SetMaxTextureSize( maxTextureSize );
}
{
public:
Impl( const std::string& url, bool isLocalResource )
- : mUrl( url ),
- mLoadingFrame( 0 )
+ : mUrl( url )
{
#ifdef DALI_WEBP_ENABLED
if( ReadWebPInformation( isLocalResource ) )
std::string mUrl;
std::vector<uint32_t> mTimeStamp;
- uint32_t mLoadingFrame;
+ uint32_t mLoadingFrame{0};
#ifdef DALI_WEBP_ENABLED
- WebPData mWebPData;
- WebPAnimDecoder* mWebPAnimDecoder;
- WebPAnimInfo mWebPAnimInfo;
+ WebPData mWebPData{0};
+ WebPAnimDecoder* mWebPAnimDecoder{nullptr};
+ WebPAnimInfo mWebPAnimInfo{0};
#endif
};
}
}
-void VideoPlayer::Initialize()
+void VideoPlayer::Initialize( Dali::Actor actor, VideoSyncMode syncMode )
{
char* error = NULL;
return;
}
- mPlugin = mCreateVideoPlayerPtr();
+ mPlugin = mCreateVideoPlayerPtr( actor, syncMode );
if( mPlugin == NULL )
{
return NULL;
}
+void VideoPlayer::StartSynchronization()
+{
+ if( mPlugin != NULL )
+ {
+ mPlugin->StartSynchronization();
+ }
+}
+
+void VideoPlayer::FinishSynchronization()
+{
+ if( mPlugin != NULL )
+ {
+ mPlugin->FinishSynchronization();
+ }
+}
+
} // namespace Adaptor;
} // namespace Internal;
} // namespace Dali;
// EXTERNAL INCLUDES
#include <dali/public-api/object/base-object.h>
+#include <dali/devel-api/adaptor-framework/video-sync-mode.h>
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/video-player.h>
/**
* @brief Initializes member data.
*/
- void Initialize();
+ void Initialize( Dali::Actor actor, VideoSyncMode syncMode );
/**
* @brief Dali::VideoPlayer::Forward()
*/
Any GetMediaPlayer();
+ /**
+ * @brief Dali::VideoPlayer::StartSynchronization()
+ */
+ void StartSynchronization();
+
+ /**
+ * @copydoc Dali::VideoPlayer::FinishSynchronization()
+ */
+ void FinishSynchronization();
+
private:
/**
Dali::VideoPlayerPlugin* mPlugin; ///< Videoplayer plugin handle
void* mHandle; ///< Handle for the loaded library
- typedef Dali::VideoPlayerPlugin* (*CreateVideoPlayerFunction)();
+ typedef Dali::VideoPlayerPlugin* (*CreateVideoPlayerFunction)( Dali::Actor actor, Dali::VideoSyncMode syncMode );
typedef void (*DestroyVideoPlayerFunction)( Dali::VideoPlayerPlugin* plugin );
CreateVideoPlayerFunction mCreateVideoPlayerPtr;
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return std::unique_ptr< PixmapRenderSurface >( nullptr );
}
-std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryAndroid::CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent )
+std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryAndroid::CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent )
{
return std::unique_ptr< NativeRenderSurface >( nullptr );
}
#define DALI_INTERNAL_WINDOWSYSTEM_ANDROID_RENDER_SURFACE_FACTORY_ANDROID_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
std::unique_ptr< PixmapRenderSurface > CreatePixmapRenderSurface( Dali::PositionSize positionSize, Any surface, bool isTransparent = false ) override;
- std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent = false ) override;
+ std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent = false ) override;
};
} // namespace Adaptor
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-DALI_ADAPTOR_API NativeRenderSurface* CreateNativeSurface( PositionSize positionSize, bool isTransparent )
+DALI_ADAPTOR_API NativeRenderSurface* CreateNativeSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent )
{
auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory();
- auto nativeRenderSurface = renderSurfaceFactory->CreateNativeRenderSurface( positionSize, isTransparent );
+ auto nativeRenderSurface = renderSurfaceFactory->CreateNativeRenderSurface( surfaceSize, surface, isTransparent );
return nativeRenderSurface.release();
}
virtual std::unique_ptr< PixmapRenderSurface > CreatePixmapRenderSurface( Dali::PositionSize positionSize, Any surface, bool isTransparent = false ) = 0;
- virtual std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent = false ) = 0;
+ virtual std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent = false ) = 0;
};
extern std::unique_ptr< RenderSurfaceFactory > GetRenderSurfaceFactory();
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return std::unique_ptr< PixmapRenderSurface >( nullptr );
}
-std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryEcoreWl::CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent )
+std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryEcoreWl::CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent )
{
- return Utils::MakeUnique< NativeRenderSurfaceEcoreWl >( positionSize, isTransparent );
+ return Utils::MakeUnique< NativeRenderSurfaceEcoreWl >( surfaceSize, surface, isTransparent );
}
// this should be created from somewhere
#define DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_RENDER_SURFACE_FACTORY_ECORE_WL_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
std::unique_ptr< PixmapRenderSurface > CreatePixmapRenderSurface( Dali::PositionSize positionSize, Any surface, bool isTransparent = false ) override;
- std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent = false ) override;
+ std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent = false ) override;
};
} // namespace Adaptor
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return std::unique_ptr< PixmapRenderSurface >( nullptr );
}
-std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryEcoreWl2::CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent )
+std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryEcoreWl2::CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent )
{
- return Utils::MakeUnique< NativeRenderSurfaceEcoreWl >( positionSize, isTransparent );
+ return Utils::MakeUnique< NativeRenderSurfaceEcoreWl >( surfaceSize, surface, isTransparent );
}
// this should be created from somewhere
#define DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_RENDER_SURFACE_FACTORY_ECORE_WL2_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
std::unique_ptr< PixmapRenderSurface > CreatePixmapRenderSurface( Dali::PositionSize positionSize, Any surface, bool isTransparent = false ) override;
- std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent = false ) override;
+ std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent = false ) override;
};
} // namespace Adaptor
DALI_ASSERT_ALWAYS( 0 && "Failed to get display" );
}
+ ecore_wl2_display_sync( display );
+
mEcoreWindow = ecore_wl2_window_new( display, NULL, positionSize.x, positionSize.y, positionSize.width, positionSize.height );
if ( mEcoreWindow == 0 )
} // unnamed namespace
-NativeRenderSurfaceEcoreWl::NativeRenderSurfaceEcoreWl( Dali::PositionSize positionSize, bool isTransparent )
-: mPosition( positionSize ),
+NativeRenderSurfaceEcoreWl::NativeRenderSurfaceEcoreWl( SurfaceSize surfaceSize, Any surface, bool isTransparent )
+: mSurfaceSize( surfaceSize ),
mRenderNotification( NULL ),
mGraphics( NULL ),
mEGL( nullptr ),
{
Dali::Internal::Adaptor::WindowSystem::Initialize();
- CreateNativeRenderable();
- setenv( "EGL_PLATFORM", "tbm", 1 );
+ if( surface.Empty() )
+ {
+ CreateNativeRenderable();
+ }
+ else
+ {
+ // check we have a valid type
+ DALI_ASSERT_ALWAYS( ( surface.GetType() == typeid (tbm_surface_queue_h) ) && "Surface type is invalid" );
+ mTbmQueue = AnyCast< tbm_surface_queue_h >( surface );
+ }
}
NativeRenderSurfaceEcoreWl::~NativeRenderSurfaceEcoreWl()
PositionSize NativeRenderSurfaceEcoreWl::GetPositionSize() const
{
- return mPosition;
+ return PositionSize( 0, 0, static_cast<int>( mSurfaceSize.GetWidth() ), static_cast<int>( mSurfaceSize.GetHeight() ) );
}
void NativeRenderSurfaceEcoreWl::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical )
void NativeRenderSurfaceEcoreWl::InitializeGraphics()
{
DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter );
- unsetenv( "EGL_PLATFORM" );
mGraphics = &mAdaptor->GetGraphicsInterface();
auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
DALI_LOG_ERROR( "Failed to resize tbm_surface_queue" );
}
- mPosition = positionSize;
+ mSurfaceSize.SetWidth( static_cast<uint16_t>( positionSize.width ) );
+ mSurfaceSize.SetHeight( static_cast<uint16_t>( positionSize.height ) );
}
void NativeRenderSurfaceEcoreWl::StartRender()
void NativeRenderSurfaceEcoreWl::CreateNativeRenderable()
{
+ int width = static_cast<int>( mSurfaceSize.GetWidth() );
+ int height = static_cast<int>( mSurfaceSize.GetHeight() );
+
// check we're creating one with a valid size
- DALI_ASSERT_ALWAYS( mPosition.width > 0 && mPosition.height > 0 && "tbm_surface size is invalid" );
+ DALI_ASSERT_ALWAYS( width > 0 && height > 0 && "tbm_surface size is invalid" );
- mTbmQueue = tbm_surface_queue_create( 3, mPosition.width, mPosition.height, mTbmFormat, TBM_BO_DEFAULT );
+ mTbmQueue = tbm_surface_queue_create( 3, width, height, mTbmFormat, TBM_BO_DEFAULT );
if( mTbmQueue )
{
/**
* Uses an Wayland surface to render to.
- * @param [in] positionSize the position and size of the surface
+ * @param [in] surfaceSize the size of the surface
+ * @param [in] surface the native surface handle
* @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
*/
- NativeRenderSurfaceEcoreWl( Dali::PositionSize positionSize, bool isTransparent = false );
+ NativeRenderSurfaceEcoreWl( SurfaceSize surfaceSize, Any surface, bool isTransparent = false );
/**
* @brief Destructor
private: // Data
- PositionSize mPosition;
+ SurfaceSize mSurfaceSize;
TriggerEventInterface* mRenderNotification;
Internal::Adaptor::GraphicsInterface* mGraphics; ///< The graphics interface
EglInterface* mEGL;
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return Utils::MakeUnique< PixmapRenderSurfaceEcoreX >( positionSize, surface, isTransparent );
}
-std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryEcoreX::CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent )
+std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryEcoreX::CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent )
{
return std::unique_ptr< NativeRenderSurface >( nullptr );
}
#define DALI_INTERNAL_WINDOWSYSTEM_ECOREX_RENDER_SURFACE_FACTORY_ECORE_X_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
std::unique_ptr< PixmapRenderSurface > CreatePixmapRenderSurface( Dali::PositionSize positionSize, Any surface, bool isTransparent = false ) override;
- std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent = false ) override;
+ std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent = false ) override;
};
} // namespace Adaptor
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return nullptr;
}
-std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryWin::CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent )
+std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryWin::CreateNativeRenderSurface( SurfaceSize surfaceSize, Any surface, bool isTransparent )
{
return std::unique_ptr< NativeRenderSurface >( nullptr );
}
#define DALI_INTERNAL_WINDOWSYSTEM_WIN_RENDER_SURFACE_FACTORY_WIN_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
std::unique_ptr< PixmapRenderSurface > CreatePixmapRenderSurface( Dali::PositionSize positionSize, Any surface, bool isTransparent = false ) override;
- std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent = false ) override;
+ std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface(SurfaceSize surfaceSize, Any surface, bool isTransparent = false) override;
};
} // namespace Adaptor
const unsigned int ADAPTOR_MAJOR_VERSION = 1;
const unsigned int ADAPTOR_MINOR_VERSION = 9;
-const unsigned int ADAPTOR_MICRO_VERSION = 21;
+const unsigned int ADAPTOR_MICRO_VERSION = 22;
const char * const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali2-adaptor
Summary: The DALi Tizen Adaptor
-Version: 1.9.21
+Version: 1.9.22
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT