Change common test application
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-video-player.cpp
index eee723b..6e539eb 100644 (file)
  *
  */
 
-// CLASS HEADER
-#include "toolkit-video-player.h"
-
-// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/video-player.h>
 #include <dali/public-api/object/any.h>
+#include <dali/public-api/object/base-object.h>
+#include <toolkit-application.h>
 
 namespace Dali
 {
@@ -38,6 +37,7 @@ public:
   {
     mMuted = false;
     mLooping = false;
+    mPlayPosition = 0;
   }
 
   void SetMuted( bool muted )
@@ -60,6 +60,24 @@ public:
     return mLooping;
   }
 
+  void Stop()
+  {
+    if( !mFinishedSignal.Empty() )
+    {
+      mFinishedSignal.Emit();
+    }
+  }
+
+  int GetPlayPosition()
+  {
+    return mPlayPosition;
+  }
+
+  void SetPlayPosition( int pos )
+  {
+    mPlayPosition = pos;
+  }
+
 public:
 
   std::string mUrl;
@@ -71,6 +89,7 @@ private:
 
   bool mMuted;
   bool mLooping;
+  int mPlayPosition;
 };
 
 inline VideoPlayer& GetImplementation( Dali::VideoPlayer& player )
@@ -163,6 +182,7 @@ void VideoPlayer::Pause()
 
 void VideoPlayer::Stop()
 {
+  Internal::Adaptor::GetImplementation( *this ).Stop();
 }
 
 void VideoPlayer::SetMute( bool mute )
@@ -193,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 )
@@ -226,5 +247,19 @@ void VideoPlayer::Backward( int millisecond )
 {
 }
 
+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;