-#ifndef __DALI_VIDEO_PLAYER_H__
-#define __DALI_VIDEO_PLAYER_H__
+#ifndef DALI_VIDEO_PLAYER_H
+#define DALI_VIDEO_PLAYER_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/devel-api/adaptor-framework/video-sync-mode.h>
#include <dali/public-api/object/base-handle.h>
//INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/video-player-plugin.h>
+#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
{
-
class Any;
namespace Internal
{
-
namespace Adaptor
{
- class VideoPlayer;
+class VideoPlayer;
} // namespace Adaptor
} // namespace Internal
* @brief VideoPlayer class is used for video playback.
* @SINCE_1_1.38
*/
-class DALI_IMPORT_API VideoPlayer: public BaseHandle
+class DALI_ADAPTOR_API VideoPlayer : public BaseHandle
{
public:
-
/**
* @brief Constructor.
* @SINCE_1_1.38
*/
static VideoPlayer New();
- /**
+ /**
+ * @brief Creates a new instance of a VideoPlayer.
+ *
+ * If you want the video player works with Ui synchronous when video player is resized/moved,
+ * put the video view actor and the enabled syncMode.
+ *
+ * @param[in] actor video view's actor instance
+ * @param[in] syncMode The synchronization mode between the UI (transparent hole) and VideoPlayer.
+ */
+ static VideoPlayer New(Dali::Actor actor, VideoSyncMode syncMode);
+
+ /**
* @brief Copy constructor.
*
* @SINCE_1_1.38
* @param[in] player VideoPlayer to copy. The copied player will point at the same implementation
*/
- VideoPlayer( const VideoPlayer& player );
+ VideoPlayer(const VideoPlayer& player);
- /**
+ /**
* @brief Assignment operator.
*
* @SINCE_1_1.38
* @param[in] player The VideoPlayer to assign from.
* @return The updated VideoPlayer.
*/
- VideoPlayer& operator=( const VideoPlayer& player );
+ VideoPlayer& operator=(const VideoPlayer& player);
/**
* @brief Downcast a handle to VideoPlayer handle.
* @param[in] handle Handle to an object
* @return Handle to a VideoPlayer or an uninitialized handle
*/
- static VideoPlayer DownCast( BaseHandle handle );
+ static VideoPlayer DownCast(BaseHandle handle);
/**
* @brief Sets a URL of the video file to play.
* @SINCE_1_1.38
* @param [in] url The url of video file
*/
- void SetUrl( const std::string& url );
+ void SetUrl(const std::string& url);
/**
* @brief Returns the URL of the video file.
* @SINCE_1_1.38
* @param[in] mute The new mute status, true is mute.
*/
- void SetMute( bool mute );
+ void SetMute(bool mute);
/**
* @brief Returns the player mute status.
* @param[in] left The left volume scalar
* @param[in] right The right volume scalar
*/
- void SetVolume( float left, float right );
+ void SetVolume(float left, float right);
/**
* @brief Returns current volume factor.
* @param[out] left The current left volume scalar
* @param[out] right The current right volume scalar
*/
- void GetVolume( float& left, float& right );
+ void GetVolume(float& left, float& right);
/**
* @brief Sets video rendering target.
* @SINCE_1_1.38
* @param[in] target The target for video rendering, window surface or native image source
*/
- void SetRenderingTarget( Any target );
+ void SetRenderingTarget(Any target);
/**
* @brief Sets the position for playback.
*
* @param[in] millisecond The position for playback
*/
- void SetPlayPosition( int millisecond );
+ void SetPlayPosition(int millisecond);
/**
* @brief Gets the current position in milliseconds.
* @SINCE_1_2.46
* param[in] area The left-top position and size of the video display area
*/
- void SetDisplayArea( DisplayArea area );
+ void SetDisplayArea(DisplayArea area);
/**
* @brief Sets video display rotation
* @SINCE_1_1.38
* @param[in] rotation The rotation of display
*/
- void SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation );
+ void SetDisplayRotation(Dali::VideoPlayerPlugin::DisplayRotation rotation);
/**
* @brief Returns rotation of current video display
* @SINCE_1_2.46
* @param[in] millisecond The position for forward playback
*/
- void Forward( int millisecond );
+ void Forward(int millisecond);
/**
* @brief Seeks backward by the specified number of milliseconds.
* @SINCE_1_2.46
* @param[in] millisecond The position for backward playback
*/
- void Backward( int millisecond );
+ void Backward(int millisecond);
/**
* @brief Checks whether the video texture is supported
* @brief Sets codec type
* @param[in] type The VideoCodec::Type
*/
- void SetCodecType( Dali::VideoPlayerPlugin::CodecType type );
+ void SetCodecType(Dali::VideoPlayerPlugin::CodecType type);
/**
* @brief Gets codec type
* @brief Sets the display mode for playback.
* @param[in] mode of playback
*/
- void SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode );
+ void SetDisplayMode(Dali::VideoPlayerPlugin::DisplayMode::Type mode);
/**
* @brief Gets display mode
*/
Dali::VideoPlayerPlugin::DisplayMode::Type GetDisplayMode() const;
-private: // Not intended for application developers
+ /**
+ * @brief Gets the media player of video player
+ * @return player The media player
+ */
+ Any GetMediaPlayer();
+
+ /**
+ * @brief calls synchronization function in window system
+ * This function is called, the synchronization is started between UI(transparent hole) and video player.
+ */
+ void StartSynchronization();
/**
+ * @brief calls desynchronization function in window system
+ * This function is called, the synchronization is ended between UI(transparent hole) and video player.
+ */
+ void FinishSynchronization();
+
+private: // Not intended for application developers
+ /**
* @brief Internal constructor
* @SINCE_1_1.38
*/
- explicit DALI_INTERNAL VideoPlayer( Internal::Adaptor::VideoPlayer* internal );
+ explicit DALI_INTERNAL VideoPlayer(Internal::Adaptor::VideoPlayer* internal);
};
-} // namespace Dali;
-
-#endif
+} // namespace Dali
+#endif // DALI_VIDEO_PLAYER_H