Revert "[Tizen] Use broken image when animated image loading is failed."
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / video-player-plugin.h
index f1c309b..3679e63 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_VIDEO_PLAYER_PLUGIN_H__
-#define __DALI_VIDEO_PLAYER_PLUGIN_H__
+#ifndef DALI_VIDEO_PLAYER_PLUGIN_H
+#define DALI_VIDEO_PLAYER_PLUGIN_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/signals/dali-signal.h>
+#include <dali/public-api/actors/actor.h>
 #include <dali/public-api/math/rect.h>
+#include <dali/public-api/signals/dali-signal.h>
 
 namespace Dali
 {
-
 class Any;
-typedef Dali::Rect< int > DisplayArea;
+typedef Dali::Rect<int> DisplayArea;
 
 /**
  * @brief VideoPlayerPlugin is an abstract interface, used by dali-adaptor to access video player plugin.
@@ -36,8 +36,7 @@ typedef Dali::Rect< int > DisplayArea;
 class VideoPlayerPlugin
 {
 public:
-
-  typedef Signal< void () > VideoPlayerSignalType;
+  typedef Signal<void()> VideoPlayerSignalType;
 
   /**
    * @brief Video display rotation option
@@ -46,23 +45,53 @@ public:
    */
   enum DisplayRotation
   {
-    ROTATION_NONE,   ///< Display isn't rotated. @SINCE_1_1.38
-    ROTATION_90,     ///< Display is rotated 90 degree. @SINCE_1_1.38
-    ROTATION_180,    ///< Display is rotated 180 degree. @SINCE_1_1.38
-    ROTATION_270     ///< Display is rotated 270 degree. @SINCE_1_1.38
+    ROTATION_NONE, ///< Display isn't rotated. @SINCE_1_1.38
+    ROTATION_90,   ///< Display is rotated 90 degree. @SINCE_1_1.38
+    ROTATION_180,  ///< Display is rotated 180 degree. @SINCE_1_1.38
+    ROTATION_270   ///< Display is rotated 270 degree. @SINCE_1_1.38
+  };
+
+  /**
+   * @brief Enumeration for video codec type
+   */
+  enum class CodecType
+  {
+    DEFAULT, ///< Codec which has higher priority as default. Platform selects it. Usually the H/W codec has higher priority than S/W codec if it exist.
+    HW,      ///< H/W codec
+    SW       ///< S/W codec
+  };
+
+  /**
+   * @brief The values of this enum determine how the video should be display mode to the view
+   */
+  struct DisplayMode
+  {
+    enum Type
+    {
+      LETTER_BOX = 0,   /**< Letter box */
+      ORIGIN_SIZE,      /**< Origin size */
+      FULL_SCREEN,      /**< Full-screen */
+      CROPPED_FULL,     /**< Cropped full-screen */
+      ORIGIN_OR_LETTER, /**< Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size) */
+      DST_ROI           /**< Region of Interest */
+    };
   };
 
   /**
    * @brief Constructor.
    * @SINCE_1_1.38
    */
-  VideoPlayerPlugin(){}
+  VideoPlayerPlugin()
+  {
+  }
 
   /**
    * @brief Destructor.
    * @SINCE_1_1.38
    */
-  virtual ~VideoPlayerPlugin(){}
+  virtual ~VideoPlayerPlugin()
+  {
+  }
 
   /**
    * @brief Sets a URL of the video file to play.
@@ -70,7 +99,7 @@ public:
    * @SINCE_1_1.38
    * @param [in] url The url of video file
    */
-  virtual void SetUrl( const std::string& url ) = 0;
+  virtual void SetUrl(const std::string& url) = 0;
 
   /**
    * @brief Returns the URL of the video file.
@@ -118,7 +147,7 @@ public:
    * @SINCE_1_1.38
    * @param[in] mute The new mute status, true is mute.
    */
-  virtual void SetMute( bool mute ) = 0;
+  virtual void SetMute(bool mute) = 0;
 
   /**
    * @brief Returns the player mute status.
@@ -133,7 +162,7 @@ public:
    * @param[in] left The left volume scalar
    * @param[in] right The right volume scalar
    */
-  virtual void SetVolume( float left, float right ) = 0;
+  virtual void SetVolume(float left, float right) = 0;
 
   /**
    * @brief Gets current volume factor.
@@ -141,14 +170,14 @@ public:
    * @param[out] left The current left volume scalar
    * @param[out] right The current right volume scalar
    */
-  virtual void GetVolume( float& left, float& right ) = 0;
+  virtual void GetVolume(float& left, float& right) = 0;
 
   /**
    * @brief Sets video rendering target.
    * @SINCE_1_1.38
    * @param[in] target The target for video rendering, window surface or native image source
    */
-  virtual void SetRenderingTarget( Any target ) = 0;
+  virtual void SetRenderingTarget(Any target) = 0;
 
   /**
    * @brief Sets the position for playback.
@@ -156,7 +185,7 @@ public:
    *
    * @param[in] millisecond The position for playback
    */
-  virtual void SetPlayPosition( int millisecond ) = 0;
+  virtual void SetPlayPosition(int millisecond) = 0;
 
   /**
    * @brief Returns the current position in milliseconds.
@@ -171,14 +200,14 @@ public:
    * @SINCE_1_2.46
    * param[in] area The left-top position and size of the video display area
    */
-  virtual void SetDisplayArea( DisplayArea area ) = 0;
+  virtual void SetDisplayArea(DisplayArea area) = 0;
 
   /**
    * @brief Sets video display rotation
    * @SINCE_1_1.38
    * @param[in] rotation The rotation of display
    */
-  virtual void SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation ) = 0;
+  virtual void SetDisplayRotation(Dali::VideoPlayerPlugin::DisplayRotation rotation) = 0;
 
   /**
    * @brief Returns rotation of current video display
@@ -201,7 +230,7 @@ public:
    * @SINCE_1_2.46
    * @param[in] millisecond The position for forward playback
    */
-  virtual void Forward( int millisecond ) = 0;
+  virtual void Forward(int millisecond) = 0;
 
   /**
    * @brief Seeks backward by the specified number of milliseconds.
@@ -209,16 +238,57 @@ public:
    * @SINCE_1_2.46
    * @param[in] millisecond The position for backward playback
    */
-  virtual void Backward( int millisecond ) = 0;
+  virtual void Backward(int millisecond) = 0;
 
   /**
    * @brief Checks whether the video texture is supported
    * @return True if supported, otherwise false.
    */
-  virtual bool IsVideoTextureSupported() const = 0;
+  virtual bool IsVideoTextureSupported() = 0;
+
+  /**
+   * @brief Sets codec type
+   * @param[in] type The CodecType
+   */
+  virtual void SetCodecType(VideoPlayerPlugin::CodecType type) = 0;
+
+  /**
+   * @brief Gets codec type
+   * @return CodecType
+   */
+  virtual VideoPlayerPlugin::CodecType GetCodecType() const = 0;
+
+  /**
+   * @brief Sets the display mode for playback.
+   * @param[in] mode of playback
+   */
+  virtual void SetDisplayMode(VideoPlayerPlugin::DisplayMode::Type mode) = 0;
+
+  /**
+   * @brief Returns the current display mode.
+   * @return The current display mode of playback
+   */
+  virtual VideoPlayerPlugin::DisplayMode::Type GetDisplayMode() const = 0;
 
+  /**
+   * @brief Returns the current internal media player.
+   * @return The current internal media player of video player
+   */
+  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;
+} // namespace Dali
 
-#endif
+#endif // DALI_VIDEO_PLAYER_PLUGIN_H