const char* const TEST_FILE( "test.mp4" );
const char* const VOLUME_LEFT( "volumeLeft" );
const char* const VOLUME_RIGHT( "volumeRight" );
+const char* const RENDERING_TYPE( "renderingTarget" );
}
left = right = 0.f;
Property::Map map;
- map.Insert( VOLUME_LEFT, 1.0f );
+ map.Insert( VOLUME_LEFT, 0.5f );
map.Insert( VOLUME_RIGHT, 0.5f );
- Property::Map map2;
view.SetProperty( VideoView::Property::VOLUME, map );
- Property::Value val4 = view.GetProperty( VideoView::Property::VOLUME );
- DALI_TEST_CHECK( val4.Get( map2 ) );
+ Property::Value val = view.GetProperty( VideoView::Property::VOLUME );
+
+ Property::Map map2;
+ DALI_TEST_CHECK( val.Get( map2 ) );
- Property::Value* volumeLeft = map.Find( VOLUME_LEFT );
- Property::Value* volumeRight = map.Find( VOLUME_RIGHT );
+ Property::Value* volumeLeft = map2.Find( VOLUME_LEFT );
+ Property::Value* volumeRight = map2.Find( VOLUME_RIGHT );
DALI_TEST_CHECK( volumeLeft && volumeLeft->Get( left ) );
DALI_TEST_CHECK( volumeRight && volumeRight->Get( right ) );
- DALI_TEST_CHECK( left == 1.0f );
+ DALI_TEST_CHECK( left == 0.5f );
DALI_TEST_CHECK( right == 0.5f );
END_TEST;
END_TEST;
}
+
+int UtcDaliVideoViewMethodsForRenderType(void)
+{
+ ToolkitTestApplication application;
+ VideoView videoView = VideoView::New();
+ DALI_TEST_CHECK( videoView );
+
+ Property::Map windowSurfaceTarget;
+ Property::Map nativeImageTarget;
+
+ windowSurfaceTarget.Insert( RENDERING_TYPE, "windowSurfaceTarget" );
+ nativeImageTarget.Insert( RENDERING_TYPE, "nativeImageTarget" );
+
+ Property::Map map;
+ Property::Value value;
+ videoView.SetProperty( VideoView::Property::VIDEO, windowSurfaceTarget );
+
+ value = videoView.GetProperty( VideoView::Property::VIDEO );
+ DALI_TEST_CHECK( value.Get( map ) );
+
+ Property::Value* type = map.Find( RENDERING_TYPE );
+ DALI_TEST_CHECK( type );
+ DALI_TEST_EQUALS( "windowSurfaceTarget", type->Get<std::string>(), TEST_LOCATION );
+
+ videoView.SetProperty( VideoView::Property::VIDEO, nativeImageTarget );
+
+ value = videoView.GetProperty( VideoView::Property::VIDEO );
+ DALI_TEST_CHECK( value.Get( map ) );
+ type = map.Find( RENDERING_TYPE );
+
+ DALI_TEST_CHECK( type );
+ DALI_TEST_EQUALS( "nativeImageTarget", type->Get<std::string>(), TEST_LOCATION );
+
+ END_TEST;
+}
const char* const VOLUME_LEFT( "volumeLeft" );
const char* const VOLUME_RIGHT( "volumeRight" );
-const char* const RENDERING_TARGET( "RENDERING_TARGET" );
+const char* const RENDERING_TARGET( "renderingTarget" );
const char* const WINDOW_SURFACE_TARGET( "windowSurfaceTarget" );
const char* const NATIVE_IMAGE_TARGET( "nativeImageTarget" );
VideoView::VideoView()
: Control( ControlBehaviour( ACTOR_BEHAVIOUR_DEFAULT | DISABLE_STYLE_CHANGE_SIGNALS ) ),
mCurrentVideoPlayPosition( 0 ),
- mSetRenderingTarget( false ),
+ mIsNativeImageTarget( true ),
mIsPlay( false ),
mIsPause( false )
{
return handle;
}
+void VideoView::OnInitialize()
+{
+ Any source;
+ Dali::NativeImageSourcePtr nativeImageSourcePtr = Dali::NativeImageSource::New( source );
+ mNativeImage = Dali::NativeImage::New( *nativeImageSourcePtr );
+
+ mVideoPlayer.SetRenderingTarget( nativeImageSourcePtr );
+ mVideoPlayer.FinishedSignal().Connect( this, &VideoView::EmitSignalFinish );
+}
+
void VideoView::SetUrl( const std::string& url )
{
if( mUrl != url || !mPropertyMap.Empty() )
{
- mPropertyMap.Clear();
-
mUrl = url;
+ mPropertyMap.Clear();
}
- if( mSetRenderingTarget )
- {
- mVideoPlayer.SetUrl( mUrl );
- }
- else
+ if( mIsNativeImageTarget )
{
- SetNativeImageTarget();
+ Actor self( Self() );
+ Internal::InitializeVisual( self, mVisual, mNativeImage );
}
+
+ mVideoPlayer.SetUrl( mUrl );
}
void VideoView::SetPropertyMap( Property::Map map )
Actor self = Self();
int curPos = mVideoPlayer.GetPlayPosition();
- mSetRenderingTarget = true;
-
if( mVisual )
{
Toolkit::GetImplementation(mVisual).SetOffStage(self);
mVideoPlayer.SetRenderingTarget( Dali::Adaptor::Get().GetNativeWindowHandle() );
mVideoPlayer.SetUrl( mUrl );
- mVideoPlayer.FinishedSignal().Connect( this, &VideoView::EmitSignalFinish );
+
+ mIsNativeImageTarget = false;
if( mIsPlay )
{
Actor self( Self() );
int curPos = mVideoPlayer.GetPlayPosition();
- mSetRenderingTarget = true;
-
Any source;
Dali::NativeImageSourcePtr nativeImageSourcePtr = Dali::NativeImageSource::New( source );
mNativeImage = Dali::NativeImage::New( *nativeImageSourcePtr );
mVideoPlayer.SetRenderingTarget( nativeImageSourcePtr );
mVideoPlayer.SetUrl( mUrl );
- mVideoPlayer.FinishedSignal().Connect( this, &VideoView::EmitSignalFinish );
Internal::InitializeVisual( self, mVisual, mNativeImage );
+ mIsNativeImageTarget = true;
if( mIsPlay )
{
*/
void SetDepthIndex( int depthIndex );
-
/**
* @brief Performs actions as requested using the action name.
* @SINCE_1_1.38
private: // From Control
/**
+ * @copydoc Toolkit::Control::OnInitialize()
+ */
+ virtual void OnInitialize();
+
+ /**
* @copydoc Toolkit::Control::OnStageConnect()
*/
virtual void OnStageConnection( int depth );
Dali::Toolkit::VideoView::VideoViewSignalType mFinishedSignal;
std::string mUrl;
int mCurrentVideoPlayPosition;
- bool mSetRenderingTarget;
+ bool mIsNativeImageTarget;
bool mIsPlay;
bool mIsPause;
};
namespace
{
-const char* LANDSCAPE_QUALIFIER = "landscape";
+//const char* LANDSCAPE_QUALIFIER = "landscape";
const char* PORTRAIT_QUALIFIER = "portrait";
const char* FONT_SIZE_QUALIFIER = "fontsize";
static void CollectQualifiers( std::vector<std::string>& qualifiersOut )
{
// Append the relevant qualifier for orientation
- int orientation = 0; // Get the orientation from the system
- switch( orientation )
- {
- case 90:
- case 270:
- {
- qualifiersOut.push_back( std::string( LANDSCAPE_QUALIFIER ) );
- break;
- }
- case 180:
- case 0: // fall through
- default:
- {
- qualifiersOut.push_back( std::string( PORTRAIT_QUALIFIER ) );
- break;
- }
- }
+ // int orientation = 0; // Get the orientation from the system
+ /*
+ //// To Do /////
+ Getting orientation from the system, and determine Qualifie LANDSCAPE or PORTRAIT
+ orientation 0, 180 : PORTRAIT_QUALIFIER (default)
+ orientation 90, 270 : LANDSCAPE_QUALIFIER
+ */
+
+ qualifiersOut.push_back( std::string( PORTRAIT_QUALIFIER ) );
+
}
/**
Property::Map map;
DoCreatePropertyMap( map );
Property::Value* valuePtr = map.Find( Toolkit::DevelVisual::Property::TYPE );
- int visualType;
- valuePtr->Get(visualType);
+ int visualType = -1;
+ if( valuePtr )
+ {
+ valuePtr->Get( visualType );
+ }
if( animator.propertyKey == Toolkit::DevelVisual::Property::MIX_COLOR ||
animator.propertyKey == MIX_COLOR ||
}
else if( mImpl->mRenderer )
{
- AnimateRendererProperty(transition, animator);
+ AnimateRendererProperty( transition, animator );
}
}
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 35;
+const unsigned int TOOLKIT_MICRO_VERSION = 36;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
{
int r = -1, g = -1, b = -1;
char s1[32]="", s2[32]="";
- sscanf(str + 4, "%d%[%%, \t]%d%[%%, \t]%d", &r, s1, &g, s2, &b);
+
+ /**
+ * In the original file, the formatted data reading did not specify the string with width limitation.
+ * To prevent the possible overflow, we replace '%s' with '%32s' here.
+ */
+ sscanf(str + 4, "%d%32[%%, \t]%d%32[%%, \t]%d", &r, s1, &g, s2, &b);
if (strchr(s1, '%')) {
return NSVG_RGB((r*255)/100,(g*255)/100,(b*255)/100);
} else {
Name: dali-toolkit
Summary: The OpenGLES Canvas Core Library Toolkit
-Version: 1.2.35
+Version: 1.2.36
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-2-Clause and MIT
result = (Dali::EventThreadCallback *)new Dali::EventThreadCallback((Dali::CallbackBase *)Dali::MakeCallback(arg1));
} catch (std::out_of_range& e) {
{
+ delete result;
SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0;
};
} catch (std::exception& e) {
{
+ delete result;
SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0;
};
} catch (...) {
{
+ delete result;
SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
};
}