[AT-SPI] Fix role setting
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / video-view / video-view-impl.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 2e34f27..6956cb2
@@ -33,6 +33,7 @@
 #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>
+#include <dali-toolkit/internal/controls/control/control-data-impl.h>
 
 namespace Dali
 {
@@ -88,7 +89,7 @@ const char* const CUSTOM_SAMPLER_TYPE_NAME( "samplerExternalOES" );
 const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
   attribute mediump vec2 aPosition;\n
   uniform highp   mat4 uMvpMatrix;\n
-  uniform mediump vec3 uSize;\n
+  uniform highp   vec3 uSize;\n
   \n
   void main()\n
   {\n
@@ -110,7 +111,7 @@ const char* VERTEX_SHADER_TEXTURE = DALI_COMPOSE_SHADER(
   attribute mediump vec2 aPosition;\n
   varying mediump vec2 vTexCoord;\n
   uniform highp   mat4 uMvpMatrix;\n
-  uniform mediump vec3 uSize;\n
+  uniform highp   vec3 uSize;\n
   varying mediump vec2 sTexCoordRect;\n
   void main()\n
   {\n
@@ -158,6 +159,11 @@ Toolkit::VideoView VideoView::New( VideoSyncMode syncMode )
 void VideoView::OnInitialize()
 {
   mVideoPlayer.FinishedSignal().Connect( this, &VideoView::EmitSignalFinish );
+
+  DevelControl::SetAccessibilityConstructor( Self(), []( Dali::Actor actor ) {
+    return std::unique_ptr< Dali::Accessibility::Accessible >(
+      new Control::Impl::AccessibleImpl( actor, Dali::Accessibility::Role::VIDEO ));
+  } );
 }
 
 void VideoView::SetUrl( const std::string& url )
@@ -228,11 +234,6 @@ bool VideoView::IsLooping()
 
 void VideoView::Play()
 {
-  if( mOverlayRenderer )
-  {
-    Self().AddRenderer( mOverlayRenderer );
-  }
-
   mVideoPlayer.Play();
   mIsPlay = true;
 }
@@ -295,11 +296,6 @@ Dali::Toolkit::VideoView::VideoViewSignalType& VideoView::FinishedSignal()
 
 void VideoView::EmitSignalFinish()
 {
-  if( mOverlayRenderer )
-  {
-    Self().RemoveRenderer( mOverlayRenderer );
-  }
-
   if ( !mFinishedSignal.Empty() )
   {
     Dali::Toolkit::VideoView handle( GetOwner() );
@@ -552,9 +548,9 @@ void VideoView::SetDepthIndex( int depthIndex )
   }
 }
 
-void VideoView::OnStageConnection( int depth )
+void VideoView::OnSceneConnection( int depth )
 {
-  Control::OnStageConnection( depth );
+  Control::OnSceneConnection( depth );
 
   if( mIsUnderlay )
   {
@@ -562,9 +558,9 @@ void VideoView::OnStageConnection( int depth )
   }
 }
 
-void VideoView::OnStageDisconnection()
+void VideoView::OnSceneDisconnection()
 {
-  Control::OnStageDisconnection();
+  Control::OnSceneDisconnection();
 }
 
 void VideoView::OnSizeSet( const Vector3& targetSize )
@@ -660,6 +656,7 @@ void VideoView::SetWindowSurfaceTarget()
     mOverlayRenderer = Renderer::New( geometry, shader );
     mOverlayRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::OFF );
   }
+  Self().AddRenderer( mOverlayRenderer );
 
   if( mIsPlay )
   {