}
+ void RaiseAbove(Dali::VideoPlayer target)
+ {
+
+ }
+
+ void LowerBelow(Dali::VideoPlayer target)
+ {
+
+ }
+
+ void RaiseToTop()
+ {
+
+ }
+
+ void LowerToBottom()
+ {
+
+ }
+
public:
std::string mUrl;
Internal::Adaptor::GetImplementation( *this ).FinishSynchronization();
}
+void VideoPlayer::RaiseAbove(Dali::VideoPlayer target)
+{
+ Internal::Adaptor::GetImplementation( *this ).RaiseAbove(target);
+}
+
+void VideoPlayer::LowerBelow(Dali::VideoPlayer target)
+{
+ Internal::Adaptor::GetImplementation( *this ).LowerBelow(target);
+}
+
+void VideoPlayer::RaiseToTop()
+{
+ Internal::Adaptor::GetImplementation( *this ).RaiseToTop();
+}
+
+void VideoPlayer::LowerToBottom()
+{
+ Internal::Adaptor::GetImplementation( *this ).LowerToBottom();
+}
+
} // namespace Dali;
END_TEST;
}
+int UtcDaliVideoViewRaiseAboveLowerBelow(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliVideoViewRaiseAboveLowerBelow");
+
+ VideoView view = VideoView::New( true );
+ DALI_TEST_CHECK( view );
+
+ application.GetScene().Add( view );
+ view.Play();
+
+ application.SendNotification();
+ application.Render();
+
+ VideoView view2 = VideoView::New( "", false );
+ DALI_TEST_CHECK( view2 );
+
+ application.GetScene().Add( view2 );
+ view2.Play();
+
+ application.SendNotification();
+ application.Render();
+
+ view.RaiseAbove(view2);
+ view.LowerBelow(view2);
+
+ END_TEST;
+}
+
+int UtcDaliVideoViewRaiseTopLowerBottom(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliVideoViewRaiseTopLowerBottom");
+
+ VideoView view = VideoView::New( true );
+ DALI_TEST_CHECK( view );
+
+ application.GetScene().Add( view );
+ view.Play();
+
+ application.SendNotification();
+ application.Render();
+
+ VideoView view2 = VideoView::New( "", false );
+ DALI_TEST_CHECK( view2 );
+
+ application.GetScene().Add( view2 );
+ view2.Play();
+
+ application.SendNotification();
+ application.Render();
+
+ view.RaiseToTop();
+ view.LowerToBottom();
+
+ END_TEST;
+}
+
+
int UtcDaliVideoViewPropertyDisplayMode(void)
{
ToolkitTestApplication application;
const char* const DEFAULT_SAMPLER_TYPE_NAME("sampler2D");
const char* const CUSTOM_SAMPLER_TYPE_NAME("samplerExternalOES");
+const char* const IS_VIDEO_VIEW_PROPERTY_NAME = "isVideoView";
+
} // namespace
VideoView::VideoView(Dali::VideoSyncMode syncMode)
mFrameID(0),
mIsPlay(false),
mIsUnderlay(true),
- mSyncMode(syncMode)
+ mSyncMode(syncMode),
+ mSiblingOrder(0)
{
}
void VideoView::OnInitialize()
{
+ Actor self = Self();
mVideoPlayer.FinishedSignal().Connect(this, &VideoView::EmitSignalFinish);
- DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
+ DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::VIDEO));
});
+
+ //update self property
+ self.RegisterProperty(IS_VIDEO_VIEW_PROPERTY_NAME, true, Property::READ_WRITE);
}
void VideoView::SetUrl(const std::string& url)
void VideoView::OnSceneConnection(int depth)
{
- Control::OnSceneConnection(depth);
-
+ Actor self = Self();
if(mIsUnderlay)
{
+ mSiblingOrder = self.GetProperty<int>(Dali::DevelActor::Property::SIBLING_ORDER);
+ DevelActor::ChildOrderChangedSignal(self.GetParent()).Connect(this, &VideoView::OnChildOrderChanged);
SetWindowSurfaceTarget();
}
+
+ Control::OnSceneConnection(depth);
}
void VideoView::OnSceneDisconnection()
Control::OnSizeSet(targetSize);
}
+void VideoView::OnChildOrderChanged(Actor actor)
+{
+ Actor self = Self();
+ int currentSiblingOrder = self.GetProperty<int>(Dali::DevelActor::Property::SIBLING_ORDER);
+ if(currentSiblingOrder != mSiblingOrder)
+ {
+ Actor parent = self.GetParent();
+ Actor child;
+ Actor upper;
+ Actor lower;
+
+ int numChildren = static_cast<int>(parent.GetChildCount());
+ for(int i = 0; i < numChildren; i++)
+ {
+ child = parent.GetChildAt(i);
+ if(!IsVideoView(child))
+ {
+ continue;
+ }
+
+ if(child == self)
+ {
+ continue;
+ }
+
+ if(i < currentSiblingOrder)
+ {
+ lower = child;
+ }
+ else if(i > currentSiblingOrder)
+ {
+ upper = child;
+ break;
+ }
+ }
+
+ if(lower)
+ {
+ Toolkit::VideoView lowerView = Toolkit::VideoView::DownCast(lower);
+ mVideoPlayer.RaiseAbove(GetImpl(lowerView).GetVideoPlayer());
+ }
+
+ if(upper)
+ {
+ Toolkit::VideoView upperView = Toolkit::VideoView::DownCast(upper);
+ mVideoPlayer.LowerBelow(GetImpl(upperView).GetVideoPlayer());
+ }
+ mSiblingOrder = currentSiblingOrder;
+ }
+}
+
Vector3 VideoView::GetNaturalSize()
{
Vector3 size;
mFrameID);
}
+bool VideoView::IsVideoView(Actor actor) const
+{
+ // Check whether the actor is a VideoView
+ bool isVideoView = false;
+
+ if(actor)
+ {
+ Property::Index propertyIsVideoView = actor.GetPropertyIndex(IS_VIDEO_VIEW_PROPERTY_NAME);
+ if(propertyIsVideoView != Property::INVALID_INDEX)
+ {
+ isVideoView = actor.GetProperty<bool>(propertyIsVideoView);
+ }
+ }
+
+ return isVideoView;
+}
+
+VideoPlayer VideoView::GetVideoPlayer()
+{
+ return mVideoPlayer;
+}
+
} // namespace Internal
} // namespace Toolkit
*/
void PlayAnimation(Dali::Animation animation);
+ /**
+ * @brief Checks whether the actor is set as a video view or not.
+ *
+ * @param[in] actor The actor to be checked
+ * @return True if actor is video view.
+ */
+ bool IsVideoView(Actor actor) const;
+
+ /**
+ * @brief Gets the Video Player.
+ *
+ * @return The return of video player.
+ */
+ VideoPlayer GetVideoPlayer();
+
private: // From Control
/**
* @copydoc Toolkit::Control::OnInitialize()
*/
void OnWindowResized(Dali::Window winHandle, Dali::Window::WindowSize size);
+ /**
+ * @brief This signal is emitted when an actor's children change their sibling order
+ *
+ * @param[in] actor parent actor.
+ */
+ void OnChildOrderChanged(Actor actor);
+
private:
Dali::VideoPlayer mVideoPlayer;
Dali::ImageDimensions mVideoSize;
bool mIsUnderlay;
Dali::VideoSyncMode mSyncMode;
+ int mSiblingOrder;
};
} // namespace Internal