Changes after Stage moved to Devel API
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / video-view / video-view-impl.cpp
old mode 100755 (executable)
new mode 100644 (file)
index dfd441b..a0a696a
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 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.
 #include <cstring>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
-#include <dali/public-api/common/stage.h>
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/public-api/adaptor-framework/native-image-source.h>
-#include <dali/integration-api/adaptors/adaptor.h>
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/animation/constraint.h>
 #include <dali/devel-api/actors/actor-devel.h>
@@ -33,6 +31,7 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/video-view/video-view.h>
 #include <dali-toolkit/internal/visuals/visual-factory-cache.h>
+#include <dali/integration-api/adaptor-framework/adaptor.h>
 
 namespace Dali
 {
@@ -611,7 +610,7 @@ void VideoView::SetWindowSurfaceTarget()
 {
   Actor self = Self();
 
-  if( !self.OnStage() )
+  if( !self.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) )
   {
     // When the control is off the stage, it does not have Window.
     return;
@@ -736,11 +735,11 @@ void VideoView::UpdateDisplayArea( Dali::PropertyNotification& source )
 
   Actor self( Self() );
 
-  bool positionUsesAnchorPoint = self.GetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT ).Get< bool >();
-  Vector3 actorSize = self.GetCurrentSize() * self.GetCurrentScale();
-  Vector3 anchorPointOffSet = actorSize * ( positionUsesAnchorPoint ? self.GetCurrentAnchorPoint() : AnchorPoint::TOP_LEFT );
+  bool positionUsesAnchorPoint = self.GetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT ).Get< bool >();
+  Vector3 actorSize = self.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ) * self.GetCurrentProperty< Vector3 >( Actor::Property::SCALE );
+  Vector3 anchorPointOffSet = actorSize * ( positionUsesAnchorPoint ? self.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ) : AnchorPoint::TOP_LEFT );
 
-  Vector2 screenPosition = self.GetProperty( DevelActor::Property::SCREEN_POSITION ).Get< Vector2 >();
+  Vector2 screenPosition = self.GetProperty( Actor::Property::SCREEN_POSITION ).Get< Vector2 >();
 
   mDisplayArea.x = screenPosition.x - anchorPointOffSet.x;
   mDisplayArea.y = screenPosition.y - anchorPointOffSet.y;
@@ -808,6 +807,11 @@ int VideoView::GetDisplayMode() const
   return static_cast< int >( mVideoPlayer.GetDisplayMode() );
 }
 
+Any VideoView::GetMediaPlayer()
+{
+  return mVideoPlayer.GetMediaPlayer();
+}
+
 Dali::Shader VideoView::CreateShader()
 {
   std::string fragmentShader = "#extension GL_OES_EGL_image_external:require\n";