From 43fce20630f8b8b96803715c08ab87bfea16357d Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Tue, 17 Sep 2019 10:38:44 +0900 Subject: [PATCH] Changed Player Internal enum : The Player's enum value changes. So modify it to match the changed enum value. FROM : typedef enum { PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT, /**< This is an optional flag for using codec which has higher priority */ PLAYER_VIDEO_CODEC_TYPE_EX_HW, /**< This is an optional flag for using the h/w codec */ PLAYER_VIDEO_CODEC_TYPE_EX_SW, /**< This is an optional flag for using the s/w codec */ } player_video_codec_type_ex_e; TO : typedef enum { PLAYER_VIDEO_CODEC_TYPE_EX_HW, /**< This is an optional flag for using the h/w codec */ PLAYER_VIDEO_CODEC_TYPE_EX_SW, /**< This is an optional flag for using the s/w codec */ PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT, /**< This is an optional flag for using codec which has higher priority */ } player_video_codec_type_ex_e; And an error code has been added. - PLAYER_ERROR_NOT_SUPPORTED_VIDEO_CODEC Not supported video codec type Change-Id: Icac989cce5d6719fdf50472821beb0ef2b9e19f4 --- .../ecore-wl/tizen-video-player-ecore-wl.cpp | 67 +++++++++++++++++++--- .../video-player/ecore-wl/tizen-video-player.h | 2 - .../ecore-wl2/tizen-video-player-ecore-wl2.cpp | 67 +++++++++++++++++++--- .../video-player/ecore-wl2/tizen-video-player.h | 2 - 4 files changed, 118 insertions(+), 20 deletions(-) diff --git a/dali-extension/video-player/ecore-wl/tizen-video-player-ecore-wl.cpp b/dali-extension/video-player/ecore-wl/tizen-video-player-ecore-wl.cpp index 50b7bf8..a407f20 100755 --- a/dali-extension/video-player/ecore-wl/tizen-video-player-ecore-wl.cpp +++ b/dali-extension/video-player/ecore-wl/tizen-video-player-ecore-wl.cpp @@ -200,6 +200,16 @@ 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; + } } } } @@ -220,7 +230,6 @@ TizenVideoPlayer::TizenVideoPlayer() mPacketVector(), mEcoreWlWindow( NULL ), mAlphaBitChanged( false ), - mCodecType( PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT ), mStreamInfo( NULL ), mStreamType( SOUND_STREAM_TYPE_MEDIA ) { @@ -813,14 +822,26 @@ void TizenVideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type ) if( mPlayerState == PLAYER_STATE_IDLE ) { - 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 ) + player_video_codec_type_ex_e codecType = PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT; + switch( type ) { - DALI_LOG_ERROR( "The target should not support the codec type\n" ); + 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; + } } - error = player_get_video_codec_type_ex( mPlayer, &mCodecType ); + error = player_set_video_codec_type_ex( mPlayer, codecType ); LogPlayerError( error ); } } @@ -828,7 +849,37 @@ void TizenVideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type ) Dali::VideoPlayerPlugin::CodecType TizenVideoPlayer::GetCodecType() const { - return static_cast< Dali::VideoPlayerPlugin::CodecType >( mCodecType ); + 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; } void TizenVideoPlayer::SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode ) diff --git a/dali-extension/video-player/ecore-wl/tizen-video-player.h b/dali-extension/video-player/ecore-wl/tizen-video-player.h index 5b1a606..60c5a87 100755 --- a/dali-extension/video-player/ecore-wl/tizen-video-player.h +++ b/dali-extension/video-player/ecore-wl/tizen-video-player.h @@ -249,8 +249,6 @@ 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: diff --git a/dali-extension/video-player/ecore-wl2/tizen-video-player-ecore-wl2.cpp b/dali-extension/video-player/ecore-wl2/tizen-video-player-ecore-wl2.cpp index 58f10a6..90221ca 100755 --- a/dali-extension/video-player/ecore-wl2/tizen-video-player-ecore-wl2.cpp +++ b/dali-extension/video-player/ecore-wl2/tizen-video-player-ecore-wl2.cpp @@ -200,6 +200,16 @@ 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; + } } } } @@ -220,7 +230,6 @@ TizenVideoPlayer::TizenVideoPlayer() mPacketVector(), mEcoreWlWindow( NULL ), mAlphaBitChanged( false ), - mCodecType( PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT ), mStreamInfo( NULL ), mStreamType( SOUND_STREAM_TYPE_MEDIA ) { @@ -805,14 +814,26 @@ void TizenVideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type ) if( mPlayerState == PLAYER_STATE_IDLE ) { - 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 ) + player_video_codec_type_ex_e codecType = PLAYER_VIDEO_CODEC_TYPE_EX_DEFAULT; + switch( type ) { - DALI_LOG_ERROR( "The target should not support the codec type\n" ); + 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; + } } - error = player_get_video_codec_type_ex( mPlayer, &mCodecType ); + error = player_set_video_codec_type_ex( mPlayer, codecType ); LogPlayerError( error ); } } @@ -820,7 +841,37 @@ void TizenVideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type ) Dali::VideoPlayerPlugin::CodecType TizenVideoPlayer::GetCodecType() const { - return static_cast< Dali::VideoPlayerPlugin::CodecType >( mCodecType ); + 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; } void TizenVideoPlayer::SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode ) diff --git a/dali-extension/video-player/ecore-wl2/tizen-video-player.h b/dali-extension/video-player/ecore-wl2/tizen-video-player.h index ec03d74..1d34778 100755 --- a/dali-extension/video-player/ecore-wl2/tizen-video-player.h +++ b/dali-extension/video-player/ecore-wl2/tizen-video-player.h @@ -249,8 +249,6 @@ 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: -- 2.7.4