[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / video-view / video-view-impl.cpp
index 509426e..5fa13de 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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/actors/actor-devel.h>
 #include <dali/devel-api/adaptor-framework/window-devel.h>
+#include <dali/devel-api/rendering/texture-devel.h>
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/adaptor-framework/native-image-source.h>
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/rendering/texture-devel.h>
 #include <cstring>
 
 // INTERNAL INCLUDES
@@ -118,10 +118,9 @@ void VideoView::OnInitialize()
   Actor self = Self();
   mVideoPlayer.FinishedSignal().Connect(this, &VideoView::EmitSignalFinish);
 
-  DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
-    return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::VIDEO));
-  });
+  // Accessibility
+  self.SetProperty(DevelControl::Property::ACCESSIBILITY_ROLE, Dali::Accessibility::Role::VIDEO);
+  self.SetProperty(DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, true);
 
   //update self property
   self.RegisterProperty(IS_VIDEO_VIEW_PROPERTY_NAME, true, Property::READ_WRITE);
@@ -605,30 +604,6 @@ Vector3 VideoView::GetNaturalSize()
   }
 }
 
-float VideoView::GetHeightForWidth(float width)
-{
-  if(mVideoSize.GetWidth() > 0 && mVideoSize.GetHeight() > 0)
-  {
-    return GetHeightForWidthBase(width);
-  }
-  else
-  {
-    return Control::GetHeightForWidthBase(width);
-  }
-}
-
-float VideoView::GetWidthForHeight(float height)
-{
-  if(mVideoSize.GetWidth() > 0 && mVideoSize.GetHeight() > 0)
-  {
-    return GetWidthForHeightBase(height);
-  }
-  else
-  {
-    return Control::GetWidthForHeightBase(height);
-  }
-}
-
 void VideoView::SetWindowSurfaceTarget()
 {
   Actor self = Self();
@@ -670,7 +645,7 @@ void VideoView::SetWindowSurfaceTarget()
   {
     // For underlay rendering mode, video display area have to be transparent.
     Geometry geometry = VisualFactoryCache::CreateQuadGeometry();
-    Shader   shader   = Shader::New(SHADER_VIDEO_VIEW_VERT, SHADER_VIDEO_VIEW_FRAG);
+    Shader   shader   = Shader::New(SHADER_VIDEO_VIEW_VERT, SHADER_VIDEO_VIEW_FRAG, Shader::Hint::NONE, "VIDEO_VIEW_OVERLAY");
     mOverlayRenderer  = Renderer::New(geometry, shader);
     mOverlayRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::OFF);
   }
@@ -912,7 +887,7 @@ Dali::Shader VideoView::CreateShader()
     DevelTexture::ApplyNativeFragmentShader(mNativeTexture, fragmentShader);
   }
 
-  return Dali::Shader::New(vertexShader, fragmentShader);
+  return Dali::Shader::New(vertexShader, fragmentShader, Shader::Hint::NONE, "VIDEO_VIEW");
 }
 
 bool VideoView::GetStringFromProperty(const Dali::Property::Value& value, std::string& output)