Fix compile error. Non initialized variable.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / video-view / video-view-impl.h
old mode 100644 (file)
new mode 100755 (executable)
index d5a498a..7ee0380
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_VIDEO_VIEW_H
 
 /*
- * Copyright (c) 2016 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.
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/property-map.h>
-#include <dali/public-api/images/native-image.h>
+#include <dali/public-api/object/property-notification.h>
+#include <dali/public-api/object/property-conditions.h>
+#include <dali/public-api/rendering/renderer.h>
+#include <dali/public-api/images/image-operations.h>
+#include <dali/public-api/rendering/texture.h>
 #include <dali/devel-api/adaptor-framework/video-player.h>
-#include <dali/integration-api/adaptors/trigger-event-factory.h>
+#include <dali/integration-api/adaptor-framework/trigger-event-factory.h>
+#include <dali/devel-api/adaptor-framework/video-sync-mode.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/internal/visuals/image/image-visual.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/video-view/video-view.h>
 
@@ -44,16 +48,16 @@ class VideoView: public Control
 {
 protected:
 
-  VideoView();
+  VideoView( Dali::VideoSyncMode syncMode );
 
   virtual ~VideoView();
 
 public:
 
   /**
-   * @copydoc Toolkit::VideoView::New()
+   * @copydoc Toolkit::DevelVideoView::New()
    */
-  static Toolkit::VideoView New();
+  static Toolkit::VideoView New( VideoSyncMode syncMode );
 
   /**
    * @brief Sets a video url to play.
@@ -210,7 +214,7 @@ public:
   /**
    * @brief Updates video display area for window rendering target
    */
-  void UpdateDisplayArea();
+  void UpdateDisplayArea( Dali::PropertyNotification& source );
 
   /**
    * @brief Sets underlay flag and initializes new rendering target by flag.
@@ -222,6 +226,47 @@ 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 );
+
+  /**
+   * @brief Sets Display mode.
+   */
+  void SetDisplayMode( int mode );
+
+  /**
+   * @brief Gets Display mode.
+   */
+  int GetDisplayMode() const;
+
+  /**
+   * @brief Gets internal media player.
+   */
+  Any GetMediaPlayer();
+
+  /**
+   * @brief Play the resize or move animation with synchronization between UI(transparent hole) and video player
+   *
+   * The resize and move animation's play() function is called.
+   * If the animation is played, UI and video player will work synchronization.
+   *
+   * @param[in] videoView The current VideoView
+   * @param[in] animation The animation for video view's resize or move.
+   */
+  void PlayAnimation( Dali::Animation animation );
+
 private: // From Control
 
   /**
@@ -230,14 +275,19 @@ private: // From Control
   virtual void OnInitialize();
 
   /**
-   * @copydoc Toolkit::Control::OnStageConnect()
+   * @copydoc Toolkit::Control::OnSceneConnection()
+   */
+  virtual void OnSceneConnection( int depth );
+
+  /**
+   * @copydoc Toolkit::Control::OnSceneDisconnection()
    */
-  virtual void OnStageConnection( int depth );
+  virtual void OnSceneDisconnection();
 
   /**
-   * @copydoc Toolkit::Control::OnStageDisconnection()
+   * @copydoc Toolkit::Control::OnSizeSet()
    */
-  virtual void OnStageDisconnection();
+  virtual void OnSizeSet( const Vector3& targetSize );
 
   /**
    * @copydoc Toolkit::Control::GetNaturalSize
@@ -256,34 +306,97 @@ private: // From Control
 
 private:
 
-  // Undefined
+  /**
+   * @brief Construct a new VideoView.
+   */
   VideoView( const VideoView& videoView );
 
+  // Undefined assignment operator.
   VideoView& operator=( const VideoView& videoView );
 
+  /**
+   * @brief SetWindowSurfaceTarget for underlay video playback.
+   */
   void SetWindowSurfaceTarget();
 
+  /**
+   * @brief SetNativeImageTarget for native image video playback.
+   */
   void SetNativeImageTarget();
 
+  /**
+   * @brief CreateShader for native image target
+   */
+  Dali::Shader CreateShader();
+
+  /**
+   * @brief Checks whether the property has a string value.
+   * @param Property value
+   * @param String output
+   * @return true if the output was found
+   */
+  bool GetStringFromProperty( const Dali::Property::Value& value, std::string& output );
+
+  /*
+   * @brief Internal version of SetProperty
+   */
+  void SetPropertyInternal( Property::Index index, const Property::Value& value );
+
+  /*
+   * @brief Apply properties after reset video player
+   */
+  void ApplyBackupProperties();
+
+  /*
+   * @brief FrameRender's callback function
+   *
+   * This function means the resize/move animation is finished,
+   * so Ui and video player's synchronization can be finished.
+   *
+   */
+  void FrameRenderCallback( int frameID );
+
+  /*
+   * @brief Set frameRender Callback function
+   *
+   * This function is added for listenr the resize/move animation is finished,
+   *
+   */
+  void SetFrameRenderCallback();
+
+
+  /*
+   * @brief resize/move animation finished callback function
+   *
+   * This function is called the resize/move animation is finished,
+   *
+   */
+  void OnAnimationFinished( Dali::Animation& animation );
+
 private:
 
   Dali::VideoPlayer mVideoPlayer;
   Dali::ImageDimensions mVideoSize;
-  Toolkit::Visual::Base mVisual;
   Dali::Property::Map mPropertyMap;
-  Dali::NativeImage mNativeImage; ///< Native image handle for video rendering by texture streaming
+  Dali::Property::Map mEffectPropertyMap;
+  Dali::Texture mNativeTexture;
   Dali::Toolkit::VideoView::VideoViewSignalType mFinishedSignal;
   std::string mUrl;
   Dali::DisplayArea mDisplayArea;
-  Dali::Renderer mRenderer;
-
-  Property::Index mUpdateTriggerPropertyIndex;
-  TriggerEventInterface* mNotification;
+  Dali::Renderer mOverlayRenderer;
+  Dali::Renderer mTextureRenderer;
+  Dali::PropertyNotification mPositionUpdateNotification;
+  Dali::PropertyNotification mSizeUpdateNotification;
+  Dali::PropertyNotification mScaleUpdateNotification;
+  Dali::Property::Map mPropertyBackup;
 
   int mCurrentVideoPlayPosition;
+  int mFrameID;
+
   bool mIsPlay;
-  bool mIsPause;
   bool mIsUnderlay;
+
+  Dali::VideoSyncMode mSyncMode;
 };
 
 } // namespace Internal