[dali_1.3.11] Merge branch 'devel/master' 25/169825/1
authoradam.b <adam.b@samsung.com>
Fri, 9 Feb 2018 11:09:36 +0000 (11:09 +0000)
committeradam.b <adam.b@samsung.com>
Fri, 9 Feb 2018 11:09:36 +0000 (11:09 +0000)
Change-Id: I6b4942b2eb1c6d89e2c2aa6cc90098e394c515be

13 files changed:
automated-tests/src/dali-toolkit-internal/CMakeLists.txt
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.cpp
automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp
build/tizen/docs/dali.doxy.in
dali-toolkit/internal/controls/video-view/video-view-impl.cpp
dali-toolkit/internal/controls/video-view/video-view-impl.h
dali-toolkit/internal/image-loader/image-load-thread.cpp
dali-toolkit/internal/image-loader/image-load-thread.h
dali-toolkit/public-api/controls/video-view/video-view.cpp
dali-toolkit/public-api/controls/video-view/video-view.h
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index 64f876b..8b2160f 100755 (executable)
@@ -32,6 +32,7 @@ SET(TC_SOURCES
 
 # Append list of test harness files (Won't get parsed for test cases)
 LIST(APPEND TC_SOURCES
+   ../dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-accessibility-adaptor.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-application.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard.cpp
index 4b25c5d..3ff177c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -21,6 +21,8 @@
 #include <dali/public-api/object/base-object.h>
 
 #include <toolkit-adaptor-impl.h>
+#include <dali/integration-api/debug.h>
+#include <test-application.h>
 
 namespace Dali
 {
@@ -210,6 +212,34 @@ void Adaptor::SetStereoBase(  float stereoBase )
 {
 }
 
+
+class LogFactory : public LogFactoryInterface
+{
+public:
+  virtual void InstallLogFunction() const
+  {
+    Dali::Integration::Log::LogFunction logFunction(&TestApplication::LogMessage);
+    Dali::Integration::Log::InstallLogFunction(logFunction);
+  }
+
+  LogFactory()
+  {
+  }
+  virtual ~LogFactory()
+  {
+  }
+};
+
+LogFactory* gLogFactory = NULL;
+const LogFactoryInterface& Adaptor::GetLogFactory()
+{
+  if( gLogFactory == NULL )
+  {
+    gLogFactory = new LogFactory;
+  }
+  return *gLogFactory;
+}
+
 Adaptor::Adaptor()
 : mImpl( NULL )
 {
index e7fb2cf..6e539eb 100644 (file)
@@ -37,6 +37,7 @@ public:
   {
     mMuted = false;
     mLooping = false;
+    mPlayPosition = 0;
   }
 
   void SetMuted( bool muted )
@@ -67,6 +68,16 @@ public:
     }
   }
 
+  int GetPlayPosition()
+  {
+    return mPlayPosition;
+  }
+
+  void SetPlayPosition( int pos )
+  {
+    mPlayPosition = pos;
+  }
+
 public:
 
   std::string mUrl;
@@ -78,6 +89,7 @@ private:
 
   bool mMuted;
   bool mLooping;
+  int mPlayPosition;
 };
 
 inline VideoPlayer& GetImplementation( Dali::VideoPlayer& player )
@@ -201,11 +213,12 @@ void VideoPlayer::SetRenderingTarget( Any target )
 
 void VideoPlayer::SetPlayPosition( int millisecond )
 {
+  Internal::Adaptor::GetImplementation( *this ).SetPlayPosition( millisecond );
 }
 
 int VideoPlayer::GetPlayPosition()
 {
-  return 0;
+  return Internal::Adaptor::GetImplementation( *this ).GetPlayPosition();
 }
 
 void VideoPlayer::SetDisplayArea( DisplayArea area )
@@ -234,10 +247,19 @@ void VideoPlayer::Backward( int millisecond )
 {
 }
 
-bool VideoPlayer::IsVideoTextureSupported() const
+bool VideoPlayer::IsVideoTextureSupported()
 {
   return ToolkitApplication::DECODED_IMAGES_SUPPORTED;
 }
 
+void VideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type )
+{
+}
+
+Dali::VideoPlayerPlugin::CodecType VideoPlayer::GetCodecType() const
+{
+  return Dali::VideoPlayerPlugin::CodecType::DEFAULT;
+}
+
 } // namespace Dali;
 
index 8baed37..4ea5bd3 100644 (file)
@@ -409,6 +409,7 @@ int UtcDaliVideoViewMethodsForCoverage2(void)
 int UtcDaliVideoViewPropertyUnderlay(void)
 {
   ToolkitTestApplication application;
+  tet_infoline("UtcDaliVideoViewPropertyUnderlay");
   ToolkitApplication::DECODED_IMAGES_SUPPORTED = true;
 
   VideoView view = VideoView::New();
@@ -453,3 +454,56 @@ int UtcDaliVideoViewPropertyUnderlay(void)
 
   END_TEST;
 }
+
+int UtcDaliVideoViewPropertyPlayPosition(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline("UtcDaliVideoViewPropertyPlayPosition");
+
+  VideoView view = VideoView::New();
+  DALI_TEST_CHECK( view );
+
+  Stage::GetCurrent().Add( view );
+  view.Play();
+
+  application.SendNotification();
+  application.Render();
+
+  int playPos = view.GetProperty( Toolkit::VideoView::Property::PLAY_POSITION ).Get< int >();
+  DALI_TEST_CHECK( playPos == 0 );
+
+  view.SetProperty( Toolkit::VideoView::Property::PLAY_POSITION, 10 );
+  playPos = view.GetProperty( Toolkit::VideoView::Property::PLAY_POSITION ).Get< int >();
+  // Actually setting play position will be async
+  // Actual platform result may be different.
+  DALI_TEST_CHECK( playPos == 10 );
+
+  END_TEST;
+}
+
+// For coverage.
+int UtcDaliVideoViewNew2(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline("UtcDaliVideoViewNew2");
+
+  VideoView view = VideoView::New( true );
+  DALI_TEST_CHECK( view );
+
+  Stage::GetCurrent().Add( view );
+  view.Play();
+
+  application.SendNotification();
+  application.Render();
+
+  VideoView view2 = VideoView::New( "", false );
+  DALI_TEST_CHECK( view2 );
+
+  Stage::GetCurrent().Add( view2 );
+  view2.Play();
+
+  application.SendNotification();
+  application.Render();
+
+  END_TEST;
+}
index 354478a..2e74f0f 100644 (file)
@@ -357,6 +357,7 @@ ALIASES += SINCE_1_2_32="@since 1.2.32"
 # Extra tags for Tizen 4.0
 ALIASES += SINCE_1_3_4="@since 1.3.4"
 ALIASES += SINCE_1_3_5="@since 1.3.5"
+ALIASES += SINCE_1_3_9="@since 1.3.9"
 
 ALIASES += DEPRECATED_1_0="@deprecated Deprecated since 1.0"
 ALIASES += DEPRECATED_1_1="@deprecated Deprecated since 1.1"
@@ -370,6 +371,7 @@ ALIASES += PRIVLEVEL_PUBLIC=""
 ALIASES += PRIVILEGE_KEYGRAB=""
 ALIASES += PRIVILEGE_DISPLAY=""
 ALIASES += PRIVILEGE_WINDOW_PRIORITY=""
+ALIASES += PRIVILEGE_CAPTURE=""
 ALIASES += REMARK_INTERNET=""
 ALIASES += REMARK_STORAGE=""
 ALIASES += REMARK_RAWVIDEO=""
@@ -391,6 +393,7 @@ ALIASES += REMARK_RAWVIDEO=""
 ## Extra tags for Tizen 4.0
 #ALIASES += SINCE_1_3_4="\par Since:\n 4.0, DALi version 1.3.4"
 #ALIASES += SINCE_1_3_5="\par Since:\n 4.0, DALi version 1.3.5"
+#ALIASES += SINCE_1_3_9="\par Since:\n 4.0, DALi version 1.3.9"
 
 ## DALi has no deprecated API in Tizen 2.4 because it's DALi's first release.
 ## Thus deprecated APIs in DALi 1.0.xx will be deprecated in Tizen 3.0.
@@ -406,6 +409,7 @@ ALIASES += REMARK_RAWVIDEO=""
 #ALIASES += PRIVILEGE_KEYGRAB="\par Privilege:\n http://tizen.org/privilege/keygrab"
 #ALIASES += PRIVILEGE_DISPLAY="\par Privilege:\n http://tizen.org/privilege/display"
 #ALIASES += PRIVILEGE_WINDOW_PRIORITY="\par Privilege:\n http://tizen.org/privilege/window.priority.set"
+#ALIASES += PRIVILEGE_CAPTURE="\par Privilege:\n http://tizen.org/privilege/screenshot"
 #ALIASES += REMARK_INTERNET="@remarks %http://tizen.org/privilege/internet is needed if @a url is a http or https address."
 #ALIASES += REMARK_STORAGE="@remarks %http://tizen.org/privilege/mediastorage is needed if @a url is relevant to media storage. @remarks %http://tizen.org/privilege/externalstorage is needed if @a url is relevant to external storage."
 #ALIASES += REMARK_RAWVIDEO="@remarks %http://tizen.org/feature/multimedia.raw_video is needed if UNDERLAY is false. If the feature isn't supported, UNDERLAY is always true."
index 25dff01..5876633 100644 (file)
@@ -63,6 +63,7 @@ DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "looping", BOOLEAN, LOOPING )
 DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "muted", BOOLEAN, MUTED )
 DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "volume", MAP, VOLUME )
 DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "underlay", BOOLEAN, UNDERLAY )
+DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "playPosition", INTEGER, PLAY_POSITION )
 
 DALI_SIGNAL_REGISTRATION( Toolkit, VideoView, "finished", FINISHED_SIGNAL )
 
@@ -451,6 +452,15 @@ void VideoView::SetProperty( BaseObject* object, Property::Index index, const Pr
         }
         break;
       }
+      case Toolkit::VideoView::Property::PLAY_POSITION:
+      {
+        int pos;
+        if( value.Get( pos ) )
+        {
+          impl.SetPlayPosition( pos );
+        }
+        break;
+      }
     }
   }
 }
@@ -504,6 +514,11 @@ Property::Value VideoView::GetProperty( BaseObject* object, Property::Index prop
         value = impl.IsUnderlay();
         break;
       }
+      case Toolkit::VideoView::Property::PLAY_POSITION:
+      {
+        value = impl.GetPlayPosition();
+        break;
+      }
     }
   }
 
@@ -724,6 +739,30 @@ bool VideoView::IsUnderlay()
   return mIsUnderlay;
 }
 
+void VideoView::SetSWCodec( bool on )
+{
+  // If setting SW or HW type is failed , video-view shows video by default codec type.
+  // The default codec type is selected by platform.
+  if( on )
+  {
+    mVideoPlayer.SetCodecType( Dali::VideoPlayerPlugin::CodecType::SW );
+  }
+  else
+  {
+    mVideoPlayer.SetCodecType( Dali::VideoPlayerPlugin::CodecType::HW );
+  }
+}
+
+int VideoView::GetPlayPosition()
+{
+  return mVideoPlayer.GetPlayPosition();
+}
+
+void VideoView::SetPlayPosition( int pos )
+{
+  mVideoPlayer.SetPlayPosition( pos );
+}
+
 } // namespace Internal
 
 } // namespace toolkit
index 5f85a3f..1f58785 100644 (file)
@@ -224,6 +224,21 @@ public:
    */
   bool IsUnderlay();
 
+  /**
+   * @brief Sets sw codec type.
+   */
+  void SetSWCodec( bool on );
+
+  /**
+   * @brief Gets play position.
+   */
+  int GetPlayPosition();
+
+  /**
+   * @brief Sets play position.
+   */
+  void SetPlayPosition( int pos );
+
 private: // From Control
 
   /**
index 7e0a181..857a55b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/image-loading.h>
+#include <dali/integration-api/adaptors/adaptor.h>
 
 namespace Dali
 {
@@ -56,7 +57,8 @@ void LoadingTask::Load()
 
 
 ImageLoadThread::ImageLoadThread( EventThreadCallback* trigger )
-: mTrigger( trigger )
+: mTrigger( trigger ),
+  mLogFactory( Dali::Adaptor::Get().GetLogFactory() )
 {
 }
 
@@ -72,6 +74,8 @@ ImageLoadThread::~ImageLoadThread()
 
 void ImageLoadThread::Run()
 {
+  mLogFactory.InstallLogFunction();
+
   while( LoadingTask* task = NextTaskToProcess() )
   {
     task->Load();
index 3d0ad24..c3f230c 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_IMAGE_LOAD_THREAD_H__
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -26,6 +26,7 @@
 #include <dali/devel-api/threading/thread.h>
 #include <dali/devel-api/adaptor-framework/event-thread-callback.h>
 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include <dali/integration-api/adaptors/log-factory-interface.h>
 #include <dali-toolkit/internal/visuals/visual-url.h>
 
 namespace Dali
@@ -162,10 +163,11 @@ private:
 
   Vector< LoadingTask* > mLoadQueue;     ///<The task queue with images for loading.
   Vector< LoadingTask* > mCompleteQueue; ///<The task queue with images loaded.
+  EventThreadCallback*   mTrigger;
+  const Dali::LogFactoryInterface& mLogFactory; ///< The log factory
 
   ConditionalWait        mConditionalWait;
   Dali::Mutex            mMutex;
-  EventThreadCallback*   mTrigger;
 };
 
 } // namespace Internal
index 7a0aa1d..e709a58 100644 (file)
@@ -65,6 +65,21 @@ VideoView VideoView::New( const std::string& url )
   return videoView;
 }
 
+VideoView VideoView::New( bool swCodec )
+{
+  VideoView videoView = Internal::VideoView::New();
+  Dali::Toolkit::GetImpl( videoView ).SetSWCodec( swCodec );
+  return videoView;
+}
+
+VideoView VideoView::New( const std::string& url, bool swCodec )
+{
+  VideoView videoView = Internal::VideoView::New();
+  Dali::Toolkit::GetImpl( videoView ).SetUrl( url );
+  Dali::Toolkit::GetImpl( videoView ).SetSWCodec( swCodec );
+  return videoView;
+}
+
 VideoView VideoView::DownCast( BaseHandle handle )
 {
   return Control::DownCast< VideoView, Internal::VideoView >( handle );
index 2d0816b..0933801 100644 (file)
@@ -84,6 +84,8 @@ public:
       /**
        * @brief name "video", video file url as string type or Property::Map.
        * @SINCE_1_1.38
+       * @REMARK_INTERNET
+       * @REMARK_STORAGE
        */
       VIDEO = PROPERTY_START_INDEX,
 
@@ -113,7 +115,14 @@ public:
        * @SINCE_1_2.62
        * @REMARK_RAWVIDEO
        */
-      UNDERLAY
+      UNDERLAY,
+
+     /**
+       * @brief The play position (millisecond) of the video.
+       * @details Name "playPosition", type Property::INTEGER
+       * @SINCE_1_3_9
+       */
+      PLAY_POSITION
     };
   };
 
@@ -124,7 +133,6 @@ public:
    * @SINCE_1_1.38
    * @return A handle to a newly allocated Dali ImageView
    *
-   * @note VideoView will not display anything
    */
   static VideoView New();
 
@@ -141,6 +149,31 @@ public:
   static VideoView New( const std::string& url );
 
   /**
+   * @brief Creates an initialized VideoView.
+   * @SINCE_1_3_9
+   * @param[in] swCodec Video rendering by H/W codec if false
+   * @return A handle to a newly allocated Dali ImageView
+   *
+   * @note If platform or target does not support sw codec, video-view shows an error message and video by default codec type
+   */
+  static VideoView New( bool swCodec );
+
+  /**
+   * @brief Creates an initialized VideoView.
+   * If the string is empty, VideoView will not display anything.
+   *
+   * @SINCE_1_3_9
+   * @REMARK_INTERNET
+   * @REMARK_STORAGE
+   * @param[in] url The url of the video resource to display
+   * @param[in] swCodec Video rendering by H/W codec if false
+   * @return A handle to a newly allocated Dali VideoView
+   *
+   * @note If platform or target does not support sw codec, video-view shows an error message and video by default codec type
+   */
+  static VideoView New( const std::string& url, bool swCodec );
+
+  /**
    * @brief Creates an uninitialized VideoView.
    * @SINCE_1_1.38
    */
index ae7edb7..8861942 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 3;
-const unsigned int TOOLKIT_MICRO_VERSION = 10;
+const unsigned int TOOLKIT_MICRO_VERSION = 11;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 62a490b..1556e26 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    1.3.10
+Version:    1.3.11
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT