Added APIs for codec in video-player 70/167370/11
authortaeyoon0.lee <taeyoon0.lee@samsung.com>
Mon, 22 Jan 2018 09:31:38 +0000 (18:31 +0900)
committertaeyoon0.lee <taeyoon0.lee@samsung.com>
Thu, 1 Feb 2018 11:06:53 +0000 (20:06 +0900)
Change-Id: I76c7dacc1bc55e6c06552bf136bc3edba4081158

dali/devel-api/adaptor-framework/video-player-plugin.h
dali/devel-api/adaptor-framework/video-player.cpp
dali/devel-api/adaptor-framework/video-player.h
dali/internal/video/common/video-player-impl.cpp
dali/internal/video/common/video-player-impl.h

index f1c309b..524200a 100644 (file)
@@ -53,6 +53,16 @@ public:
   };
 
   /**
+   * @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 Constructor.
    * @SINCE_1_1.38
    */
@@ -215,8 +225,19 @@ public:
    * @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;
 };
 
 } // namespace Dali;
index 4668f21..768c7e4 100644 (file)
@@ -171,10 +171,20 @@ void VideoPlayer::Backward( int millisecond )
   GetImplementation( *this ).Backward( millisecond );
 }
 
-bool VideoPlayer::IsVideoTextureSupported() const
+bool VideoPlayer::IsVideoTextureSupported()
 {
   return GetImplementation( *this ).IsVideoTextureSupported();
 }
 
+void VideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type )
+{
+  GetImplementation( *this ).SetCodecType( type );
+}
+
+Dali::VideoPlayerPlugin::CodecType VideoPlayer::GetCodecType() const
+{
+  return GetImplementation( *this ).GetCodecType();
+}
+
 } // namespace Dali;
 
index 79efe22..b809038 100644 (file)
@@ -245,7 +245,19 @@ public:
    * @brief Checks whether the video texture is supported
    * @return True if supported, otherwise false.
    */
-  bool IsVideoTextureSupported() const;
+  bool IsVideoTextureSupported();
+
+  /**
+   * @brief Sets codec type
+   * @param[in] type The VideoCodec::Type
+   */
+  void SetCodecType( Dali::VideoPlayerPlugin::CodecType type );
+
+  /**
+   * @brief Gets codec type
+   * @return VideoCodec::Type
+   */
+  Dali::VideoPlayerPlugin::CodecType GetCodecType() const;
 
 private: // Not intended for application developers
 
index 8c1a279..c2e911f 100644 (file)
@@ -289,7 +289,7 @@ void VideoPlayer::Backward( int millisecond )
   }
 }
 
-bool VideoPlayer::IsVideoTextureSupported() const
+bool VideoPlayer::IsVideoTextureSupported()
 {
   if( mPlugin != NULL )
   {
@@ -299,6 +299,24 @@ bool VideoPlayer::IsVideoTextureSupported() const
   return false;
 }
 
+void VideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type )
+{
+  if( mPlugin != NULL )
+  {
+    mPlugin->SetCodecType( type );
+  }
+}
+
+Dali::VideoPlayerPlugin::CodecType VideoPlayer::GetCodecType() const
+{
+  if( mPlugin != NULL )
+  {
+    return mPlugin->GetCodecType();
+  }
+
+  return Dali::VideoPlayerPlugin::CodecType::DEFAULT;
+}
+
 } // namespace Adaptor;
 } // namespace Internal;
 } // namespace Dali;
index 273adcd..c73e00d 100644 (file)
@@ -162,7 +162,17 @@ public:
   /**
    * @brief Dali::VideoPlayer::IsVideoTextureSupported()
    */
-  bool IsVideoTextureSupported() const;
+  bool IsVideoTextureSupported();
+
+  /**
+   * @brief Dali::VideoPlayer::SetCodecType()
+   */
+  void SetCodecType( Dali::VideoPlayerPlugin::CodecType type );
+
+  /**
+   * @brief Dali::VideoPlayer::GetCodecType()
+   */
+  Dali::VideoPlayerPlugin::CodecType GetCodecType() const;
 
 private: