Revert "Changed Player Internal enum"
authorJoogab Yun <joogab.yun@samsung.com>
Wed, 18 Sep 2019 04:10:26 +0000 (13:10 +0900)
committerJoogab Yun <joogab.yun@samsung.com>
Wed, 18 Sep 2019 04:10:26 +0000 (13:10 +0900)
This reverts commit 43fce20630f8b8b96803715c08ab87bfea16357d.

dali-extension/video-player/ecore-wl/tizen-video-player-ecore-wl.cpp
dali-extension/video-player/ecore-wl/tizen-video-player.h
dali-extension/video-player/ecore-wl2/tizen-video-player-ecore-wl2.cpp
dali-extension/video-player/ecore-wl2/tizen-video-player.h

index a407f20..50b7bf8 100755 (executable)
@@ -200,16 +200,6 @@ void LogPlayerError( int error )
         DALI_LOG_ERROR( "Player error: Buffer space\n" );
         return;
       }
-      case PLAYER_ERROR_NOT_SUPPORTED_VIDEO_CODEC:
-      {
-        DALI_LOG_ERROR( "Player error: The target should not support the codec type\n" );
-        return;
-      }
-      default :
-      {
-        DALI_LOG_ERROR( "Player error: Unknown error code ( %d ) \n", error );
-        return;
-      }
     }
   }
 }
@@ -230,6 +220,7 @@ TizenVideoPlayer::TizenVideoPlayer()
   mPacketVector(),
   mEcoreWlWindow( NULL ),
   mAlphaBitChanged( false ),
+  mCodecType( PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT ),
   mStreamInfo( NULL ),
   mStreamType( SOUND_STREAM_TYPE_MEDIA )
 {
@@ -822,26 +813,14 @@ void TizenVideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type )
 
     if( mPlayerState == PLAYER_STATE_IDLE )
     {
-      player_video_codec_type_ex_e codecType = PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT;
-      switch( type )
+      error = player_set_video_codec_type_ex( mPlayer, static_cast< player_video_codec_type_ex_e >( type ) );
+      LogPlayerError( error );
+
+      if( error == PLAYER_ERROR_INVALID_OPERATION )
       {
-        case Dali::VideoPlayerPlugin::CodecType::DEFAULT :
-        {
-          codecType = PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT;
-          break;
-        }
-        case Dali::VideoPlayerPlugin::CodecType::HW :
-        {
-          codecType = PLAYER_VIDEO_CODEC_TYPE_EX_HW;
-          break;
-        }
-        case Dali::VideoPlayerPlugin::CodecType::SW :
-        {
-          codecType = PLAYER_VIDEO_CODEC_TYPE_EX_SW;
-          break;
-        }
+        DALI_LOG_ERROR( "The target should not support the codec type\n" );
       }
-      error = player_set_video_codec_type_ex( mPlayer, codecType );
+      error = player_get_video_codec_type_ex( mPlayer, &mCodecType );
       LogPlayerError( error );
     }
   }
@@ -849,37 +828,7 @@ void TizenVideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type )
 
 Dali::VideoPlayerPlugin::CodecType TizenVideoPlayer::GetCodecType() const
 {
-  Dali::VideoPlayerPlugin::CodecType type = Dali::VideoPlayerPlugin::CodecType::DEFAULT;
-  if( mPlayerState != PLAYER_STATE_NONE )
-  {
-    player_video_codec_type_ex_e codecType = PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT;
-    int error = player_get_video_codec_type_ex( mPlayer, &codecType );
-    if( error != PLAYER_ERROR_NONE )
-    {
-      LogPlayerError( error );
-      return type;
-    }
-
-    switch( codecType )
-    {
-      case PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT :
-      {
-        type = Dali::VideoPlayerPlugin::CodecType::DEFAULT;
-        break;
-      }
-      case PLAYER_VIDEO_CODEC_TYPE_EX_HW :
-      {
-        type = Dali::VideoPlayerPlugin::CodecType::HW;
-        break;
-      }
-      case PLAYER_VIDEO_CODEC_TYPE_EX_SW :
-      {
-        type = Dali::VideoPlayerPlugin::CodecType::SW;
-        break;
-      }
-    }
-  }
-  return type;
+  return static_cast< Dali::VideoPlayerPlugin::CodecType >( mCodecType );
 }
 
 void TizenVideoPlayer::SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode )
index 60c5a87..5b1a606 100755 (executable)
@@ -249,6 +249,8 @@ private:
 
   bool mAlphaBitChanged; ///< True if underlay rendering initialization changes window alpha
 
+  player_video_codec_type_ex_e mCodecType;
+
   sound_stream_info_h mStreamInfo;
   sound_stream_type_e mStreamType;
 public:
index 90221ca..58f10a6 100755 (executable)
@@ -200,16 +200,6 @@ void LogPlayerError( int error )
         DALI_LOG_ERROR( "Player error: Buffer space\n" );
         return;
       }
-      case PLAYER_ERROR_NOT_SUPPORTED_VIDEO_CODEC:
-      {
-        DALI_LOG_ERROR( "Player error: The target should not support the codec type\n" );
-        return;
-      }
-      default :
-      {
-        DALI_LOG_ERROR( "Player error: Unknown error code ( %d ) \n", error );
-        return;
-      }
     }
   }
 }
@@ -230,6 +220,7 @@ TizenVideoPlayer::TizenVideoPlayer()
   mPacketVector(),
   mEcoreWlWindow( NULL ),
   mAlphaBitChanged( false ),
+  mCodecType( PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT ),
   mStreamInfo( NULL ),
   mStreamType( SOUND_STREAM_TYPE_MEDIA )
 {
@@ -814,26 +805,14 @@ void TizenVideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type )
 
     if( mPlayerState == PLAYER_STATE_IDLE )
     {
-      player_video_codec_type_ex_e codecType = PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT;
-      switch( type )
+      error = player_set_video_codec_type_ex( mPlayer, static_cast< player_video_codec_type_ex_e >( type ) );
+      LogPlayerError( error );
+
+      if( error == PLAYER_ERROR_INVALID_OPERATION )
       {
-        case Dali::VideoPlayerPlugin::CodecType::DEFAULT :
-        {
-          codecType = PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT;
-          break;
-        }
-        case Dali::VideoPlayerPlugin::CodecType::HW :
-        {
-          codecType = PLAYER_VIDEO_CODEC_TYPE_EX_HW;
-          break;
-        }
-        case Dali::VideoPlayerPlugin::CodecType::SW :
-        {
-          codecType = PLAYER_VIDEO_CODEC_TYPE_EX_SW;
-          break;
-        }
+        DALI_LOG_ERROR( "The target should not support the codec type\n" );
       }
-      error = player_set_video_codec_type_ex( mPlayer, codecType );
+      error = player_get_video_codec_type_ex( mPlayer, &mCodecType );
       LogPlayerError( error );
     }
   }
@@ -841,37 +820,7 @@ void TizenVideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type )
 
 Dali::VideoPlayerPlugin::CodecType TizenVideoPlayer::GetCodecType() const
 {
-  Dali::VideoPlayerPlugin::CodecType type = Dali::VideoPlayerPlugin::CodecType::DEFAULT;
-  if( mPlayerState != PLAYER_STATE_NONE )
-  {
-    player_video_codec_type_ex_e codecType = PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT;
-    int error = player_get_video_codec_type_ex( mPlayer, &codecType );
-    if( error != PLAYER_ERROR_NONE )
-    {
-      LogPlayerError( error );
-      return type;
-    }
-
-    switch( codecType )
-    {
-      case PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT :
-      {
-        type = Dali::VideoPlayerPlugin::CodecType::DEFAULT;
-        break;
-      }
-      case PLAYER_VIDEO_CODEC_TYPE_EX_HW :
-      {
-        type = Dali::VideoPlayerPlugin::CodecType::HW;
-        break;
-      }
-      case PLAYER_VIDEO_CODEC_TYPE_EX_SW :
-      {
-        type = Dali::VideoPlayerPlugin::CodecType::SW;
-        break;
-      }
-    }
-  }
-  return type;
+  return static_cast< Dali::VideoPlayerPlugin::CodecType >( mCodecType );
 }
 
 void TizenVideoPlayer::SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode )
index 1d34778..ec03d74 100755 (executable)
@@ -249,6 +249,8 @@ private:
 
   bool mAlphaBitChanged; ///< True if underlay rendering initialization changes window alpha
 
+  player_video_codec_type_ex_e mCodecType;
+
   sound_stream_info_h mStreamInfo;
   sound_stream_type_e mStreamType;
 public: