[4.0] Added checker of video texture
[platform/core/uifw/dali-extension.git] / dali-extension / video-player / tizen-video-player.cpp
index cbb2c19..1e22c5f 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/public-api/common/stage.h>
 #include <dali/devel-api/threading/mutex.h>
 #include <dali/integration-api/debug.h>
+#include <system_info.h>
 
 // INTERNAL INCLUDES
 
@@ -66,7 +67,6 @@ static void MediaPacketVideoDecodedCb( media_packet_h packet, void* user_data )
 static void EmitPlaybackFinishedSignal( void* user_data )
 {
   TizenVideoPlayer* player = static_cast< TizenVideoPlayer* >( user_data );
-  DALI_LOG_ERROR( "EmitPlaybackFinishedSignal.\n" );
 
   if( player == NULL )
   {
@@ -74,8 +74,6 @@ static void EmitPlaybackFinishedSignal( void* user_data )
     return;
   }
 
-  DALI_LOG_ERROR( "EmitPlaybackFinishedSignal.\n" );
-
   if( !player->mFinishedSignal.Empty() )
   {
     DALI_LOG_ERROR( "EmitPlaybackFinishedSignal.3\n" );
@@ -685,6 +683,8 @@ void TizenVideoPlayer::SetDisplayArea( DisplayArea area )
 
   )
   {
+    area.x = ( area.x < 0 ) ? 0: area.x;
+    area.y = ( area.y < 0 ) ? 0: area.y;
     int error = player_set_display_roi_area( mPlayer, area.x, area.y, area.width, area.height );
     LogPlayerError( error );
   }
@@ -739,5 +739,21 @@ void TizenVideoPlayer::Backward( int millisecond )
   }
 }
 
+bool TizenVideoPlayer::IsVideoTextureSupported()
+{
+  bool featureFlag = true;
+  int error = SYSTEM_INFO_ERROR_NONE;
+
+  error = system_info_get_platform_bool( "tizen.org/feature/multimedia.raw_video", &featureFlag );
+
+  if( error != SYSTEM_INFO_ERROR_NONE )
+  {
+    DALI_LOG_ERROR( "Plugin can't check platform feature\n" );
+    return false;
+  }
+
+  return featureFlag;
+}
+
 } // namespace Plugin
 } // namespace Dali;