Add the synchronization between Ui and Video player
[platform/core/uifw/dali-adaptor.git] / dali / internal / video / common / video-player-impl.cpp
old mode 100644 (file)
new mode 100755 (executable)
index c2e911f..7fd5bd8
@@ -39,11 +39,7 @@ namespace Adaptor
 namespace // unnamed namespace
 {
 
-#if _GLIBCXX_USE_CXX11_ABI
-const char* VIDEO_PLUGIN_SO( "libdali-video-player-plugin.so" );
-#else
-const char* VIDEO_PLUGIN_SO( "libdali-video-player-plugin-cxx03.so" );
-#endif
+const char* VIDEO_PLUGIN_SO( "libdali2-video-player-plugin.so" );
 
 Dali::BaseHandle Create()
 {
@@ -81,7 +77,7 @@ VideoPlayer::~VideoPlayer()
   }
 }
 
-void VideoPlayer::Initialize()
+void VideoPlayer::Initialize( Dali::Actor actor, VideoSyncMode syncMode )
 {
   char* error = NULL;
 
@@ -95,13 +91,15 @@ void VideoPlayer::Initialize()
   }
 
   mCreateVideoPlayerPtr = reinterpret_cast< CreateVideoPlayerFunction >( dlsym( mHandle, "CreateVideoPlayerPlugin" ) );
-  if( mCreateVideoPlayerPtr == NULL )
+
+  error = dlerror();
+  if( mCreateVideoPlayerPtr == NULL || error != NULL )
   {
     DALI_LOG_ERROR( "Can't load symbol CreateVideoPlayerPlugin(), error: %s\n", error );
     return;
   }
 
-  mPlugin = mCreateVideoPlayerPtr();
+  mPlugin = mCreateVideoPlayerPtr( actor, syncMode );
 
   if( mPlugin == NULL )
   {
@@ -110,12 +108,13 @@ void VideoPlayer::Initialize()
   }
 
   mDestroyVideoPlayerPtr = reinterpret_cast< DestroyVideoPlayerFunction >( dlsym( mHandle, "DestroyVideoPlayerPlugin" ) );
-  if( mDestroyVideoPlayerPtr == NULL )
+
+  error = dlerror();
+  if( mDestroyVideoPlayerPtr == NULL || error != NULL )
   {
     DALI_LOG_ERROR( "Can't load symbol DestroyVideoPlayerPlugin(), error: %s\n", error );
     return;
   }
-
 }
 
 void VideoPlayer::SetUrl( const std::string& url )
@@ -317,6 +316,49 @@ Dali::VideoPlayerPlugin::CodecType VideoPlayer::GetCodecType() const
   return Dali::VideoPlayerPlugin::CodecType::DEFAULT;
 }
 
+void VideoPlayer::SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode )
+{
+  if( mPlugin != NULL )
+  {
+    mPlugin->SetDisplayMode( mode );
+  }
+}
+
+Dali::VideoPlayerPlugin::DisplayMode::Type VideoPlayer::GetDisplayMode() const
+{
+  if( mPlugin != NULL )
+  {
+    return mPlugin->GetDisplayMode();
+  }
+
+  return Dali::VideoPlayerPlugin::DisplayMode::DST_ROI;
+}
+
+Any VideoPlayer::GetMediaPlayer()
+{
+  if( mPlugin != NULL )
+  {
+    return mPlugin->GetMediaPlayer();
+  }
+  return NULL;
+}
+
+void VideoPlayer::StartSynchronization()
+{
+  if( mPlugin != NULL )
+  {
+    mPlugin->StartSynchronization();
+  }
+}
+
+void VideoPlayer::FinishSynchronization()
+{
+  if( mPlugin != NULL )
+  {
+    mPlugin->FinishSynchronization();
+  }
+}
+
 } // namespace Adaptor;
 } // namespace Internal;
 } // namespace Dali;