From: taeyoon Date: Fri, 9 Sep 2016 10:09:40 +0000 (+0900) Subject: Modified video view impl by considering visual X-Git-Tag: dali_1.2.46~3 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=79a69ab0b206ee0464a624077062e72f437bad98;hp=963a9277aba27b289d604503201775e5fc925bc3 Modified video view impl by considering visual Change-Id: I3f0d1082f4e210f23a2aec0524016bbc08b38ff5 --- diff --git a/dali-toolkit/internal/controls/video-view/video-view-impl.cpp b/dali-toolkit/internal/controls/video-view/video-view-impl.cpp index 1fd4be5..0dd7e1c 100644 --- a/dali-toolkit/internal/controls/video-view/video-view-impl.cpp +++ b/dali-toolkit/internal/controls/video-view/video-view-impl.cpp @@ -29,7 +29,10 @@ // INTERNAL INCLUDES #include -#include +#include +#include +#include +#include namespace Dali { @@ -151,6 +154,18 @@ void VideoView::SetPropertyMap( Property::Map map ) } } + Property::Value* target = map.Find( RENDERING_TARGET ); + std::string targetType; + + if( target && target->Get( targetType ) && targetType == WINDOW_SURFACE_TARGET ) + { + this->SetWindowSurfaceTarget(); + } + else if( target && target->Get( targetType ) && targetType == NATIVE_IMAGE_TARGET ) + { + this->SetNativeImageTarget(); + } + RelayoutRequest(); } @@ -327,25 +342,33 @@ void VideoView::SetProperty( BaseObject* object, Property::Index index, const Pr case Toolkit::VideoView::Property::VIDEO: { std::string videoUrl; + Property::Map map; + if( value.Get( videoUrl ) ) { impl.SetUrl( videoUrl ); } - - Property::Map map; - if( value.Get( map ) ) + else if( value.Get( map ) ) { - impl.SetPropertyMap( map ); + Property::Value* shaderValue = map.Find( Toolkit::Visual::Property::SHADER, CUSTOM_SHADER ); - Property::Value* target = map.Find( RENDERING_TARGET ); - std::string targetType; - if( target && target->Get( targetType ) && targetType == WINDOW_SURFACE_TARGET ) + if( map.Count() > 1u || !shaderValue ) { - impl.SetWindowSurfaceTarget(); + impl.SetPropertyMap( map ); } - else if( target && target->Get( targetType ) && targetType == NATIVE_IMAGE_TARGET ) + else if( impl.mVisual && map.Count() == 1u && shaderValue ) { - impl.SetNativeImageTarget(); + Property::Map shaderMap; + if( shaderValue->Get( shaderMap ) ) + { + Internal::Visual::Base& visual = Toolkit::GetImplementation( impl.mVisual ); + visual.SetCustomShader( shaderMap ); + if( videoView.OnStage() ) + { + visual.SetOffStage( videoView ); + visual.SetOnStage( videoView ); + } + } } } break;