From fbbd645648a9c9daaa58304740708f230bb6ff19 Mon Sep 17 00:00:00 2001 From: Hyunil Park Date: Thu, 5 Feb 2015 16:42:54 +0900 Subject: [PATCH] Update to version tizen 2.3 base on Gstreaemr 1.x Change-Id: I33a92b5c9222a76df5e5d8aec6cb6e6846b455b8 Signed-off-by: Hyunil Park --- CMakeLists.txt | 4 +- doc/images/capi_media_player_state_diagram.png | Bin 0 -> 50644 bytes doc/player_doc.h | 359 ++++++ include/player.h | 671 +--------- include/player_private.h | 32 +- packaging/capi-media-player.spec | 14 +- src/player.c | 1569 ++++++++++++------------ test/CMakeLists.txt | 1 + test/player_test.c | 1139 +++++++++++++---- 9 files changed, 2137 insertions(+), 1652 deletions(-) create mode 100644 doc/images/capi_media_player_state_diagram.png create mode 100644 doc/player_doc.h mode change 100644 => 100755 test/player_test.c diff --git a/CMakeLists.txt b/CMakeLists.txt index fd241cb..db2bb42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,8 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(INC_DIR include) INCLUDE_DIRECTORIES(${INC_DIR}) -SET(dependents "dlog mm-player capi-base-common capi-media-sound-manager mm-ta") -SET(pc_dependents "capi-base-common capi-media-sound-manager") +SET(dependents "libtbm capi-media-tool dlog mm-player capi-base-common capi-media-sound-manager gstreamer-1.0 evas ecore elementary") +SET(pc_dependents "libtbm capi-media-tool capi-base-common capi-media-sound-manager") INCLUDE(FindPkgConfig) pkg_check_modules(${fw_name} REQUIRED ${dependents}) diff --git a/doc/images/capi_media_player_state_diagram.png b/doc/images/capi_media_player_state_diagram.png new file mode 100644 index 0000000000000000000000000000000000000000..2d62d9989e29c6a0e170e422635cf631ce500069 GIT binary patch literal 50644 zcmcG0cOcg78}Fk*Db$<~is-YYxF&fbKC?7cn4xxRXT z=lsq&|DNOZK9$G!`@Qe$zV7S#T%YT6KYsGEk8!X`uu&)!j--UBA_{e$6ooq1aS0QC z^0?DY4*tM=CiPepb&CA=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%Ta2%vWv*;U>{+m`jDxfrM}# z3P4#3b*g~FKsq78*I4jSfQh4w=X`HK(=mDZ&E3yCYaj+E9bmGRdlz8la(stHbDdFg9tL+e+_) zeOz+WQ&5+?Glaw$0=ghzFo?MhS^^$|=n=!E-nUy2gz&VahWj?%E>_aJGkSaTsiy!# znl26arb%qNk=n{77-z=tnD}hr8 zy1_r!jFhh7+mkIO89Ptx8 z<^14r5UmUi^!Hot8w)+eQba80AtJd`zzZ*y2l{*W-Xa^rSvcDN#G}`r)77geEBn1V zad&j5Hgpr`0)^ohy{mjRha_(XS^PJes4G5Ak^y?3^Driy;6e!Q_n4;hCH`Oj4-j^` zfCq5hIlyt5NufF<_sq-6DN0#cy;M?=T&n}zcuvmxoaRyr09(@wS=xo1i;Q)kIEtd$lpJ@26Vdtmf|9% ziKUIG$8PsU?-*d5R|YJx0vID<|3hO7(PG_zFw^A9Rg@JQa + * + * @section CAPI_MEDIA_PLAYER_OVERVIEW Overview + * The Player API provides a way to play multimedia content. Content can be played from a file, from the network, or from memory. + * It gives the ability to start/stop/pause/mute, set the playback position (that is, seek), perform various status queries, and control the display. + * + * Additional functions allow registering notifications via callback functions for various state change events. + * + * This API also enables collaboration with the GUI service to present a video. + * + * @subsection CAPI_MEDIA_PLAYER_LIFE_CYCLE_STATE_DIAGRAM State Diagram + * Playback of multimedia content is controlled by a state machine. + * The following diagram shows the life cycle and states of the Player. + * + * @image html capi_media_player_state_diagram.png + * + * @subsection CAPI_MEDIA_PLAYER_LIFE_CYCLE_STATE_TRANSITIONS State Transitions + *

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
FUNCTIONPRE-STATEPOST-STATESYNC TYPE
player_create()NONEIDLESYNC
player_destroy()IDLENONESYNC
player_prepare()IDLEREADYSYNC
player_prepare_async()IDLEREADYASYNC
player_unprepare()READY, PLAYING or PAUSEDIDLESYNC
player_start()READY or PAUSEDPLAYINGSYNC
player_stop()PLAYINGREADYSYNC
player_pause()PLAYINGPAUSEDSYNC
+ * + * @subsection CAPI_MEDIA_PLAYER_LIFE_CYCLE_STATE_DEPENDENT_FUNCTIONS State Dependent Function Calls + * The following table shows state-dependent function calls. + * It is forbidden to call the functions listed below in wrong states. + * Violation of this rule may result in unpredictable behavior. + *
+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
FUNCTIONVALID STATESDESCRIPTION
player_create()ANY-
player_destroy()ANY-
player_prepare()IDLEThis function must be called after player_create()
player_unprepare()READY/PAUSED/PLAYINGThis function must be called after player_stop() or player_start() or player_pause()
player_start()READY/ PAUSEDThis function must be called after player_prepare()
player_stop()PLAYING/ PAUSEDThis function must be called after player_start() or player_pause()
player_pause()PLAYINGThis function must be called after player_start()
player_set_completed_cb()
player_set_interrupted_cb()
player_set_error_cb()
player_set_buffering_cb()
player_set_subtitle_updated_cb()
IDLE/ READY/ PLAYING/ PAUSEDThis function must be called after player_create()
player_unset_completed_cb()
player_unset_interrupted_cb()
player_unset_error_cb()
player_unset_buffering_cb()
player_unset_subtitle_updated_cb()
IDLE/ READY/ PLAYING/ PAUSEDThis function must be called after register callback functions such as player_set_completed_cb()
player_get_state()ANY-
player_set_uri()IDLEThis function must be called before player_prepare()
player_set_memory_buffer()IDLEThis function must be called before player_prepare()
player_set_subtitle_path()IDLEThis function must be called before player_prepare()
player_set_volume()IDLE/ READY/ PLAYING/ PAUSEDThis function must be called after player_create()
player_get_volume()IDLE/ READY/ PLAYING/ PAUSEDThis function must be called after player_create()
player_set_sound_type()IDLEThis function must be called after player_create()
player_set_mute()IDLE/ READY/ PLAYING/ PAUSEDThis function must be called after player_create()
player_is_muted()IDLE/ READY/ PLAYING/ PAUSEDThis function must be called after player_create()
player_set_looping()IDLE/ READY/ PLAYING/ PAUSEDThis function must be called after player_create()
player_is_looping()IDLE/ READY/ PLAYING/ PAUSEDThis function must be called after player_create()
player_get_duration()PLAYING/ PAUSEDThis function must be called after player_start()
player_set_display()IDLEThis function must be called before player_prepare()
player_set_display_mode()
player_set_display_visible()
IDLE/ READY/ PLAYING/ PAUSEDThis function must be called after player_create()
player_get_display_rotation()
player_is_display_visible()
IDLE/ READY/ PLAYING/ PAUSEDThis function must be called after player_create()
player_get_video_size()READY/ PLAYING/ PAUSEDThis function must be called after player_prepare()
+ * + * @subsection CAPI_MEDIA_PLAYER_LIFE_CYCLE_ASYNCHRONOUS_OPERATIONS Asynchronous Operations + * All functions that change the player state are synchronous except player_prepare_async(), player_set_play_position(), and player_capture_video(). + * Thus the result is passed to the application via the callback mechanism. + * + * @subsection CAPI_MEDIA_PLAYER_LIFE_CYCLE_CALLBACK_OPERATIONS Callback(Event) Operations + *
+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + + *
REGISTERUNREGISTERCALLBACKDESCRIPTION
player_set_completed_cb()player_unset_completed_cb()player_completed_cb()called when playback is completed
player_set_interrupted_cb()player_unset_interrupted_cb()player_interrupted_cb()called when playback is interrupted by #player_interrupted_code_e
player_set_error_cb()player_unset_error_cb()player_error_cb()called when an error has occurred
player_set_buffering_cb()player_unset_buffering_cb()player_buffering_cb()called during content buffering
player_set_progressive_download_message_cb()player_unset_progressive_download_message_cb()player_pd_message_cb()called when a progressive download starts or completes
player_set_subtitle_updated_cb()player_unset_subtitle_updated_cb()player_subtitle_updated_cb()called when a subtitle updates
player_set_media_packet_video_frame_decoded_cb()player_unset_media_packet_video_frame_decoded_cb()player_media_packet_video_decoded_cb()called when a video frame is decoded
+ * + */ + + +/** + * @ingroup CAPI_MEDIA_PLAYER_MODULE + * @defgroup CAPI_MEDIA_PLAYER_DISPLAY_MODULE Display + * @brief The @ref CAPI_MEDIA_PLAYER_DISPLAY_MODULE API provides functions to control the display. + * @section CAPI_MEDIA_PLAYER_DISPLAY_MODULE_HEADER Required Header + * \#include + * + * @section CAPI_MEDIA_PLAYER_DISPLAY_MODULE_OVERVIEW Overview + * The API allows you to manage the display of the player. + * This API provides functions to set and get various display properties: + * - mode + * - rotation + * - visibility + * +*/ + +/** + * @ingroup CAPI_MEDIA_PLAYER_MODULE + * @defgroup CAPI_MEDIA_PLAYER_STREAM_INFO_MODULE Stream Information + * @brief The @ref CAPI_MEDIA_PLAYER_STREAM_INFO_MODULE API provides functions to get audio and video stream information, such as codec type, video width or height, bit rate, and so on. + * @section CAPI_MEDIA_PLAYER_AUDIO_EFFECT_MODULE_HEADER Required Header + * \#include + * + * @section CAPI_MEDIA_PLAYER_STREAM_INFO_MODULE_OVERVIEW Overview + * The Player stream information API allows you to get media stream information, including: + * - Content metadata, such as the tile, artist, album title and genre. + * - Audio stream information, such as audio codec type, sample rate, channels, and bit rate. + * - Video stream information, such as video codec type, video width and height. + * +*/ + +/** + * @ingroup CAPI_MEDIA_PLAYER_MODULE + * @defgroup CAPI_MEDIA_PLAYER_AUDIO_EFFECT_MODULE Audio Effect + * @brief The @ref CAPI_MEDIA_PLAYER_AUDIO_EFFECT_MODULE API provides functions to control the audio effect. + * @section CAPI_MEDIA_PLAYER_AUDIO_EFFECT_MODULE_HEADER Required Header + * \#include + * + * @section CAPI_MEDIA_PLAYER_AUDIO_EFFECT_MODULE_MODULE_OVERVIEW Overview + * The Audio effect API allows you to apply effects to the player: + * - Equalizer + * + * +*/ + +/** + * @ingroup CAPI_MEDIA_PLAYER_MODULE + * @defgroup CAPI_MEDIA_PLAYER_SUBTITLE_MODULE Subtitle + * @brief The @ref CAPI_MEDIA_PLAYER_SUBTITLE_MODULE API provides functions to control the subtitle. + * @section CAPI_MEDIA_PLAYER_SUBTITLE_MODULE_HEADER Required Header + * \#include + * + * +*/ + +#endif /* __TIZEN_MEDIA_PLAYER_DOC_H__ */ diff --git a/include/player.h b/include/player.h index 6df06de..a65d3ad 100644 --- a/include/player.h +++ b/include/player.h @@ -21,10 +21,9 @@ #define DEPRECATED __attribute__((deprecated)) #endif - #include #include -//#include We are going to support new feature. +#include #ifdef __cplusplus extern "C" { @@ -65,10 +64,6 @@ typedef enum * @brief Enumeration for media player's error codes. * @since_tizen 2.3 */ - -/* -PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE,PLAYER_ERROR_RESOURCE_LIMIT, PLAYER_ERROR_PERMISSION_DENIED are added. -*/ typedef enum { PLAYER_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ @@ -106,8 +101,7 @@ typedef enum PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT, /**< Interrupted by a resource conflict */ PLAYER_INTERRUPTED_BY_ALARM, /**< Interrupted by an alarm */ PLAYER_INTERRUPTED_BY_EMERGENCY, /**< Interrupted by an emergency */ - PLAYER_INTERRUPTED_BY_RESUMABLE_MEDIA, /**< Interrupted by resumable media application*/ //->will be deprecated - // PLAYER_INTERRUPTED_BY_NOTIFICATION, /**< Interrupted by a notification */ + PLAYER_INTERRUPTED_BY_NOTIFICATION, /**< Interrupted by a notification */ } player_interrupted_code_e; /** @@ -126,11 +120,9 @@ typedef enum */ typedef enum { - PLAYER_DISPLAY_TYPE_X11 = 0, /**< X surface display */ //--> will be deprecated - PLAYER_DISPLAY_TYPE_EVAS = 1, /**< Evas image object surface display */ //--> will be deprecated - //PLAYER_DISPLAY_TYPE_OVERLAY = 0, /**< Overlay surface display */ - //PLAYER_DISPLAY_TYPE_EVAS, /**< Evas image object surface display */ - //PLAYER_DISPLAY_TYPE_NONE, /**< This disposes off buffers */ + PLAYER_DISPLAY_TYPE_OVERLAY = 0, /**< Overlay surface display */ + PLAYER_DISPLAY_TYPE_EVAS, /**< Evas image object surface display */ + PLAYER_DISPLAY_TYPE_NONE, /**< This disposes off buffers */ } player_display_type_e; /** @@ -145,8 +137,8 @@ typedef enum } audio_latency_mode_e; /** - * @brief Player display handle - * + * @brief The player display handle. + * @since_tizen 2.3 */ typedef void* player_display_h; @@ -156,8 +148,7 @@ typedef void* player_display_h; * @since_tizen 2.3 */ #include -#define GET_DISPLAY(x) ((void*)((intptr_t)(x))) //--> will be deprecated -//#define GET_DISPLAY(x) (void*)(x) +#define GET_DISPLAY(x) ((void*)((intptr_t)(x))) //solve cast pointer error for x86_64 #endif /** @@ -187,13 +178,12 @@ typedef enum */ typedef enum { - PLAYER_DISPLAY_MODE_LETTER_BOX = 0, /**< Letter box*/ - PLAYER_DISPLAY_MODE_ORIGIN_SIZE, /**< Origin size*/ - PLAYER_DISPLAY_MODE_FULL_SCREEN, /**< full-screen*/ - PLAYER_DISPLAY_MODE_CROPPED_FULL, /**< Cropped full-screen*/ - PLAYER_DISPLAY_MODE_ORIGIN_OR_LETTER, /**< Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size)*/ - PLAYER_DISPLAY_MODE_ROI, /**< ROI mode*/ //--> will be deprecated - //PLAYER_DISPLAY_MODE_DST_ROI, /**< Dst ROI mode */ + PLAYER_DISPLAY_MODE_LETTER_BOX = 0, /**< Letter box */ + PLAYER_DISPLAY_MODE_ORIGIN_SIZE, /**< Origin size */ + PLAYER_DISPLAY_MODE_FULL_SCREEN, /**< Full-screen */ + PLAYER_DISPLAY_MODE_CROPPED_FULL, /**< Cropped full-screen */ + PLAYER_DISPLAY_MODE_ORIGIN_OR_LETTER, /**< Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size) */ + PLAYER_DISPLAY_MODE_DST_ROI, /**< Dst ROI mode */ } player_display_mode_e; /** @@ -211,7 +201,7 @@ typedef enum */ typedef enum { - PLAYER_CONTENT_INFO_ALBUM, /**< Album */ + PLAYER_CONTENT_INFO_ALBUM, /**< Album */ PLAYER_CONTENT_INFO_ARTIST, /**< Artist */ PLAYER_CONTENT_INFO_AUTHOR, /**< Author */ PLAYER_CONTENT_INFO_GENRE, /**< Genre */ @@ -220,113 +210,9 @@ typedef enum } player_content_info_e; /** - * @brief Enumerations of media stream content information - */ -typedef enum -{ - PLAYER_TRACK_TYPE_AUDIO, /**< Audio Track */ - PLAYER_TRACK_TYPE_VIDEO, /**< Video Track */ - PLAYER_TRACK_TYPE_TEXT, /**< Text Track */ -} player_track_type_e DEPRECATED; // will be deprecated -/** - * @} - */ - -/** - * @addtogroup CAPI_MEDIA_PLAYER_AUDIO_EFFECT_MODULE - * @{ - */ - -/** - * @brief Enumerations of audio effect - */ -typedef enum{ - AUDIO_EFFECT_3D = 1, /**< 3D effect */ - AUDIO_EFFECT_BASS, /**< Bass effect */ - AUDIO_EFFECT_ROOM, /**< Room effect */ - AUDIO_EFFECT_REVERB, /**< Reverberation effect */ - AUDIO_EFFECT_CLARITY, /**< Clarity effect */ -} audio_effect_e DEPRECATED; // will be deprecated - -/** - * @brief Enumerations of preset audio effect - */ -typedef enum{ - AUDIO_EFFECT_PRESET_AUTO = 0, /**< Auto */ - AUDIO_EFFECT_PRESET_NONE, /**< None */ - AUDIO_EFFECT_PRESET_POP, /**< POP */ - AUDIO_EFFECT_PRESET_ROCK, /**< Rock */ - AUDIO_EFFECT_PRESET_DANCE, /**< Dance */ - AUDIO_EFFECT_PRESET_JAZZ, /**< Jazz */ - AUDIO_EFFECT_PRESET_CLASSIC, /**< Classic */ - AUDIO_EFFECT_PRESET_VOCAL, /**< Vocal */ - AUDIO_EFFECT_PRESET_BASS_BOOST, /**< Bass boost */ - AUDIO_EFFECT_PRESET_TREBLE_BOOST, /**< Treble boost */ - AUDIO_EFFECT_PRESET_MTHEATER, /**< Theater */ - AUDIO_EFFECT_PRESET_EXTERNALIZATION,/**< Externalization */ - AUDIO_EFFECT_PRESET_CAFE, /**< Cafe */ - AUDIO_EFFECT_PRESET_CONCERT_HALL, /**< Concert Hall */ - AUDIO_EFFECT_PRESET_VOICE, /**< Voice */ - AUDIO_EFFECT_PRESET_MOVIE, /**< Movie */ - AUDIO_EFFECT_PRESET_VIRTUAL_5_1, /**< Virtual 5.1 */ - AUDIO_EFFECT_PRESET_HIPHOP, /**< HipHop */ - AUDIO_EFFECT_PRESET_RNB, /**< R&B */ - AUDIO_EFFECT_PRESET_FLAT, /**< Flat */ -} audio_effect_preset_e DEPRECATED; // will be deprecated - -/** - * @brief Called once for each supported audio effect. - * @param[in] effect The audio effect - * @param[in] user_data The user data passed from the foreach function - * @return @c true to continue with the next iteration of the loop, \n @c false to break outsp of the loop. - * @pre player_audio_effect_foreach_supported_effect() will invoke this callback. - * @see player_audio_effect_foreach_supported_effect() - */ -typedef bool (*player_audio_effect_supported_effect_cb)(audio_effect_e effect, void *user_data) DEPRECATED; - -/** - * @brief Called once for each supported preset audio effect. - * @param[in] preset The preset audio effect - * @param[in] user_data The user data passed from the foreach function - * @return @c true to continue with the next iteration of the loop, \n @c false to break outsp of the loop. - * @pre player_audio_effect_foreach_supported_preset() will invoke this callback. - * @see player_audio_effect_foreach_supported_preset() - */ -typedef bool (*player_audio_effect_supported_preset_cb)(audio_effect_preset_e preset, void *user_data) DEPRECATED; - -/** * @} */ -/** - * @addtogroup CAPI_MEDIA_PLAYER_X11_DISPLAY_MODULE - * @{ - */ - -/** - * @internal - * @brief Called when the media player needs updated xid. - * @remarks If current display type is not #PLAYER_DISPLAY_TYPE_X11, no operation is performed. - * @param[in] user_data The user data passed from the callback registration function - * @pre It will be invoked when player needs updated xid if you register this callback using player_set_x11_display_pixmap() - * @return The updated xid - * @see player_set_x11_display_pixmap() - */ -typedef unsigned int (*player_x11_pixmap_updated_cb)(void *user_data) DEPRECATED; - -/** - * @internal - * @brief Called when the media player needs to inform rendering error. - * @remarks If current display type is not #PLAYER_DISPLAY_TYPE_X11, no operation is performed. - * @param[in] pixmap_id The pixmap_id where the rendering error is occurred - * @param[in] user_data The user data passed from the callback registration function - * @see player_set_x11_display_pixmap_error_cb() - */ -typedef void (*player_x11_pixmap_error_cb)(unsigned int *pixmap_id, void *user_data) DEPRECATED; - -/** - * @} - */ /** * @addtogroup CAPI_MEDIA_PLAYER_SUBTITLE_MODULE @@ -449,30 +335,7 @@ typedef void (*player_video_captured_cb)(unsigned char *data, int width, int hei * @param[in] pkt Reference pointer to the media packet * @param[in] user_data The user data passed from the callback registration function */ -//typedef void (*player_media_packet_video_decoded_cb)(media_packet_h pkt, void *user_data); - -/** - * @brief Called when the video frame is decoded. - * @remarks The color space format of the captured image is #IMAGE_UTIL_COLORSPACE_RGB888. - * @param[in] data The decoded video frame data - * @param[in] width The width of video frame - * @param[in] height The height of video frame - * @param[in] size The size of video frame - * @param[in] user_data The user data passed from the callback registration function - * @see player_set_video_frame_decoded_cb() - * @see player_unset_video_frame_decoded_cb() - */ -typedef void (*player_video_frame_decoded_cb)(unsigned char *data, int width, int height, unsigned int size, void *user_data) DEPRECATED; - -/** - * @brief Called when the audio frame is decoded. - * @param[in] data The decoded audio frame data - * @param[in] size The size of audio frame - * @param[in] user_data The user data passed from the callback registration function - * @see player_set_audio_frame_decoded_cb() - * @see player_unset_audio_frame_decoded_cb() - */ -typedef void (*player_audio_frame_decoded_cb)(unsigned char *data, unsigned int size, void *user_data) DEPRECATED; +typedef void (*player_media_packet_video_decoded_cb)(media_packet_h pkt, void *user_data); /** * @brief Creates a player handle for playing multimedia content. @@ -800,46 +663,6 @@ int player_pause(player_h player); /** * @brief Sets the seek position for playback, asynchronously. - * @param[in] player The handle to media player - * @param[in] millisecond The position in milliseconds from the start to seek to - * @param[in] callback The callback function to register - * @param[in] user_data The user data to be passed to the callback function - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @retval #PLAYER_ERROR_SEEK_FAILED Seek operation failure - * @pre The player state must be one of these: #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. - * @post It invokes player_seek_completed_cb() when seek operation completes, if you set a callback. - * @see player_get_position() - * @see player_get_position_ratio() - * @see player_set_position_ratio() - */ -int player_set_position(player_h player, int millisecond, player_seek_completed_cb callback, void *user_data) DEPRECATED; - -/** - * @brief Sets the seek position for playback, asynchronously. - * @param[in] player The handle to media player - * @param[in] millisecond The position in milliseconds from the start to seek to - * @param[in] accurate if true, the position selected will be returned but, this might be considerably slow. - * @param[in] callback The callback function to register - * @param[in] user_data The user data to be passed to the callback function - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @retval #PLAYER_ERROR_SEEK_FAILED Seek operation failure - * @pre The player state must be one of these: #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. - * @post It invokes player_seek_completed_cb() when seek operation completes, if you set a callback. - * @see player_get_position() - * @see player_get_position_ratio() - * @see player_set_position_ratio() - */ -int player_seek(player_h player, int millisecond, bool accurate, player_seek_completed_cb callback, void *user_data) DEPRECATED; - - -/** - * @brief Sets the seek position for playback, asynchronously. * @since_tizen 2.3 * @param[in] player The handle to the media player * @param[in] millisecond The position in milliseconds from the start to the seek point @@ -857,42 +680,7 @@ int player_seek(player_h player, int millisecond, bool accurate, player_seek_com * @post It invokes player_seek_completed_cb() when seek operation completes, if you set a callback. * @see player_get_play_position() */ -//int player_set_play_position(player_h player, int millisecond, bool accurate, player_seek_completed_cb callback, void *user_data); - -/** - * @brief Sets the playback position specified by percent of media content played, asynchronously. - * @param[in] player The handle to media player - * @param[in] percent The position in percentage from the start to seek to. \n The position is relative to content. (length, 0 = beginning, 100 = end) - * @param[in] callback The callback function to register - * @param[in] user_data The user data to be passed to the callback function - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @retval #PLAYER_ERROR_SEEK_FAILED Seek operation failure - * @pre The player state must be one of these: #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. - * @post It invokes player_seek_completed_cb() when seek operation completes, if you set a callback. - * @see player_get_position() - * @see player_get_position_ratio() - * @see player_set_position() - */ -int player_set_position_ratio(player_h player, int percent, player_seek_completed_cb callback, void *user_data) DEPRECATED; - -/** - * @brief Gets current position in milliseconds. - * @param[in] player The handle to media player - * @param[out] millisecond The current position in milliseconds - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @retval #PLAYER_ERROR_SEEK_FAILED Seek operation failure - * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. - * @see player_get_position_ratio() - * @see player_set_position() - * @see player_set_position_ratio() - */ -int player_get_position(player_h player, int *millisecond) DEPRECATED; +int player_set_play_position(player_h player, int millisecond, bool accurate, player_seek_completed_cb callback, void *user_data); /** * @brief Gets the current position in milliseconds. @@ -908,23 +696,7 @@ int player_get_position(player_h player, int *millisecond) DEPRECATED; * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. * @see player_set_play_position() */ -//int player_get_play_position(player_h player, int *millisecond); - -/**DEPRECATED - * @brief Gets the playback position specified by percent of media content played. - * @param[in] player The handle to media player - * @param[out] percent The current position in percentage [0, 100] - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @retval #PLAYER_ERROR_SEEK_FAILED Seek operation failure - * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. - * @see player_get_position() - * @see player_set_position() - * @see player_set_position_ratio() - */ -int player_get_position_ratio(player_h player, int *percent) DEPRECATED; +int player_get_play_position(player_h player, int *millisecond); /** * @brief Sets the player's mute status. @@ -1021,18 +793,6 @@ int player_is_looping(player_h player, bool *looping); int player_set_display(player_h player, player_display_type_e type, player_display_h display); /** - * @brief Gets the availability of display mode change - * @remark The result can be changed by display setting. - * @param[in] player The handle to media player - * @param[out] changeable The cuurent availability of display mode change (@c true = changeable, @c false = non-changeable ) - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @see player_set_display_mode() - */ -int player_is_display_mode_changeable(player_h player, bool* changeable) DEPRECATED; - -/** * @} */ @@ -1073,19 +833,6 @@ int player_get_display_mode(player_h player, player_display_mode_e *mode); /** * @brief Sets the visibility of the x surface video display - * @remarks If current display type is not #PLAYER_DISPLAY_TYPE_X11, no operation is performed. - * @param[in] player The handle to media player - * @param[in] rotation The visibility of display (@c true = visible, @c false = non-visible ) - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_STATE Invalid state - * @see player_is_x11_display_visible() - */ -int player_set_x11_display_visible(player_h player, bool visible) DEPRECATED; - -/** - * @brief Sets the visibility of the x surface video display * @since_tizen 2.3 * @param[in] player The handle to the media player * @param[in] visible The visibility of the display (@c true = visible, @c false = non-visible ) @@ -1096,19 +843,7 @@ int player_set_x11_display_visible(player_h player, bool visible) DEPRECATED; * @retval #PLAYER_ERROR_INVALID_STATE Invalid state * @see player_is_display_visible() */ -//int player_set_display_visible(player_h player, bool visible); - -/** - * @brief Gets a visibility of the x surface video display - * @remarks If current display type is not #PLAYER_DISPLAY_TYPE_X11, no operation is performed. - * @param[in] player The handle to media player - * @param[out] visible The current visibility of display (@c true = visible, @c false = non-visible ) - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @see player_set_x11_display_visible() - */ -int player_is_x11_display_visible(player_h player, bool* visible) DEPRECATED; +int player_set_display_visible(player_h player, bool visible); /** * @brief Gets the visibility of the x surface video display. @@ -1121,21 +856,7 @@ int player_is_x11_display_visible(player_h player, bool* visible) DEPRECATED; * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter * @see player_set_display_visible() */ -//int player_is_display_visible(player_h player, bool* visible); - -/** - * @brief Sets the rotation settings of the x surface video display - * @details Use this function to change the video orientation to portrait mode. - * @remarks If current display type is not #PLAYER_DISPLAY_TYPE_X11, no operation is performed. - * @param[in] player The handle to media player - * @param[in] rotation The rotation of display - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_STATE Invalid state - * @see player_get_x11_display_rotation() - */ -int player_set_x11_display_rotation(player_h player, player_display_rotation_e rotation) DEPRECATED; +int player_is_display_visible(player_h player, bool* visible); /** * @brief Sets the rotation settings of the video surface display. @@ -1153,19 +874,7 @@ int player_set_x11_display_rotation(player_h player, player_display_rotation_e r * @see player_set_display * @see player_get_display_rotation() */ -//int player_set_display_rotation(player_h player, player_display_rotation_e rotation); - -/** - * @brief Gets a rotation of the x surface video display - * @remarks If current display type is not #PLAYER_DISPLAY_TYPE_X11, no operation is performed. - * @param[in] player The handle to media player - * @param[out] rotation The current rotation of display - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @see player_set_x11_display_rotation() - */ -int player_get_x11_display_rotation( player_h player, player_display_rotation_e *rotation) DEPRECATED; +int player_set_display_rotation(player_h player, player_display_rotation_e rotation); /** * @brief Gets the rotation of the video surface display. @@ -1178,97 +887,7 @@ int player_get_x11_display_rotation( player_h player, player_display_rotation_e * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter * @see player_set_display_rotation() */ -//int player_get_display_rotation( player_h player, player_display_rotation_e *rotation); - -/** - * @brief Sets the zoom level of the x surface video display - * @remarks If current display type is not #PLAYER_DISPLAY_TYPE_X11, no operation is performed. - * @param[in] player The handle to media player - * @param[in] level The level of zoom [1~9] - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_STATE Invalid state - * @see player_get_x11_display_zoom() - */ -int player_set_x11_display_zoom(player_h player, int level) DEPRECATED; - -/** - * @brief Gets a zoom level of the x surface video display - * @remarks If current display type is not #PLAYER_DISPLAY_TYPE_X11, no operation is performed. - * @param[in] player The handle to media player - * @param[out] level The level of zoom [1~9] - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @see player_set_x11_display_zoom() - */ -int player_get_x11_display_zoom( player_h player, int *level) DEPRECATED; - -/** - * @internal - * @brief Registers a callback function to be invoked when player need updated xid. - * @param[in] player The handle to media player - * @param[in] callback The callback function to register - * @param[in] user_data The user data to be passed to the callback function - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @pre The player state must be either #PLAYER_STATE_IDLE by player_create() or #PLAYER_STATE_READY by player_prepare(). - * @post player_set_x11_display_pixmap() will be invoked - * @see player_set_x11_display_pixmap() - */ -int player_set_x11_display_pixmap (player_h player, player_x11_pixmap_updated_cb callback, void *user_data) DEPRECATED; - -/** - * @internal - * @brief Registers a callback function to be invoked when failure of rendering video frame happen. - * @param[in] player The handle to media player - * @param[in] callback The callback function to register - * @param[in] user_data The user data to be passed to the callback function - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_STATE Invalid state - * @pre The player state must be either #PLAYER_STATE_IDLE by player_create() or #PLAYER_STATE_READY by player_prepare(). - * @post player_set_x11_display_pixmap_error_cb() will be invoked - * @see player_set_x11_display_pixmap_error_cb() - */ -int player_set_x11_display_pixmap_error_cb (player_h player, player_x11_pixmap_error_cb callback, void *user_data) DEPRECATED; - -/** - * @brief Sets information of ROI - * @remarks If current display mode is not #PLAYER_DISPLAY_MODE_ROI, #PLAYER_ERROR_INVALID_OPERATION will be returned. - * @param[in] player The handle to media player - * @param[in] x The x coordinate of ROI - * @param[in] y The y coordinate of ROI - * @param[in] w The width of ROI - * @param[in] h The height of ROI - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_STATE Invalid state - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @see player_get_x11_display_roi() - */ -int player_set_x11_display_roi (player_h player, int x, int y, int w, int h) DEPRECATED; - -/** - * @brief Gets information of ROI - * @remarks If current display mode is not #PLAYER_DISPLAY_MODE_ROI, #PLAYER_ERROR_INVALID_OPERATION will be returned. - * @param[in] player The handle to media player - * @param[out] x The x coordinate of ROI - * @param[out] y The y coordinate of ROI - * @param[out] w The width of ROI - * @param[out] h The height of ROI - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_STATE Invalid state - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @see player_set_x11_display_roi() - */ -int player_get_x11_display_roi (player_h player, int *x, int *y, int *w, int *h) DEPRECATED; +int player_get_display_rotation( player_h player, player_display_rotation_e *rotation); /** * @} @@ -1276,29 +895,6 @@ int player_get_x11_display_roi (player_h player, int *x, int *y, int *w, int *h) /** - * @addtogroup CAPI_MEDIA_PLAYER_EVAS_DISPLAY_MODULE - * @{ - */ - -/** - * @brief Sets the evas surface video display scaling status. - * @remarks If current display type is not #PLAYER_DISPLAY_TYPE_EVAS, no operation is performed. - * @remarks If the scaling status is @c false, player_is_display_mode_changeable() always return @a false. - * @param[in] player The handle to media player - * @param[in] enable New evas surface video display scaling status: (@c true = scaling, @c false = not scaled) - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. - */ -int player_enable_evas_display_scaling(player_h player, bool enable) DEPRECATED; - -/** - * @} - */ - -/** * @addtogroup CAPI_MEDIA_PLAYER_STREAM_INFO_MODULE * @{ */ @@ -1438,21 +1034,6 @@ int player_get_album_art(player_h player, void **album_art, int *size); */ int player_get_duration(player_h player, int *duration); - -/** - * @brief Gets the track count - * @param[in] player The handle to media player - * @param [in] type The track type - * @param [out] count The count of track - * @return 0 on success, otherwise a negative error value - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @pre The player state must be one of these: #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. - */ -int player_get_track_count(player_h player, player_track_type_e type, int *count) DEPRECATED; - /** * @} */ @@ -1464,136 +1045,6 @@ int player_get_track_count(player_h player, player_track_type_e type, int *count */ /** - * @brief Sets an audio effect value. - * @param[in] player The handle to media player - * @param[in] effect The audio effect type - * @param[in] value The value of given effect type - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. - * @see player_audio_effect_get_value() - * @see player_audio_effect_clear() - * @see player_audio_effect_get_value_range() - */ -int player_audio_effect_set_value(player_h player, audio_effect_e effect, int value) DEPRECATED; - -/** - * @brief Gets an audio effect value. - * @param[in] player The handle to media player - * @param[in] effect The audio effect type - * @param[out] value The value of given effect type - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. - * @see player_audio_effect_set_value() - */ -int player_audio_effect_get_value(player_h player, audio_effect_e effect, int *value) DEPRECATED; - -/** - * @brief Clears audio effect. - * @param[in] player The handle to media player - * @param[in] effect The audio effect type - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. - * @see player_audio_effect_set_value() - */ -int player_audio_effect_clear(player_h player, audio_effect_e effect) DEPRECATED; - -/** - * @brief Gets the range of audio effect value. - * @param[in] player The handle to media player - * @param[in] effect The audio effect type - * @param[out] min The minumum value to be set - * @param[out] max The maximum value to be set - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. - * @see player_audio_effect_set_value() - */ -int player_audio_effect_get_value_range(player_h player, audio_effect_e effect, int* min, int* max) DEPRECATED; - -/** - * @brief Checks whether the given effect is avaliable or not. - * @param[in] player The handle to media player - * @param[in] effect The audio effect to be checked - * @param[out] available @c true if the specified audio effect is available, else @c false - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. - */ -int player_audio_effect_is_available(player_h player, audio_effect_e effect, bool *available) DEPRECATED; - -/** - * @brief Retrieves all supported audio effects by invoking callback function once for each supported audio effect. - * @param[in] player The handle to media player - * @param[in] callback The callback function to invoke - * @param[in] user_data The user data to be passed to the callback function - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. - * @post This function invokes player_audio_effect_supported_effect_cb() repeatly to retrieve each supported audio effect. - * @see player_audio_effect_set_value() - * @see player_audio_effect_get_value() - * @see player_audio_effect_foreach_supported_effect() - */ -int player_audio_effect_foreach_supported_effect(player_h player, player_audio_effect_supported_effect_cb callback, void *user_data) DEPRECATED; - -/** - * @brief Sets an preset audio effect. - * @remarks Audio effects or equalizer which is set be ignored. - * @param[in] player The handle to media player - * @param[in] preset The preset audio effect - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. - * @see player_audio_effect_preset_is_available() - * @see player_audio_effect_foreach_supported_preset() - */ -int player_audio_effect_set_preset(player_h player, audio_effect_preset_e preset) DEPRECATED; - -/** - * @brief Checks whether the given preset is avaliable or not. - * @param[in] player The handle to media player - * @param[in] preset The preset to be checked - * @param[out] available @c true if the specified preset is available, else @c false - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. - */ -int player_audio_effect_preset_is_available(player_h player, audio_effect_preset_e preset, bool *available) DEPRECATED; - -/** - * @brief Retrieves all supported presets by invoking callback function once for each supported preset audio effect. - * @param[in] player The handle to media player - * @param[in] callback The callback function to invoke - * @param[in] user_data The user data to be passed to the callback function - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. - * @post This function invokes player_audio_effect_supported_preset_cb() repeatly to retrieve each supported preset audio effect. - * @see player_audio_effect_set_preset() - * @see player_audio_effect_supported_preset_cb() - */ -int player_audio_effect_foreach_supported_preset(player_h player, player_audio_effect_supported_preset_cb callback, void *user_data) DEPRECATED; -/** * @brief Gets the number of equalizer bands. * @since_tizen 2.3 * @param[in] player The handle to the media player @@ -2084,21 +1535,6 @@ int player_set_subtitle_updated_cb(player_h player, player_subtitle_updated_cb c int player_unset_subtitle_updated_cb(player_h player); /** - * @brief Sets the seek position for subtitle. - * @remarks Only MicroDVD/SubViewer(*.sub), SAMI(*.smi), and SubRip(*.srt) subtitle formats are supported. - * @param[in] player The handle to media player - * @param[in] millisecond The position in milliseconds from the start to seek to - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @pre The subtitle must be set by player_set_subtitle_path(). - * @pre The player state must be one of: #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. - */ -int player_set_subtitle_position(player_h player, int millisecond) DEPRECATED; - -/** * @internal * @brief Sets the seek position for the subtitle. * @since_tizen 2.3 @@ -2114,7 +1550,7 @@ int player_set_subtitle_position(player_h player, int millisecond) DEPRECATED; * @pre The subtitle must be set by calling player_set_subtitle_path(). * @pre The player state must be one of these: #PLAYER_STATE_PLAYING or #PLAYER_STATE_PAUSED. */ -//int player_set_subtitle_position_offset(player_h player, int millisecond); +int player_set_subtitle_position_offset(player_h player, int millisecond); /** * @brief Registers a media packet video callback function to be called once per frame. @@ -2136,7 +1572,7 @@ int player_set_subtitle_position(player_h player, int millisecond) DEPRECATED; * @pre The player's state should be #PLAYER_STATE_IDLE. And, #PLAYER_DISPLAY_TYPE_NONE should be set by calling player_set_display. * @see player_unset_media_packet_video_frame_decoded_cb */ -//int player_set_media_packet_video_frame_decoded_cb(player_h player, player_media_packet_video_decoded_cb callback, void *user_data); +int player_set_media_packet_video_frame_decoded_cb(player_h player, player_media_packet_video_decoded_cb callback, void *user_data); /** * @brief Unregisters the callback function. @@ -2148,64 +1584,7 @@ int player_set_subtitle_position(player_h player, int millisecond) DEPRECATED; * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter * @see player_set_media_packet_video_frame_decoded_cb() */ -//int player_unset_media_packet_video_frame_decoded_cb(player_h player); - - -/** - * @brief Registers a callback function to be invoked when video frame is decoded. - * @param[in] player The handle to media player - * @param[in] callback The callback function to register - * @param[in] user_data The user data to be passed to the callback function - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @pre The player state must be #PLAYER_STATE_IDLE by player_create() or player_unprepare(). - * @post player_video_frame_decoded_cb() will be invoked - * @see player_unset_video_frame_decoded_cb() - * @see player_video_frame_decoded_cb() - */ -int player_set_video_frame_decoded_cb(player_h player, player_video_frame_decoded_cb callback, void *user_data) DEPRECATED; - -/** - * @brief Unregisters the callback function. - * @param[in] player The handle to media player - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @see player_set_video_frame_decoded_cb() - */ -int player_unset_video_frame_decoded_cb(player_h player) DEPRECATED; - -/** - * @brief Registers a callback function to be invoked when audio frame is decoded. - * @param[in] player The handle to media player - * @param[in] start The start position to decode. - * @param[in] end The end position to decode. - * @param[in] callback The callback function to register - * @param[in] user_data The user data to be passed to the callback function - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @pre The player state must be #PLAYER_STATE_IDLE by player_create() or player_unprepare(). - * @post player_audio_frame_decoded_cb() will be invoked - * @see player_unset_audio_frame_decoded_cb() - * @see player_audio_frame_decoded_cb() - */ -int player_set_audio_frame_decoded_cb(player_h player, int start, int end, player_audio_frame_decoded_cb callback, void *user_data) DEPRECATED; - -/** - * @brief Unregisters the callback function. - * @param[in] player The handle to media player - * @return 0 on success, otherwise a negative error value. - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @see player_set_audio_frame_decoded_cb() - */ -int player_unset_audio_frame_decoded_cb(player_h player) DEPRECATED; +int player_unset_media_packet_video_frame_decoded_cb(player_h player); /** * @} diff --git a/include/player_private.h b/include/player_private.h index 7466ab2..fbdae85 100644 --- a/include/player_private.h +++ b/include/player_private.h @@ -23,6 +23,28 @@ extern "C" { #endif +#ifdef LOG_TAG +#undef LOG_TAG +#endif +#define LOG_TAG "TIZEN_N_PLAYER" + +#define PLAYER_CHECK_CONDITION(condition,error,msg) \ + if(condition) {} else \ + { LOGE("[%s] %s(0x%08x)",__FUNCTION__, msg,error); return error;}; \ + +#define PLAYER_INSTANCE_CHECK(player) \ + PLAYER_CHECK_CONDITION(player != NULL, PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER") + +#define PLAYER_STATE_CHECK(player,expected_state) \ + PLAYER_CHECK_CONDITION(player->state == expected_state,PLAYER_ERROR_INVALID_STATE,"PLAYER_ERROR_INVALID_STATE") + +#define PLAYER_NULL_ARG_CHECK(arg) \ + PLAYER_CHECK_CONDITION(arg != NULL,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER") + +#define PLAYER_RANGE_ARG_CHECK(arg, min, max) \ + PLAYER_CHECK_CONDITION(arg <= max,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER") \ + PLAYER_CHECK_CONDITION(arg >= min,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER") + typedef enum { _PLAYER_EVENT_TYPE_PREPARE, _PLAYER_EVENT_TYPE_COMPLETE, @@ -32,8 +54,7 @@ typedef enum { _PLAYER_EVENT_TYPE_SUBTITLE, _PLAYER_EVENT_TYPE_CAPTURE, _PLAYER_EVENT_TYPE_SEEK, - //_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME, - _PLAYER_EVENT_TYPE_VIDEO_FRAME, + _PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME, _PLAYER_EVENT_TYPE_AUDIO_FRAME, _PLAYER_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR, _PLAYER_EVENT_TYPE_PD, @@ -55,8 +76,15 @@ typedef struct _player_s{ bool is_display_visible; bool is_progressive_download; pthread_t prepare_async_thread; + GHashTable *ecore_jobs; + player_error_e error_code; + bool is_doing_jobs; + media_format_h pkt_fmt; } player_s; +int __player_convert_error_code(int code, char* func_name); +bool __player_state_validate(player_s * handle, player_state_e threshold); + #ifdef __cplusplus } #endif diff --git a/packaging/capi-media-player.spec b/packaging/capi-media-player.spec index 388b6fe..5e6e084 100644 --- a/packaging/capi-media-player.spec +++ b/packaging/capi-media-player.spec @@ -10,11 +10,12 @@ License: Apache-2.0 Source0: %{name}-%{version}.tar.gz Source1001: capi-media-player.manifest BuildRequires: cmake +BuildRequires: pkgconfig(gstreamer-1.0) +BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(mm-player) BuildRequires: pkgconfig(capi-base-common) BuildRequires: pkgconfig(capi-media-sound-manager) -BuildRequires: pkgconfig(mm-ta) BuildRequires: pkgconfig(appcore-efl) BuildRequires: pkgconfig(elementary) BuildRequires: pkgconfig(ecore) @@ -25,6 +26,8 @@ BuildRequires: pkgconfig(ecore-x) %if %{with wayland} BuildRequires: pkgconfig(ecore-wayland) %endif +BuildRequires: pkgconfig(capi-media-tool) +BuildRequires: pkgconfig(libtbm) Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig @@ -47,6 +50,12 @@ cp %{SOURCE1001} . %build +%if 0%{?sec_build_binary_debug_enable} +export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE" +#export CFLAGS+=" -D_USE_X_DIRECT_" +export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE" +export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE" +%endif MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \ %if %{with wayland} @@ -60,7 +69,6 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` -DX11_SUPPORT=Off %endif - make %{?jobs:-j%jobs} %install @@ -69,6 +77,8 @@ mkdir -p %{buildroot}/usr/share/license mkdir -p %{buildroot}/usr/bin cp LICENSE.APLv2 %{buildroot}/usr/share/license/%{name} cp test/player_test %{buildroot}/usr/bin +#cp test/player_media_packet_test %{buildroot}/usr/bin + %make_install %post -p /sbin/ldconfig diff --git a/src/player.c b/src/player.c index 97036c0..4349f4e 100644 --- a/src/player.c +++ b/src/player.c @@ -25,34 +25,60 @@ #include #include #include -#include - -#ifdef LOG_TAG -#undef LOG_TAG -#endif -#define LOG_TAG "TIZEN_N_PLAYER" - -/* -* Internal Macros -*/ - -#define PLAYER_CHECK_CONDITION(condition,error,msg) \ - if(condition) {} else \ - { LOGE("[%s] %s(0x%08x)",__FUNCTION__, msg,error); return error;}; \ - -#define PLAYER_INSTANCE_CHECK(player) \ - PLAYER_CHECK_CONDITION(player != NULL, PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER") - -#define PLAYER_STATE_CHECK(player,expected_state) \ - PLAYER_CHECK_CONDITION(player->state == expected_state,PLAYER_ERROR_INVALID_STATE,"PLAYER_ERROR_INVALID_STATE") - -#define PLAYER_NULL_ARG_CHECK(arg) \ - PLAYER_CHECK_CONDITION(arg != NULL,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER") +#include +#include +#include +#include +#include +#include +#include + +#define __JOB_KEY_PREPARED "prepared" +#define __JOB_KEY_ERROR "error" +#define __JOB_KEY_SEEK_DONE "seek_done" +#define __JOB_KEY_EOS "eos" + +#define __RELEASEIF_PREPARE_THREAD(thread_id) \ + do { \ + if (thread_id) \ + { \ + pthread_join(thread_id, NULL); \ + thread_id = 0; \ + LOGI("prepare thread released\n"); \ + } \ + }while(0) + +#define __DELETE_ECORE_ITEM(ecore_job) \ + do { \ + if (ecore_job) \ + { \ + ecore_job_del(ecore_job); \ + ecore_job = NULL; \ + } \ + }while(0) + +#define __ADD_ECORE_JOB(handle, key, job_callback) \ + do \ + { \ + Ecore_Job *job = NULL; \ + job = ecore_job_add(job_callback, (void *)handle); \ + LOGI("adding %s job - %p\n", key, job); \ + g_hash_table_insert(handle->ecore_jobs, g_strdup(key), job); \ + \ + } while(0) + +#define __REMOVE_ECORE_JOB(handle, job_key) \ + do \ + { \ + LOGI("%s done so, remove\n", job_key); \ + g_hash_table_remove(handle->ecore_jobs, job_key); \ + handle->is_doing_jobs = FALSE; \ + } while(0) /* * Internal Implementation */ -static int __convert_error_code(int code, char* func_name) +int __player_convert_error_code(int code, char* func_name) { int ret = PLAYER_ERROR_INVALID_OPERATION; char* msg="PLAYER_ERROR_INVALID_OPERATION"; @@ -85,14 +111,14 @@ static int __convert_error_code(int code, char* func_name) case MM_ERROR_PLAYER_INVALID_STREAM: case MM_ERROR_PLAYER_STREAMING_FAIL: case MM_ERROR_PLAYER_NO_OP: - case MM_ERROR_NOT_SUPPORT_API: ret = PLAYER_ERROR_INVALID_OPERATION; msg = "PLAYER_ERROR_INVALID_OPERATION"; break; case MM_ERROR_PLAYER_SOUND_EFFECT_INVALID_STATUS: + case MM_ERROR_NOT_SUPPORT_API: case MM_ERROR_PLAYER_SOUND_EFFECT_NOT_SUPPORTED_FILTER: - ret = PLAYER_ERROR_INVALID_OPERATION; - msg = "PLAYER_ERROR_INVALID_OPERATION (NOT SUPPORTED AUDIO EFFECT)"; + ret =PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE; + msg = "PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE"; break; case MM_ERROR_PLAYER_NO_FREE_SPACE: ret = PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE; @@ -173,18 +199,181 @@ static int __convert_error_code(int code, char* func_name) ret = PLAYER_ERROR_DRM_FUTURE_USE; msg = "PLAYER_ERROR_DRM_FUTURE_USE"; break; + case MM_ERROR_PLAYER_DRM_OUTPUT_PROTECTION: + ret = PLAYER_ERROR_DRM_NOT_PERMITTED; + msg = "PLAYER_ERROR_DRM_NOT_PERMITTED"; + break; + case MM_ERROR_PLAYER_RESOURCE_LIMIT: + ret = PLAYER_ERROR_RESOURCE_LIMIT; + msg = "PLAYER_ERROR_RESOURCE_LIMIT"; + break; + case MM_ERROR_PLAYER_PERMISSION_DENIED: + ret = PLAYER_ERROR_PERMISSION_DENIED; + msg = "PLAYER_ERROR_PERMISSION_DENIED"; } LOGE("[%s] %s(0x%08x) : core fw error(0x%x)",func_name,msg, ret, code); return ret; } +int _player_get_tbm_surface_format(int in_format, uint32_t *out_format) +{ + if (in_format <= MM_PIXEL_FORMAT_INVALID || + in_format >= MM_PIXEL_FORMAT_NUM || + out_format == NULL) { + LOGE("INVALID_PARAMETER : in_format %d, out_format ptr %p", in_format, out_format); + return PLAYER_ERROR_INVALID_PARAMETER; + } + + switch (in_format) { + case MM_PIXEL_FORMAT_NV12: + case MM_PIXEL_FORMAT_NV12T: + *out_format = TBM_FORMAT_NV12; + break; + case MM_PIXEL_FORMAT_NV16: + *out_format = TBM_FORMAT_NV16; + break; + case MM_PIXEL_FORMAT_NV21: + *out_format = TBM_FORMAT_NV21; + break; + case MM_PIXEL_FORMAT_YUYV: + *out_format = TBM_FORMAT_YUYV; + break; + case MM_PIXEL_FORMAT_UYVY: + case MM_PIXEL_FORMAT_ITLV_JPEG_UYVY: + *out_format = TBM_FORMAT_UYVY; + break; + case MM_PIXEL_FORMAT_422P: + *out_format = TBM_FORMAT_YUV422; + break; + case MM_PIXEL_FORMAT_I420: + *out_format = TBM_FORMAT_YUV420; + break; + case MM_PIXEL_FORMAT_YV12: + *out_format = TBM_FORMAT_YVU420; + break; + case MM_PIXEL_FORMAT_RGB565: + *out_format = TBM_FORMAT_RGB565; + break; + case MM_PIXEL_FORMAT_RGB888: + *out_format = TBM_FORMAT_RGB888; + break; + case MM_PIXEL_FORMAT_RGBA: + *out_format = TBM_FORMAT_RGBA8888; + break; + case MM_PIXEL_FORMAT_ARGB: + *out_format = TBM_FORMAT_ARGB8888; + break; + default: + LOGE("invalid in_format %d", in_format); + return PLAYER_ERROR_INVALID_PARAMETER; + } + + return PLAYER_ERROR_NONE; +} + +int _player_get_media_packet_mimetype(int in_format, media_format_mimetype_e *mimetype) +{ + if (in_format <= MM_PIXEL_FORMAT_INVALID || + in_format >= MM_PIXEL_FORMAT_NUM || + mimetype == NULL) { + LOGE("INVALID_PARAMETER : in_format %d, mimetype ptr %p", in_format, mimetype); + return PLAYER_ERROR_INVALID_PARAMETER; + } + + switch (in_format) { + case MM_PIXEL_FORMAT_NV12: + case MM_PIXEL_FORMAT_NV12T: + *mimetype = MEDIA_FORMAT_NV12; + break; + case MM_PIXEL_FORMAT_NV16: + *mimetype = MEDIA_FORMAT_NV16; + break; + case MM_PIXEL_FORMAT_NV21: + *mimetype = MEDIA_FORMAT_NV21; + break; + case MM_PIXEL_FORMAT_YUYV: + *mimetype = MEDIA_FORMAT_YUYV; + break; + case MM_PIXEL_FORMAT_UYVY: + case MM_PIXEL_FORMAT_ITLV_JPEG_UYVY: + *mimetype = MEDIA_FORMAT_UYVY; + break; + case MM_PIXEL_FORMAT_422P: + *mimetype = MEDIA_FORMAT_422P; + break; + case MM_PIXEL_FORMAT_I420: + *mimetype = MEDIA_FORMAT_I420; + break; + case MM_PIXEL_FORMAT_YV12: + *mimetype = MEDIA_FORMAT_YV12; + break; + case MM_PIXEL_FORMAT_RGB565: + *mimetype = MEDIA_FORMAT_RGB565; + break; + case MM_PIXEL_FORMAT_RGB888: + *mimetype = MEDIA_FORMAT_RGB888; + break; + case MM_PIXEL_FORMAT_RGBA: + *mimetype = MEDIA_FORMAT_RGBA; + break; + case MM_PIXEL_FORMAT_ARGB: + *mimetype = MEDIA_FORMAT_ARGB; + break; + default: + LOGE("invalid in_format %d", in_format); + return PLAYER_ERROR_INVALID_PARAMETER; + } + + return PLAYER_ERROR_NONE; +} + +int _player_media_packet_finalize(media_packet_h pkt, int error_code, void *user_data) +{ + int ret = 0; + void *internal_buffer = NULL; + tbm_surface_h tsurf = NULL; + + if (pkt == NULL || user_data == NULL) { + LOGE("invalid parameter buffer %p, user_data %p", pkt, user_data); + return MEDIA_PACKET_FINALIZE; + } + + ret = media_packet_get_extra(pkt, &internal_buffer); + if (ret != MEDIA_PACKET_ERROR_NONE) { + LOGE("media_packet_get_extra failed 0x%x", ret); + return MEDIA_PACKET_FINALIZE; + } + + /*LOGD("pointer gst buffer %p, ret 0x%x", internal_buffer, ret);*/ + + if (internal_buffer) { + gst_buffer_unref((GstBuffer *)internal_buffer); + internal_buffer = NULL; + } + + ret = media_packet_get_tbm_surface(pkt, &tsurf); + if (ret != MEDIA_PACKET_ERROR_NONE) { + LOGE("media_packet_get_tbm_surface failed 0x%x", ret); + return MEDIA_PACKET_FINALIZE; + } + + if (tsurf) { + tbm_surface_destroy(tsurf); + tsurf = NULL; + } + + return MEDIA_PACKET_FINALIZE; +} + static player_interrupted_code_e __convert_interrupted_code(int code) { player_interrupted_code_e ret = PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT; switch(code) { + case MM_MSG_CODE_INTERRUPTED_BY_CALL_END: case MM_MSG_CODE_INTERRUPTED_BY_ALARM_END: case MM_MSG_CODE_INTERRUPTED_BY_EMERGENCY_END: + case MM_MSG_CODE_INTERRUPTED_BY_NOTIFICATION_END: ret = PLAYER_INTERRUPTED_COMPLETED; break; case MM_MSG_CODE_INTERRUPTED_BY_MEDIA: @@ -200,12 +389,12 @@ static player_interrupted_code_e __convert_interrupted_code(int code) case MM_MSG_CODE_INTERRUPTED_BY_ALARM_START: ret = PLAYER_INTERRUPTED_BY_ALARM; break; + case MM_MSG_CODE_INTERRUPTED_BY_NOTIFICATION_START: + ret = PLAYER_INTERRUPTED_BY_NOTIFICATION; + break; case MM_MSG_CODE_INTERRUPTED_BY_EMERGENCY_START: ret = PLAYER_INTERRUPTED_BY_EMERGENCY; break; - case MM_MSG_CODE_INTERRUPTED_BY_RESUMABLE_MEDIA: - ret = PLAYER_INTERRUPTED_BY_RESUMABLE_MEDIA; - break; case MM_MSG_CODE_INTERRUPTED_BY_RESOURCE_CONFLICT: default : ret = PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT; @@ -223,7 +412,7 @@ static player_state_e __convert_player_state(MMPlayerStateType state) return state +1; } -static bool __player_state_validate(player_s * handle, player_state_e threshold) +bool __player_state_validate(player_s * handle, player_state_e threshold) { if (handle->state < threshold) return FALSE; @@ -251,29 +440,71 @@ static int __unset_callback(_player_event_e type, player_h player) return PLAYER_ERROR_NONE; } +static void __job_prepared_cb(void *user_data) +{ + player_s * handle = (player_s*)user_data; + LOGI("Start"); + handle->is_doing_jobs = TRUE; + handle->state = PLAYER_STATE_READY; + ((player_prepared_cb)handle->user_cb[_PLAYER_EVENT_TYPE_PREPARE])(handle->user_data[_PLAYER_EVENT_TYPE_PREPARE]); + handle->user_cb[_PLAYER_EVENT_TYPE_PREPARE] = NULL; + handle->user_data[_PLAYER_EVENT_TYPE_PREPARE] = NULL; + __REMOVE_ECORE_JOB(handle, __JOB_KEY_PREPARED); + LOGI("End"); +} + +static void __job_error_cb(void *user_data) +{ + player_s * handle = (player_s*)user_data; + LOGI("Start"); + handle->is_doing_jobs = TRUE; + ((player_error_cb)handle->user_cb[_PLAYER_EVENT_TYPE_ERROR])(handle->error_code,handle->user_data[_PLAYER_EVENT_TYPE_ERROR]); + __REMOVE_ECORE_JOB(handle, __JOB_KEY_ERROR); + LOGI("End"); +} + +static void __job_seek_done_cb(void *user_data) +{ + player_s * handle = (player_s*)user_data; + LOGI("Start"); + handle->is_doing_jobs = TRUE; + ((player_seek_completed_cb)handle->user_cb[_PLAYER_EVENT_TYPE_SEEK])(handle->user_data[_PLAYER_EVENT_TYPE_SEEK]); + handle->user_cb[_PLAYER_EVENT_TYPE_SEEK] = NULL; + handle->user_data[_PLAYER_EVENT_TYPE_SEEK] = NULL; + __REMOVE_ECORE_JOB(handle, __JOB_KEY_SEEK_DONE); + LOGI("End"); +} + +static void __job_eos_cb(void *user_data) +{ + player_s * handle = (player_s*)user_data; + LOGI("Start"); + handle->is_doing_jobs = TRUE; + ((player_completed_cb)handle->user_cb[_PLAYER_EVENT_TYPE_COMPLETE])(handle->user_data[_PLAYER_EVENT_TYPE_COMPLETE]); + __REMOVE_ECORE_JOB(handle, __JOB_KEY_EOS); + LOGI("End"); +} + static int __msg_callback(int message, void *param, void *user_data) { player_s * handle = (player_s*)user_data; MMMessageParamType *msg = (MMMessageParamType*)param; - LOGE("[%s] Start : Got message type : 0x%x" ,__FUNCTION__, message); + LOGW("[%s] Got message type : 0x%x" ,__FUNCTION__, message); player_error_e err_code = PLAYER_ERROR_NONE; switch(message) { case MM_MESSAGE_ERROR: //0x01 - err_code = __convert_error_code(msg->code,(char*)__FUNCTION__); + err_code = __player_convert_error_code(msg->code,(char*)__FUNCTION__); break; case MM_MESSAGE_STATE_CHANGED: //0x03 - LOGE("STATE CHANGED INTERNALLY - from : %d, to : %d (CAPI State : %d)", msg->state.previous, msg->state.current, handle->state); + LOGI("STATE CHANGED INTERNALLY - from : %d, to : %d (CAPI State : %d)", msg->state.previous, msg->state.current, handle->state); if ((handle->is_progressive_download && msg->state.previous == MM_PLAYER_STATE_NULL && msg->state.current == MM_PLAYER_STATE_READY) || (msg->state.previous == MM_PLAYER_STATE_READY && msg->state.current == MM_PLAYER_STATE_PAUSED)) { if(handle->user_cb[_PLAYER_EVENT_TYPE_PREPARE]) // asyc && prepared cb has been set { - LOGE("[%s] Prepared! [current state : %d]", __FUNCTION__, handle->state); - handle->state = PLAYER_STATE_READY; - ((player_prepared_cb)handle->user_cb[_PLAYER_EVENT_TYPE_PREPARE])(handle->user_data[_PLAYER_EVENT_TYPE_PREPARE]); - handle->user_cb[_PLAYER_EVENT_TYPE_PREPARE] = NULL; - handle->user_data[_PLAYER_EVENT_TYPE_PREPARE] = NULL; + LOGI("[%s] Prepared! [current state : %d]", __FUNCTION__, handle->state); + __ADD_ECORE_JOB(handle, __JOB_KEY_PREPARED, __job_prepared_cb); } } break; @@ -284,13 +515,12 @@ static int __msg_callback(int message, void *param, void *user_data) } break; case MM_MESSAGE_BEGIN_OF_STREAM: //0x104 - MMTA_ACUM_ITEM_END("[CAPI] player_start ~ BOS", 0); - LOGE("[%s] Ready to streaming information (BOS) [current state : %d]", __FUNCTION__, handle->state); + LOGI("[%s] Ready to streaming information (BOS) [current state : %d]", __FUNCTION__, handle->state); break; case MM_MESSAGE_END_OF_STREAM://0x105 if( handle->user_cb[_PLAYER_EVENT_TYPE_COMPLETE] ) { - ((player_completed_cb)handle->user_cb[_PLAYER_EVENT_TYPE_COMPLETE])(handle->user_data[_PLAYER_EVENT_TYPE_COMPLETE]); + __ADD_ECORE_JOB(handle, __JOB_KEY_EOS, __job_eos_cb); } break; case MM_MESSAGE_BUFFERING: //0x103 @@ -311,7 +541,7 @@ static int __msg_callback(int message, void *param, void *user_data) } break; case MM_MESSAGE_CONNECTION_TIMEOUT: //0x102 - LOGE("[%s] PLAYER_ERROR_CONNECTION_FAILED (0x%08x) : CONNECTION_TIMEOUT" ,__FUNCTION__, PLAYER_ERROR_CONNECTION_FAILED); + LOGI("[%s] PLAYER_ERROR_CONNECTION_FAILED (0x%08x) : CONNECTION_TIMEOUT" ,__FUNCTION__, PLAYER_ERROR_CONNECTION_FAILED); err_code = PLAYER_ERROR_CONNECTION_FAILED; break; case MM_MESSAGE_UPDATE_SUBTITLE: //0x109 @@ -321,7 +551,7 @@ static int __msg_callback(int message, void *param, void *user_data) } break; case MM_MESSAGE_VIDEO_NOT_CAPTURED: //0x113 - LOGE("[%s] PLAYER_ERROR_VIDEO_CAPTURE_FAILED (0x%08x)",__FUNCTION__, PLAYER_ERROR_VIDEO_CAPTURE_FAILED); + LOGI("[%s] PLAYER_ERROR_VIDEO_CAPTURE_FAILED (0x%08x)",__FUNCTION__, PLAYER_ERROR_VIDEO_CAPTURE_FAILED); if( handle->user_cb[_PLAYER_EVENT_TYPE_ERROR] ) { ((player_error_cb)handle->user_cb[_PLAYER_EVENT_TYPE_ERROR])(PLAYER_ERROR_VIDEO_CAPTURE_FAILED,handle->user_data[_PLAYER_EVENT_TYPE_ERROR]); @@ -341,6 +571,30 @@ static int __msg_callback(int message, void *param, void *user_data) else { MMPlayerVideoCapture* capture = (MMPlayerVideoCapture *)msg->data; + + switch ( msg->captured_frame.orientation ) + { + case 0: + case 180: + { + /* use video resolution from above */ + } + break; + case 90: + case 270: + { + /* use calculated size during rotation */ + w = msg->captured_frame.width; + h = msg->captured_frame.height; + } + break; + default: + break; + } + + LOGI("[%s] captured image width : %d height : %d", __FUNCTION__, w, h); + + /* call application callback */ ((player_video_captured_cb)handle->user_cb[_PLAYER_EVENT_TYPE_CAPTURE])(capture->data, w, h, capture->size, handle->user_data[_PLAYER_EVENT_TYPE_CAPTURE]); if (capture->data) @@ -354,32 +608,22 @@ static int __msg_callback(int message, void *param, void *user_data) } break; case MM_MESSAGE_FILE_NOT_SUPPORTED: //0x10f - LOGE("[%s] PLAYER_ERROR_NOT_SUPPORTED_FILE (0x%08x) : FILE_NOT_SUPPORTED" ,__FUNCTION__, PLAYER_ERROR_NOT_SUPPORTED_FILE); + LOGI("[%s] PLAYER_ERROR_NOT_SUPPORTED_FILE (0x%08x) : FILE_NOT_SUPPORTED" ,__FUNCTION__, PLAYER_ERROR_NOT_SUPPORTED_FILE); err_code = PLAYER_ERROR_NOT_SUPPORTED_FILE; break; case MM_MESSAGE_FILE_NOT_FOUND: //0x110 - LOGE("[%s] PLAYER_ERROR_NOT_SUPPORTED_FILE (0x%08x) : FILE_NOT_FOUND" ,__FUNCTION__, PLAYER_ERROR_NOT_SUPPORTED_FILE); + LOGI("[%s] PLAYER_ERROR_NOT_SUPPORTED_FILE (0x%08x) : FILE_NOT_FOUND" ,__FUNCTION__, PLAYER_ERROR_NOT_SUPPORTED_FILE); err_code = PLAYER_ERROR_NOT_SUPPORTED_FILE; break; case MM_MESSAGE_SEEK_COMPLETED: //0x114 if (handle->display_type != ((int)MM_DISPLAY_SURFACE_NULL) && handle->state == PLAYER_STATE_READY) { if(handle->is_display_visible) - { - int ret = MM_ERROR_NONE; - ret = mm_player_set_attribute(handle->mm_handle, NULL,"display_visible" , 1, (char*)NULL); - if(ret != MM_ERROR_NONE) - { - LOGW("[%s] Failed to set display visible (0x%x)" ,__FUNCTION__, ret); - } - - } + mm_player_set_attribute(handle->mm_handle, NULL,"display_visible" , 1, (char*)NULL); } if( handle->user_cb[_PLAYER_EVENT_TYPE_SEEK]) { - ((player_seek_completed_cb)handle->user_cb[_PLAYER_EVENT_TYPE_SEEK])(handle->user_data[_PLAYER_EVENT_TYPE_SEEK]); - handle->user_cb[_PLAYER_EVENT_TYPE_SEEK] = NULL; - handle->user_data[_PLAYER_EVENT_TYPE_SEEK] = NULL; + __ADD_ECORE_JOB(handle, __JOB_KEY_SEEK_DONE, __job_seek_done_cb); } break; case MM_MESSAGE_UNKNOWN: //0x00 @@ -399,44 +643,138 @@ static int __msg_callback(int message, void *param, void *user_data) if(err_code != PLAYER_ERROR_NONE && handle->user_cb[_PLAYER_EVENT_TYPE_ERROR]) { - ((player_error_cb)handle->user_cb[_PLAYER_EVENT_TYPE_ERROR])(err_code,handle->user_data[_PLAYER_EVENT_TYPE_ERROR]); + handle->error_code = err_code; + __ADD_ECORE_JOB(handle, __JOB_KEY_ERROR, __job_error_cb); } - LOGE("[%s] End", __FUNCTION__); + LOGW("[%s] End", __FUNCTION__); return 1; } -static bool __video_stream_callback(void *stream, int stream_size, void *user_data, int width, int height) +static bool __video_stream_callback(void *stream, void *user_data) { player_s * handle = (player_s*)user_data; - if( handle->user_cb[_PLAYER_EVENT_TYPE_VIDEO_FRAME]) - { - if(handle->state==PLAYER_STATE_PLAYING) - ((player_video_frame_decoded_cb)handle->user_cb[_PLAYER_EVENT_TYPE_VIDEO_FRAME])((unsigned char *)stream, width, height, stream_size, handle->user_data[_PLAYER_EVENT_TYPE_VIDEO_FRAME]); - else - LOGE("[%s] Skip stream - current state : %d", __FUNCTION__,handle->state); - } - return TRUE; -} + MMPlayerVideoStreamDataType *video_stream = (MMPlayerVideoStreamDataType *)stream; + + if (handle->user_cb[_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME]) // media packet and zero-copy + { + media_packet_h pkt = NULL; + tbm_surface_h tsurf = NULL; + uint32_t bo_format = 0; + int i; + int bo_num; + int ret = 0; + media_format_mimetype_e mimetype = MEDIA_FORMAT_NV12; + bool make_pkt_fmt = false; + + /* create tbm surface */ + for (i = 0, bo_num = 0 ; i < BUFFER_MAX_PLANE_NUM ; i++) { + if (video_stream->bo[i]) { + bo_num++; + } + } -static bool __audio_stream_callback(void *stream, int stream_size, void *user_data) -{ - player_s * handle = (player_s*)user_data; - if( handle->user_cb[_PLAYER_EVENT_TYPE_AUDIO_FRAME] ) - { - if(handle->state==PLAYER_STATE_PLAYING) - ((player_audio_frame_decoded_cb)handle->user_cb[_PLAYER_EVENT_TYPE_AUDIO_FRAME])((unsigned char *)stream, stream_size, handle->user_data[_PLAYER_EVENT_TYPE_AUDIO_FRAME]); - else - LOGE("[%s] Skip stream - current state : %d", __FUNCTION__,handle->state); - } - return TRUE; -} + /* get tbm surface format */ + ret = _player_get_tbm_surface_format(video_stream->format, &bo_format); + ret |= _player_get_media_packet_mimetype(video_stream->format, &mimetype); + + if (bo_num > 0 && ret == PLAYER_ERROR_NONE) { + tsurf = tbm_surface_internal_create_with_bos(video_stream->width, video_stream->height, bo_format, (tbm_bo *)video_stream->bo, bo_num); + /*LOGD("tbm surface %p", tsurf);*/ + } else if (bo_num == 0) { + int plane_idx = 0; + tbm_surface_info_s tsuri; + unsigned char *ptr = video_stream->data; + + if (!ptr) return TRUE; + + tsurf = tbm_surface_create(video_stream->width, video_stream->height, bo_format); + if (tsurf) { + /* map surface to set data */ + if (tbm_surface_map (tsurf, TBM_SURF_OPTION_READ|TBM_SURF_OPTION_WRITE, &tsuri)) { + LOGE("tbm_surface_map failed"); + return TRUE; + } -static bool __video_frame_render_error_callback(void *param, void *user_data) -{ - player_s * handle = (player_s*)user_data; - if( handle->user_cb[_PLAYER_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR]) - { - ((player_x11_pixmap_error_cb)handle->user_cb[_PLAYER_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR])((unsigned int *)param, handle->user_data[_PLAYER_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR]); + for ( plane_idx = 0; plane_idx < tsuri.num_planes; plane_idx++ ) { + memcpy(tsuri.planes[plane_idx].ptr, ptr, tsuri.planes[plane_idx].size); + ptr += tsuri.planes[plane_idx].size; + } + } else { + LOGW("tbm_surface_create failed"); + } + } + + if (tsurf) { + /* check media packet format */ + if (handle->pkt_fmt) { + int pkt_fmt_width = 0; + int pkt_fmt_height = 0; + media_format_mimetype_e pkt_fmt_mimetype = MEDIA_FORMAT_NV12; + + media_format_get_video_info(handle->pkt_fmt, &pkt_fmt_mimetype, &pkt_fmt_width, &pkt_fmt_height, NULL, NULL); + if (pkt_fmt_mimetype != mimetype || + pkt_fmt_width != video_stream->width || + pkt_fmt_height != video_stream->height) { + LOGW("different format. current 0x%x, %dx%d, new 0x%x, %dx%d", + pkt_fmt_mimetype, pkt_fmt_width, pkt_fmt_height, mimetype, video_stream->width, video_stream->height); + media_format_unref(handle->pkt_fmt); + handle->pkt_fmt = NULL; + make_pkt_fmt = true; + } + } else { + make_pkt_fmt = true; + } + + /* create packet format */ + if (make_pkt_fmt) { + LOGW("make new pkt_fmt - mimetype 0x%x, %dx%d", mimetype, video_stream->width, video_stream->height); + ret = media_format_create(&handle->pkt_fmt); + if (ret == MEDIA_FORMAT_ERROR_NONE) { + ret = media_format_set_video_mime(handle->pkt_fmt, mimetype); + ret |= media_format_set_video_width(handle->pkt_fmt, video_stream->width); + ret |= media_format_set_video_height(handle->pkt_fmt, video_stream->height); + LOGW("media_format_set_video_mime,width,height ret : 0x%x", ret); + } else { + LOGW("media_format_create failed"); + } + } + + /* create media packet */ + ret = media_packet_create_from_tbm_surface(handle->pkt_fmt, tsurf, (media_packet_finalize_cb)_player_media_packet_finalize, (void *)handle, &pkt); + if (ret != MEDIA_PACKET_ERROR_NONE) { + LOGE("media_packet_create_from_tbm_surface failed"); + + tbm_surface_destroy(tsurf); + tsurf = NULL; + } + } else { + LOGE("failed to create tbm surface %dx%d, format %d, bo_num %d", video_stream->width, video_stream->height, video_stream->format, bo_num); + } + + if (pkt) { + /*LOGD("media packet %p, internal buffer %p", pkt, stream->internal_buffer);*/ + + /* set internal buffer */ + if (video_stream->internal_buffer) + ret = media_packet_set_extra(pkt, video_stream->internal_buffer); + + if (ret != MEDIA_PACKET_ERROR_NONE) { + LOGE("media_packet_set_extra failed"); + + media_packet_destroy(pkt); + pkt = NULL; + } else { + /* increase ref count of gst buffer */ + if (video_stream->internal_buffer) + gst_buffer_ref((GstBuffer *)video_stream->internal_buffer); + + /* call media packet callback */ + ((player_media_packet_video_decoded_cb)handle->user_cb[_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME])(pkt, handle->user_data[_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME]); + + if (bo_num == 0) + tbm_surface_unmap(tsurf); + } + } } return TRUE; } @@ -463,64 +801,36 @@ static int __pd_message_callback(int message, void *param, void *user_data) } return 0; } - -static bool __supported_audio_effect_type (int filter, int type, void *user_data) +static void __job_key_to_remove(gpointer key) { - player_s * handle = (player_s*)user_data; - if(filter != MM_AUDIO_EFFECT_TYPE_CUSTOM || type == MM_AUDIO_EFFECT_CUSTOM_EQ) - { - LOGI("[%s] Skip invalid filter: %d or type : %d",__FUNCTION__, filter, type); - return TRUE; - } - - if( handle->user_cb[_PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT] ) - { - return ((player_audio_effect_supported_effect_cb)handle->user_cb[_PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT])(type, handle->user_data[_PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT]); - } - return FALSE; + LOGI("%s",key); + g_free(key); } -static bool __supported_audio_effect_preset (int filter, int type, void *user_data) +static void __job_value_to_destroy(gpointer value) { - player_s * handle = (player_s*)user_data; - if(filter != MM_AUDIO_EFFECT_TYPE_PRESET) - { - LOGI("[%s] Skip invalid filter: %d or type : %d",__FUNCTION__, filter, type); - return TRUE; - } - - if( handle->user_cb[_PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT_PRESET] ) - { - return ((player_audio_effect_supported_effect_cb)handle->user_cb[_PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT_PRESET])(type, handle->user_data[_PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT_PRESET]); - } - return FALSE; + Ecore_Job *job = (Ecore_Job *)value; + LOGI("%p", job); + __DELETE_ECORE_ITEM(job); } - /* * Public Implementation */ int player_create (player_h *player) { - LOGE("[%s] Start", __FUNCTION__); PLAYER_INSTANCE_CHECK(player); - MMTA_INIT(); - MMTA_ACUM_ITEM_BEGIN("[CoreAPI] player_create", 0); player_s * handle; handle = (player_s*)malloc( sizeof(player_s)); - if (handle != NULL) - { - LOGE("[%s] Start, %p", __FUNCTION__, handle); + if (handle != NULL) memset(handle, 0 , sizeof(player_s)); - } else { LOGE("[%s] PLAYER_ERROR_OUT_OF_MEMORY(0x%08x)" ,__FUNCTION__,PLAYER_ERROR_OUT_OF_MEMORY); return PLAYER_ERROR_OUT_OF_MEMORY; } int ret = mm_player_create(&handle->mm_handle); - MMTA_ACUM_ITEM_END("[CoreAPI] player_create", 0); if( ret != MM_ERROR_NONE) { LOGE("[%s] PLAYER_ERROR_INVALID_OPERATION(0x%08x)" ,__FUNCTION__,PLAYER_ERROR_INVALID_OPERATION); @@ -536,26 +846,38 @@ int player_create (player_h *player) handle->display_type = MM_DISPLAY_SURFACE_NULL; // means DISPLAY_TYPE_NONE(3) handle->is_stopped=false; handle->is_display_visible=true; - LOGE("[%s] End, new handle : %p", __FUNCTION__, *player); + handle->ecore_jobs = g_hash_table_new_full(g_str_hash, g_str_equal, __job_key_to_remove, __job_value_to_destroy); + LOGI("[%s] new handle : %p", __FUNCTION__, *player); return PLAYER_ERROR_NONE; } } int player_destroy (player_h player) { - LOGE("[%s] Start, handle to destroy : %p", __FUNCTION__, player); + LOGI("[%s] Start, handle to destroy : %p", __FUNCTION__, player); PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; - MMTA_ACUM_ITEM_SHOW_RESULT_TO(MMTA_SHOW_FILE); - MMTA_RELEASE(); - - if (handle->prepare_async_thread) + if (handle->is_doing_jobs) { - pthread_join(handle->prepare_async_thread, NULL); - handle->prepare_async_thread = 0; + LOGE("jobs not completed. can't do destroy"); + return PLAYER_ERROR_INVALID_OPERATION; + } + + g_hash_table_remove_all(handle->ecore_jobs); + g_hash_table_unref(handle->ecore_jobs); + + __RELEASEIF_PREPARE_THREAD(handle->prepare_async_thread); + + int ret = mm_player_destroy(handle->mm_handle); + + if (handle->pkt_fmt) { + media_format_unref(handle->pkt_fmt); + handle->pkt_fmt = NULL; } - if (mm_player_destroy(handle->mm_handle)!= MM_ERROR_NONE) + LOGI("[%s] Done mm_player_destroy", __FUNCTION__); + + if (ret != MM_ERROR_NONE) { LOGE("[%s] PLAYER_ERROR_INVALID_OPERATION(0x%08x)" ,__FUNCTION__,PLAYER_ERROR_INVALID_OPERATION); return PLAYER_ERROR_INVALID_OPERATION; @@ -565,7 +887,7 @@ int player_destroy (player_h player) handle->state = PLAYER_STATE_NONE; free(handle); handle= NULL; - LOGE("[%s] End", __FUNCTION__); + LOGI("[%s] End", __FUNCTION__); return PLAYER_ERROR_NONE; } } @@ -575,24 +897,37 @@ __prepare_async_thread_func(void *data) { player_s *handle = data; int ret = MM_ERROR_NONE; - LOGE("[%s] Start", __FUNCTION__); + LOGI("[%s]", __FUNCTION__); ret = mm_player_pause(handle->mm_handle); - if(ret != MM_ERROR_NONE) // MM_MESSAGE_ERROR should be posted through __msg_callback + if(ret != MM_ERROR_NONE) { LOGE("[%s] Failed to pause - core fw error(0x%x)", __FUNCTION__, ret); + /*MM_MESSAGE_ERROR will not be posted as player_prepare(sync API) works with return value + of mm_player_pause So in case of async API we post the error message to application from here*/ + MMMessageParamType msg_param; + msg_param.code = ret; + __msg_callback(MM_MESSAGE_ERROR, (void *)&msg_param, (void *)handle); + + ret = mm_player_unrealize(handle->mm_handle); + if (ret != MM_ERROR_NONE) + LOGE("[%s] Failed to unrealize - 0x%x", __FUNCTION__,ret); } - LOGE("[%s] End", __FUNCTION__); + LOGI("[%s], done", __FUNCTION__); return NULL; } int player_prepare_async (player_h player, player_prepared_cb callback, void* user_data) { - LOGE("[%s] Start", __FUNCTION__); + LOGI("[%s] Start", __FUNCTION__); PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; PLAYER_STATE_CHECK(handle,PLAYER_STATE_IDLE); + int ret; + int visible; + int value; + if(handle->user_cb[_PLAYER_EVENT_TYPE_PREPARE]) { LOGE("[%s] PLAYER_ERROR_INVALID_OPERATION (0x%08x) : preparing... we can't do any more " ,__FUNCTION__, PLAYER_ERROR_INVALID_OPERATION); @@ -600,12 +935,11 @@ int player_prepare_async (player_h player, player_prepared_cb callback, void* us } else { - LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_PREPARE); + //LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_PREPARE); handle->user_cb[_PLAYER_EVENT_TYPE_PREPARE] = callback; handle->user_data[_PLAYER_EVENT_TYPE_PREPARE] = user_data; } - int ret; ret = mm_player_set_message_callback(handle->mm_handle, __msg_callback, (void*)handle); if(ret != MM_ERROR_NONE) { @@ -622,24 +956,32 @@ int player_prepare_async (player_h player, player_prepared_cb callback, void* us } else { - ret = mm_player_set_attribute(handle->mm_handle, NULL,"display_visible", 0, (char*)NULL); - if(ret != MM_ERROR_NONE) - { - LOGW("[%s] Failed to set display visible (0x%x)" ,__FUNCTION__, ret); - } - } + ret = mm_player_get_attribute(handle->mm_handle, NULL,"display_visible" ,&visible, (char*)NULL); + if(ret != MM_ERROR_NONE) + { + return __player_convert_error_code(ret,(char*)__FUNCTION__); + } + if(!visible) + { + value = FALSE; + } + else + { + value = TRUE; + } - ret = mm_player_set_attribute(handle->mm_handle, NULL, "profile_prepare_async", 1, (char*)NULL); - if(ret != MM_ERROR_NONE) - { - LOGE("[%s] Failed to set profile_async_start '1' (0x%x)" ,__FUNCTION__, ret); + ret = mm_player_set_attribute(handle->mm_handle, NULL, "display_visible", value, (char*)NULL); + if(ret != MM_ERROR_NONE) + { + return __player_convert_error_code(ret,(char*)__FUNCTION__); + } } ret = mm_player_realize(handle->mm_handle); if(ret != MM_ERROR_NONE) { LOGE("[%s] Failed to realize - 0x%x", __FUNCTION__, ret); - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } if (!handle->is_progressive_download) @@ -654,19 +996,20 @@ int player_prepare_async (player_h player, player_prepared_cb callback, void* us } } - LOGE("[%s] End", __FUNCTION__); + LOGI("[%s] End", __FUNCTION__); return PLAYER_ERROR_NONE; } int player_prepare (player_h player) { - LOGE("[%s] Start", __FUNCTION__); + LOGI("[%s] Start", __FUNCTION__); PLAYER_INSTANCE_CHECK(player); - MMTA_ACUM_ITEM_BEGIN("[CoreAPI] player_prepare", 0); player_s * handle = (player_s *) player; PLAYER_STATE_CHECK(handle,PLAYER_STATE_IDLE); int ret; + int visible; + int value; ret = mm_player_set_message_callback(handle->mm_handle, __msg_callback, (void*)handle); if(ret != MM_ERROR_NONE) { @@ -683,7 +1026,22 @@ int player_prepare (player_h player) } else { - ret = mm_player_set_attribute(handle->mm_handle, NULL,"display_visible" , 0, (char*)NULL); + ret = mm_player_get_attribute(handle->mm_handle, NULL,"display_visible" ,&visible, (char*)NULL); + if(ret != MM_ERROR_NONE) + { + return __player_convert_error_code(ret,(char*)__FUNCTION__); + } + if(!visible) + { + value = FALSE; + } + else + { + value = TRUE; + } + + mm_player_set_attribute(handle->mm_handle, NULL, "display_visible", value, (char*)NULL); + if(ret != MM_ERROR_NONE) { LOGW("[%s] Failed to set display display_visible '0' (0x%x)" ,__FUNCTION__, ret); @@ -694,51 +1052,71 @@ int player_prepare (player_h player) if(ret != MM_ERROR_NONE) { LOGE("[%s] Failed to realize - 0x%x", __FUNCTION__,ret); - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } if (!handle->is_progressive_download) ret = mm_player_pause(handle->mm_handle); - MMTA_ACUM_ITEM_END("[CoreAPI] player_prepare", 0); if(ret != MM_ERROR_NONE) { + int uret; + uret = mm_player_unrealize(handle->mm_handle); + if (uret != MM_ERROR_NONE) + LOGE("[%s] Failed to unrealize - 0x%x", __FUNCTION__,uret); + LOGE("[%s] Failed to pause - 0x%x", __FUNCTION__,ret); - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { handle->state = PLAYER_STATE_READY; - LOGE("[%s] End", __FUNCTION__); + LOGI("[%s] End", __FUNCTION__); return PLAYER_ERROR_NONE; } } int player_unprepare (player_h player) { - LOGE("[%s] Start", __FUNCTION__); + LOGI("[%s] Start", __FUNCTION__); PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; - if (!__player_state_validate(handle, PLAYER_STATE_READY)) + + if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) { LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state); return PLAYER_ERROR_INVALID_STATE; } + __RELEASEIF_PREPARE_THREAD(handle->prepare_async_thread); + int ret = mm_player_unrealize(handle->mm_handle); + if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { + if (handle->user_cb[_PLAYER_EVENT_TYPE_SEEK]) + { + handle->user_cb[_PLAYER_EVENT_TYPE_SEEK] = NULL; + handle->user_data[_PLAYER_EVENT_TYPE_SEEK] = NULL; + } + + if (handle->user_cb[_PLAYER_EVENT_TYPE_PREPARE]) + { + handle->user_cb[_PLAYER_EVENT_TYPE_PREPARE] = NULL; + handle->user_data[_PLAYER_EVENT_TYPE_PREPARE] = NULL; + } + handle->state = PLAYER_STATE_IDLE; handle->display_type = MM_DISPLAY_SURFACE_NULL; // means DISPLAY_TYPE_NONE(3) handle->is_set_pixmap_cb = false; handle->is_stopped=false; handle->is_display_visible=true; handle->is_progressive_download=false; - LOGE("[%s] End", __FUNCTION__); + LOGI("[%s] End", __FUNCTION__); return PLAYER_ERROR_NONE; } } @@ -750,14 +1128,66 @@ int player_set_uri (player_h player, const char *uri) player_s * handle = (player_s *) player; PLAYER_STATE_CHECK(handle,PLAYER_STATE_IDLE); - int uri_length = strlen(uri); - int ret = mm_player_set_attribute(handle->mm_handle, NULL,MM_PLAYER_CONTENT_URI , uri, uri_length, (char*)NULL); + int ret = mm_player_set_uri(handle->mm_handle, uri); + + if(ret != MM_ERROR_NONE) + { + return __player_convert_error_code(ret,(char*)__FUNCTION__); + } + else + return PLAYER_ERROR_NONE; +} + +int player_set_next_uri (player_h player, const char *uri) +{ + PLAYER_INSTANCE_CHECK(player); + player_s * handle = (player_s *) player; + if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) + { + LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state); + return PLAYER_ERROR_INVALID_STATE; + } + + int ret = mm_player_set_next_uri(handle->mm_handle, uri); + + if(ret != MM_ERROR_NONE) + { + return __player_convert_error_code(ret,(char*)__FUNCTION__); + } + else + return PLAYER_ERROR_NONE; +} + +int player_get_next_uri (player_h player, char **uri) +{ + PLAYER_INSTANCE_CHECK(player); + player_s * handle = (player_s *) player; + char* next_uri = NULL; + + if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) + { + LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state); + return PLAYER_ERROR_INVALID_STATE; + } + + int ret = mm_player_get_next_uri(handle->mm_handle, &next_uri); + if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else + { + *uri = NULL; + if(next_uri != NULL) + { + *uri = strdup(next_uri); + free(next_uri); + } + + next_uri = NULL; return PLAYER_ERROR_NONE; + } } int player_set_memory_buffer (player_h player, const void *data, int size) @@ -774,7 +1204,7 @@ int player_set_memory_buffer (player_h player, const void *data, int size) int ret = mm_player_set_attribute(handle->mm_handle, NULL,MM_PLAYER_CONTENT_URI, uri, strlen(uri), MM_PLAYER_MEMORY_SRC, data,size,(char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else return PLAYER_ERROR_NONE; @@ -788,7 +1218,7 @@ int player_get_state (player_h player, player_state_e *state) *state = handle->state; MMPlayerStateType currentStat = MM_PLAYER_STATE_NULL; mm_player_get_state(handle->mm_handle, ¤tStat); - LOGI("[%s] State : %d (FW state : %d)", __FUNCTION__,handle->state, currentStat); + //LOGI("[%s] State : %d (FW state : %d)", __FUNCTION__,handle->state, currentStat); return PLAYER_ERROR_NONE; } @@ -804,7 +1234,7 @@ int player_set_volume (player_h player, float left, float right) int ret = mm_player_set_volume(handle->mm_handle,&vol); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -822,7 +1252,7 @@ int player_get_volume (player_h player, float *left, float *right) int ret = mm_player_get_volume(handle->mm_handle,&vol); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -846,7 +1276,7 @@ int player_set_sound_type(player_h player, sound_type_e type) int ret = mm_player_set_attribute(handle->mm_handle, NULL,"sound_volume_type" , type, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else return PLAYER_ERROR_NONE; @@ -857,9 +1287,9 @@ int player_set_audio_latency_mode(player_h player, audio_latency_mode_e latency_ PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; - int ret = mm_player_set_attribute(handle->mm_handle, NULL,"audio_latency_mode" , latency_mode, (char*)NULL); + int ret = mm_player_set_attribute(handle->mm_handle, NULL,"sound_latency_mode" , latency_mode, (char*)NULL); if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); else return PLAYER_ERROR_NONE; } @@ -870,29 +1300,26 @@ int player_get_audio_latency_mode(player_h player, audio_latency_mode_e *latency PLAYER_NULL_ARG_CHECK(latency_mode); player_s * handle = (player_s *) player; - int ret = mm_player_get_attribute(handle->mm_handle, NULL,"audio_latency_mode" , latency_mode, (char*)NULL); + int ret = mm_player_get_attribute(handle->mm_handle, NULL,"sound_latency_mode" , latency_mode, (char*)NULL); if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); else return PLAYER_ERROR_NONE; } int player_start (player_h player) { - LOGE("[%s] Start", __FUNCTION__); + LOGI("[%s] Start", __FUNCTION__); PLAYER_INSTANCE_CHECK(player); - MMTA_ACUM_ITEM_BEGIN("[CAPI] player_start only", 0); - MMTA_ACUM_ITEM_BEGIN("[CAPI] player_start ~ BOS", 0); player_s * handle = (player_s *) player; int ret; if ( handle->state ==PLAYER_STATE_READY || handle->state ==PLAYER_STATE_PAUSED) { - if(handle->display_type == PLAYER_DISPLAY_TYPE_X11 || handle->display_type == PLAYER_DISPLAY_TYPE_EVAS) + if(handle->display_type == PLAYER_DISPLAY_TYPE_OVERLAY || handle->display_type == PLAYER_DISPLAY_TYPE_EVAS) { if(handle->is_display_visible) { ret = mm_player_set_attribute(handle->mm_handle, NULL,"display_visible" , 1, (char*)NULL); - LOGE("[%s] show video display : %d",__FUNCTION__, ret); } } @@ -905,7 +1332,7 @@ int player_start (player_h player) } ret = mm_player_start(handle->mm_handle); - LOGE("[%s] stop -> start() ",__FUNCTION__); + LOGI("[%s] stop -> start() ",__FUNCTION__); } else { @@ -923,43 +1350,48 @@ int player_start (player_h player) if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { handle->is_stopped = FALSE; handle->state = PLAYER_STATE_PLAYING; - LOGE("[%s] End", __FUNCTION__); + LOGI("[%s] End", __FUNCTION__); return PLAYER_ERROR_NONE; } } int player_stop (player_h player) { - LOGE("[%s] Start", __FUNCTION__); + LOGI("[%s] Start", __FUNCTION__); PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; if (handle->state == PLAYER_STATE_PLAYING || handle->state == PLAYER_STATE_PAUSED) { int ret = mm_player_stop(handle->mm_handle); + + if(handle->display_type == PLAYER_DISPLAY_TYPE_OVERLAY || handle->display_type == PLAYER_DISPLAY_TYPE_EVAS) + { + ret = mm_player_set_attribute(handle->mm_handle, NULL,"display_visible" , 0, (char*)NULL); + } + if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } - if(handle->display_type == PLAYER_DISPLAY_TYPE_X11 || handle->display_type == PLAYER_DISPLAY_TYPE_EVAS) + else { - ret = mm_player_set_attribute(handle->mm_handle, NULL,"display_visible" , 0, (char*)NULL); - if(ret != MM_ERROR_NONE) + if (handle->user_cb[_PLAYER_EVENT_TYPE_SEEK]) { - return __convert_error_code(ret,(char*)__FUNCTION__); + handle->user_cb[_PLAYER_EVENT_TYPE_SEEK] = NULL; + handle->user_data[_PLAYER_EVENT_TYPE_SEEK] = NULL; } - LOGE("[%s] show video display : %d",__FUNCTION__, ret); - } - handle->state = PLAYER_STATE_READY; - handle->is_stopped = TRUE; - LOGE("[%s] End", __FUNCTION__); - return PLAYER_ERROR_NONE; + handle->state = PLAYER_STATE_READY; + handle->is_stopped = TRUE; + LOGI("[%s] End", __FUNCTION__); + return PLAYER_ERROR_NONE; + } } else { @@ -970,7 +1402,7 @@ int player_stop (player_h player) int player_pause (player_h player) { - LOGE("[%s] Start", __FUNCTION__); + LOGI("[%s] Start", __FUNCTION__); PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; PLAYER_STATE_CHECK(handle,PLAYER_STATE_PLAYING); @@ -978,12 +1410,12 @@ int player_pause (player_h player) int ret = mm_player_pause(handle->mm_handle); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { handle->state = PLAYER_STATE_PAUSED; - LOGE("[%s] End", __FUNCTION__); + LOGI("[%s] End", __FUNCTION__); return PLAYER_ERROR_NONE; } } @@ -992,7 +1424,6 @@ int player_set_position (player_h player, int millisecond, player_seek_completed { PLAYER_INSTANCE_CHECK(player); PLAYER_CHECK_CONDITION(millisecond>=0 ,PLAYER_ERROR_INVALID_PARAMETER ,"PLAYER_ERROR_INVALID_PARAMETER" ); - player_s * handle = (player_s *) player; if (!__player_state_validate(handle, PLAYER_STATE_READY)) { @@ -1007,20 +1438,22 @@ int player_set_position (player_h player, int millisecond, player_seek_completed } else { - LOGE("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_SEEK); + LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_SEEK); handle->user_cb[_PLAYER_EVENT_TYPE_SEEK] = callback; handle->user_data[_PLAYER_EVENT_TYPE_SEEK] = user_data; } int ret = mm_player_set_attribute(handle->mm_handle, NULL, "accurate_seek", 1, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } ret = mm_player_set_position(handle->mm_handle, MM_PLAYER_POS_FORMAT_TIME, millisecond); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + handle->user_cb[_PLAYER_EVENT_TYPE_SEEK] = NULL; + handle->user_data[_PLAYER_EVENT_TYPE_SEEK] = NULL; + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1028,7 +1461,7 @@ int player_set_position (player_h player, int millisecond, player_seek_completed } } -int player_seek (player_h player, int millisecond, bool accurate, player_seek_completed_cb callback, void *user_data) +int player_set_play_position (player_h player, int millisecond, bool accurate, player_seek_completed_cb callback, void *user_data) { PLAYER_INSTANCE_CHECK(player); PLAYER_CHECK_CONDITION(millisecond>=0 ,PLAYER_ERROR_INVALID_PARAMETER ,"PLAYER_ERROR_INVALID_PARAMETER" ); @@ -1046,7 +1479,7 @@ int player_seek (player_h player, int millisecond, bool accurate, player_seek_co } else { - LOGE("[%s] Event type : %d, pos : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_SEEK, millisecond); + LOGI("[%s] Event type : %d, pos : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_SEEK, millisecond); handle->user_cb[_PLAYER_EVENT_TYPE_SEEK] = callback; handle->user_data[_PLAYER_EVENT_TYPE_SEEK] = user_data; } @@ -1054,41 +1487,14 @@ int player_seek (player_h player, int millisecond, bool accurate, player_seek_co int ret = mm_player_set_attribute(handle->mm_handle, NULL, "accurate_seek", accurated, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } ret = mm_player_set_position(handle->mm_handle, MM_PLAYER_POS_FORMAT_TIME, millisecond); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); - } - else - { - return PLAYER_ERROR_NONE; - } -} - -int player_set_position_ratio (player_h player, int percent, player_seek_completed_cb callback, void *user_data) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_CHECK_CONDITION(percent>=0 && percent <= 100 ,PLAYER_ERROR_INVALID_PARAMETER ,"PLAYER_ERROR_INVALID_PARAMETER" ); - - player_s * handle = (player_s *) player; - if(handle->user_cb[_PLAYER_EVENT_TYPE_SEEK]) - { - LOGE("[%s] PLAYER_ERROR_SEEK_FAILED (0x%08x) : seeking... we can't do any more " ,__FUNCTION__, PLAYER_ERROR_SEEK_FAILED); - return PLAYER_ERROR_SEEK_FAILED; - } - else - { - LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_SEEK); - handle->user_cb[_PLAYER_EVENT_TYPE_SEEK] = callback; - handle->user_data[_PLAYER_EVENT_TYPE_SEEK] = user_data; - } - - int ret = mm_player_set_position(handle->mm_handle, MM_PLAYER_POS_FORMAT_PERCENT , percent); - if(ret != MM_ERROR_NONE) - { - return __convert_error_code(ret,(char*)__FUNCTION__); + handle->user_cb[_PLAYER_EVENT_TYPE_SEEK] = NULL; + handle->user_data[_PLAYER_EVENT_TYPE_SEEK] = NULL; + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1096,7 +1502,7 @@ int player_set_position_ratio (player_h player, int percent, player_seek_complet } } -int player_get_position (player_h player, int *millisecond) +int player_get_play_position (player_h player, int *millisecond) { PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(millisecond); @@ -1110,7 +1516,7 @@ int player_get_position (player_h player, int *millisecond) int ret = mm_player_get_position(handle->mm_handle, MM_PLAYER_POS_FORMAT_TIME , &pos); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1119,30 +1525,7 @@ int player_get_position (player_h player, int *millisecond) } } -int player_get_position_ratio (player_h player,int *percent) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(percent); - player_s * handle = (player_s *) player; - if (!__player_state_validate(handle, PLAYER_STATE_READY)) - { - LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state); - return PLAYER_ERROR_INVALID_STATE; - } - int pos; - int ret = mm_player_get_position(handle->mm_handle, MM_PLAYER_POS_FORMAT_PERCENT, &pos); - if(ret != MM_ERROR_NONE) - { - return __convert_error_code(ret,(char*)__FUNCTION__); - } - else - { - *percent=pos; - return PLAYER_ERROR_NONE; - } -} - -int player_set_mute (player_h player, bool muted) +int player_set_mute (player_h player, bool muted) { PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; @@ -1150,7 +1533,7 @@ int player_set_mute (player_h player, bool muted) int ret = mm_player_set_mute(handle->mm_handle, muted); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1168,7 +1551,7 @@ int player_is_muted (player_h player, bool *muted) int ret = mm_player_get_mute(handle->mm_handle, &_mute); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1203,7 +1586,7 @@ int player_set_looping (player_h player, bool looping) if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1225,7 +1608,7 @@ int player_is_looping (player_h player, bool *looping) int ret = mm_player_get_attribute(handle->mm_handle, NULL,MM_PLAYER_PLAYBACK_COUNT , &count, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1255,12 +1638,12 @@ int player_get_duration (player_h player, int *duration) int ret = mm_player_get_attribute(handle->mm_handle, NULL,MM_PLAYER_CONTENT_DURATION, &_duration, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { *duration = _duration; - LOGI("[%s] duration : %d",__FUNCTION__,_duration); + //LOGI("[%s] duration : %d",__FUNCTION__,_duration); return PLAYER_ERROR_NONE; } } @@ -1269,6 +1652,9 @@ int player_set_display(player_h player, player_display_type_e type, player_displ { PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; + Evas_Object *obj = NULL; + const char *object_type = NULL; + void *set_handle = NULL; int ret; if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) @@ -1277,6 +1663,12 @@ int player_set_display(player_h player, player_display_type_e type, player_displ return PLAYER_ERROR_INVALID_STATE; } + if (type != PLAYER_DISPLAY_TYPE_NONE && display == NULL) + { + LOGE("display type[%d] is not NONE, but display handle is NULL", type); + return PLAYER_ERROR_INVALID_PARAMETER; + } + if (handle->is_set_pixmap_cb) { if (handle->state < PLAYER_STATE_READY) @@ -1292,12 +1684,57 @@ int player_set_display(player_h player, player_display_type_e type, player_displ } } - void* temp; + void* temp = NULL; + if (type == PLAYER_DISPLAY_TYPE_NONE) + { + /* NULL surface */ + handle->display_handle = 0; + handle->display_type = (int)MM_DISPLAY_SURFACE_NULL; + set_handle = NULL; + } + else + { + /* get handle from overlay or evas surface */ + obj = (Evas_Object *)display; + object_type = evas_object_type_get(obj); + if (object_type) + { + temp = handle->display_handle; + if (type == PLAYER_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) + { + /* x window overlay surface */ + LOGI("overlay surface type"); + handle->display_handle = (void *)elm_win_xwindow_get(obj); + set_handle = &(handle->display_handle); + } + else if (type == PLAYER_DISPLAY_TYPE_EVAS && !strcmp(object_type, "image")) + { + /* evas object surface */ + LOGI("evas surface type"); + handle->display_handle = display; + set_handle = display; + } + else + { + LOGE("invalid surface type"); + return PLAYER_ERROR_INVALID_PARAMETER; + } + } + else + { + LOGE("falied to get evas object type from %p", obj); + return PLAYER_ERROR_INVALID_PARAMETER; + } + } + + /* set display handle */ if (handle->display_type == (int)MM_DISPLAY_SURFACE_NULL || type == handle->display_type) // first time or same type { - temp = handle->display_handle; - handle->display_handle = display; - ret = mm_player_set_attribute(handle->mm_handle, NULL, "display_surface_type", type, "display_overlay" , type == PLAYER_DISPLAY_TYPE_X11 ? &handle->display_handle : display, sizeof(display), (char*)NULL); + ret = mm_player_set_attribute(handle->mm_handle, NULL, + "display_surface_type", type, + "display_overlay", set_handle, + sizeof(display), (char*)NULL); + if (ret != MM_ERROR_NONE) { handle->display_handle = temp; @@ -1305,17 +1742,19 @@ int player_set_display(player_h player, player_display_type_e type, player_displ } else { - handle->display_type = type; - LOGE("[%s] video display has been changed- type :%d, addr : 0x%x",__FUNCTION__,handle->display_type, handle->display_handle); + if (type != PLAYER_DISPLAY_TYPE_NONE) + { + handle->display_type = type; + LOGI("[%s] video display has been changed- type :%d, addr : 0x%x", + __FUNCTION__,handle->display_type, handle->display_handle); + } + else + LOGI("NULL surface"); } - LOGE("[%s] video display has been updated - type :%d",__FUNCTION__,type); } else //changing surface case { - temp = handle->display_handle; - handle->display_handle = display; - - ret = mm_player_change_videosink(handle->mm_handle, type, type == PLAYER_DISPLAY_TYPE_X11 ? &handle->display_handle : display); + ret = mm_player_change_videosink(handle->mm_handle, type, set_handle); if (ret != MM_ERROR_NONE) { handle->display_handle = temp; @@ -1332,62 +1771,32 @@ int player_set_display(player_h player, player_display_type_e type, player_displ else { handle->display_type = type; - LOGE("[%s] video display has been changed- type :%d, addr : 0x%x",__FUNCTION__,handle->display_type, handle->display_handle); + LOGI("[%s] video display has been changed- type :%d, addr : 0x%x", + __FUNCTION__,handle->display_type, handle->display_handle); } } if(ret != MM_ERROR_NONE) { handle->display_type = MM_DISPLAY_SURFACE_NULL; - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { - LOGE("[%s] End",__FUNCTION__); return PLAYER_ERROR_NONE; } } -int player_is_display_mode_changeable(player_h player, bool* changeable) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(changeable); - player_s * handle = (player_s *) player; - switch(handle->display_type) - { - case PLAYER_DISPLAY_TYPE_X11: - *changeable = TRUE; - break; - case PLAYER_DISPLAY_TYPE_EVAS: - { - char *sink_name = NULL; - int length; - int scaling; - int ret = mm_player_get_attribute(handle->mm_handle, NULL,"display_evas_surface_sink" ,&sink_name, &length, "display_evas_do_scaling", &scaling, (char*)NULL); - if(ret != MM_ERROR_NONE) - *changeable = FALSE; - if (!strncmp(sink_name,"evaspixmapsink",length) && scaling==1) - { - *changeable = TRUE; - } - break; - } - default: - *changeable = FALSE; - break; - } - return PLAYER_ERROR_NONE; -} - int player_set_display_mode(player_h player, player_display_mode_e mode) { PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; + LOGI("[%s] mode:%d", __FUNCTION__, mode); int ret = mm_player_set_attribute(handle->mm_handle, NULL,"display_method" , mode, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else return PLAYER_ERROR_NONE; @@ -1401,7 +1810,7 @@ int player_get_display_mode(player_h player, player_display_mode_e *mode) int ret = mm_player_get_attribute(handle->mm_handle, NULL,"display_method" ,mode, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1411,7 +1820,7 @@ int player_get_display_mode(player_h player, player_display_mode_e *mode) int player_set_playback_rate(player_h player, float rate) { - LOGE("[%s] rate : %0.1f", __FUNCTION__, rate); + LOGI("[%s] rate : %0.1f", __FUNCTION__, rate); PLAYER_INSTANCE_CHECK(player); PLAYER_CHECK_CONDITION(rate>=-5.0 && rate <= 5.0 ,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER" ); player_s * handle = (player_s *) player; @@ -1436,13 +1845,13 @@ int player_set_playback_rate(player_h player, float rate) ret = PLAYER_ERROR_INVALID_OPERATION; break; default: - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } return ret; } -int player_set_x11_display_rotation(player_h player, player_display_rotation_e rotation) +int player_set_display_rotation(player_h player, player_display_rotation_e rotation) { PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; @@ -1450,13 +1859,13 @@ int player_set_x11_display_rotation(player_h player, player_display_rotation_e r int ret = mm_player_set_attribute(handle->mm_handle, NULL,MM_PLAYER_VIDEO_ROTATION , rotation, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else return PLAYER_ERROR_NONE; } -int player_get_x11_display_rotation( player_h player, player_display_rotation_e *rotation) +int player_get_display_rotation( player_h player, player_display_rotation_e *rotation) { PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(rotation); @@ -1464,7 +1873,7 @@ int player_get_x11_display_rotation( player_h player, player_display_rotation_e int ret = mm_player_get_attribute(handle->mm_handle, NULL,MM_PLAYER_VIDEO_ROTATION ,rotation, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1472,7 +1881,7 @@ int player_get_x11_display_rotation( player_h player, player_display_rotation_e } } -int player_set_x11_display_visible(player_h player, bool visible) +int player_set_display_visible(player_h player, bool visible) { PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; @@ -1486,7 +1895,7 @@ int player_set_x11_display_visible(player_h player, bool visible) int ret = mm_player_set_attribute(handle->mm_handle, NULL,"display_visible" , value, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1495,7 +1904,7 @@ int player_set_x11_display_visible(player_h player, bool visible) } } -int player_is_x11_display_visible(player_h player, bool* visible) +int player_is_display_visible(player_h player, bool* visible) { PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(visible); @@ -1504,7 +1913,7 @@ int player_is_x11_display_visible(player_h player, bool* visible) int ret = mm_player_get_attribute(handle->mm_handle, NULL,"display_visible" ,&count, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1521,202 +1930,6 @@ int player_is_x11_display_visible(player_h player, bool* visible) } } -int player_set_x11_display_zoom(player_h player, int level) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_CHECK_CONDITION(level>0 && level < 10 ,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER" ); - - player_s * handle = (player_s *) player; - int ret = mm_player_set_attribute(handle->mm_handle, NULL,"display_zoom" , level, (char*)NULL); - if(ret != MM_ERROR_NONE) - { - return __convert_error_code(ret,(char*)__FUNCTION__); - } - else - return PLAYER_ERROR_NONE; -} - -int player_get_x11_display_zoom( player_h player, int *level) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(level); - player_s * handle = (player_s *) player; - int _level; - int ret = mm_player_get_attribute(handle->mm_handle, NULL,"display_zoom" , &_level, (char*)NULL); - if(ret != MM_ERROR_NONE) - { - *level=-1; - return __convert_error_code(ret,(char*)__FUNCTION__); - } - else - { - *level = _level; - return PLAYER_ERROR_NONE; - } -} - -int player_set_x11_display_pixmap (player_h player, player_x11_pixmap_updated_cb callback, void *user_data) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(callback); - player_s * handle = (player_s *) player; - - if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) - { - LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state); - return PLAYER_ERROR_INVALID_STATE; - } - - if (!handle->is_set_pixmap_cb && handle->display_type != ((int)MM_DISPLAY_SURFACE_NULL)) - { - LOGE("[%s] player_set_display() was set, try it again after calling player_unprepare()" ,__FUNCTION__,PLAYER_ERROR_INVALID_OPERATION); - LOGE("[%s] PLAYER_ERROR_INVALID_OPERATION(0x%08x)" ,__FUNCTION__,PLAYER_ERROR_INVALID_OPERATION); - return PLAYER_ERROR_INVALID_OPERATION; - } - - int ret = mm_player_set_attribute(handle->mm_handle, NULL, "display_surface_type", MM_DISPLAY_SURFACE_X_EXT, "display_overlay" , callback , sizeof(callback), "display_overlay_user_data", user_data, sizeof(user_data), (char*)NULL); - if(ret != MM_ERROR_NONE) - { - return __convert_error_code(ret,(char*)__FUNCTION__); - } - else - { - handle->is_set_pixmap_cb = true; - handle->display_type = MM_DISPLAY_SURFACE_X; - handle->display_handle = callback; - LOGE("[%s] video display has been changed- type :%d, pixmap_callback addr : 0x%x",__FUNCTION__,handle->display_type, handle->display_handle); - return PLAYER_ERROR_NONE; - } - -} - -int player_set_x11_display_pixmap_error_cb (player_h player, player_x11_pixmap_error_cb callback, void *user_data) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(callback); - player_s * handle = (player_s *) player; - - if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) - { - LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state); - return PLAYER_ERROR_INVALID_STATE; - } - - int ret = mm_player_set_video_frame_render_error_callback(handle->mm_handle, __video_frame_render_error_callback, (void*)handle); - if(ret != MM_ERROR_NONE) - { - return __convert_error_code(ret,(char*)__FUNCTION__); - } - else - { - LOGE("[%s] set pixmap_error_cb(0x%08x) and user_data(0x%8x)" ,__FUNCTION__, callback, user_data); - handle->user_cb[_PLAYER_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR] = callback; - handle->user_data[_PLAYER_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR] = user_data; - LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR); - return PLAYER_ERROR_NONE; - } -} - -int player_set_x11_display_roi (player_h player, int x, int y, int w, int h) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_CHECK_CONDITION(x >= 0 && y >= 0 && w >= 0 && h >= 0,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER" ); - - player_display_mode_e mode; - player_s * handle = (player_s *) player; - - int ret = mm_player_get_attribute(handle->mm_handle, NULL,"display_method", &mode, (char*)NULL); - if(ret != MM_ERROR_NONE) - { - return __convert_error_code(ret,(char*)__FUNCTION__); - } - if (mode != PLAYER_DISPLAY_MODE_ROI) - { - ret = MM_ERROR_PLAYER_INTERNAL; - return __convert_error_code(ret,(char*)__FUNCTION__); - } - - ret = mm_player_set_attribute(handle->mm_handle, NULL, - "display_roi_x", x, - "display_roi_y", y, - "display_roi_width", w, - "display_roi_height", h, - (char*)NULL); - if(ret != MM_ERROR_NONE) - { - return __convert_error_code(ret,(char*)__FUNCTION__); - } - else - { - return PLAYER_ERROR_NONE; - } -} - -int player_get_x11_display_roi (player_h player, int *x, int *y, int *w, int *h) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(x); - PLAYER_NULL_ARG_CHECK(y); - PLAYER_NULL_ARG_CHECK(w); - PLAYER_NULL_ARG_CHECK(h); - - player_display_mode_e mode; - player_s * handle = (player_s *) player; - int _x = 0; - int _y = 0; - int _w = 0; - int _h = 0; - - int ret = mm_player_get_attribute(handle->mm_handle, NULL,"display_method", &mode, (char*)NULL); - if(ret != MM_ERROR_NONE) - { - return __convert_error_code(ret,(char*)__FUNCTION__); - } - if (mode != PLAYER_DISPLAY_MODE_ROI) - { - ret = MM_ERROR_PLAYER_INTERNAL; - return __convert_error_code(ret,(char*)__FUNCTION__); - } - - ret = mm_player_get_attribute(handle->mm_handle, NULL, - "display_roi_x", &_x, - "display_roi_y", &_y, - "display_roi_width", &_w, - "display_roi_height", &_h, - (char*)NULL); - if(ret != MM_ERROR_NONE) - { - *x = _x = 0; - *y = _y = 0; - *w = _w = 0; - *h = _h = 0; - return __convert_error_code(ret,(char*)__FUNCTION__); - } - else - { - *x = _x; - *y = _y; - *w = _w; - *h = _h; - return PLAYER_ERROR_NONE; - } -} - -int player_enable_evas_display_scaling(player_h player, bool enable) -{ - PLAYER_INSTANCE_CHECK(player); - player_s * handle = (player_s *) player; - - int scaling = enable?1:0; - int ret = mm_player_set_attribute(handle->mm_handle, NULL,"display_evas_do_scaling" , scaling, (char*)NULL); - if(ret != MM_ERROR_NONE) - { - return __convert_error_code(ret,(char*)__FUNCTION__); - } - else - return PLAYER_ERROR_NONE; -} - int player_get_content_info(player_h player, player_content_info_e key, char ** value) { PLAYER_INSTANCE_CHECK(player); @@ -1759,7 +1972,7 @@ int player_get_content_info(player_h player, player_content_info_e key, char ** int ret = mm_player_get_attribute(handle->mm_handle, NULL,attr ,&val, &val_len, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1798,7 +2011,7 @@ int player_get_codec_info(player_h player, char **audio_codec, char **video_code int ret = mm_player_get_attribute(handle->mm_handle, NULL,MM_PLAYER_AUDIO_CODEC,&audio,&audio_len,MM_PLAYER_VIDEO_CODEC,&video,&video_len,(char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1833,7 +2046,7 @@ int player_get_audio_stream_info(player_h player, int *sample_rate, int *channel int ret = mm_player_get_attribute(handle->mm_handle, NULL,MM_PLAYER_AUDIO_SAMPLERATE,sample_rate,MM_PLAYER_AUDIO_CHANNEL,channel,MM_PLAYER_AUDIO_BITRATE,bit_rate,(char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } return PLAYER_ERROR_NONE; } @@ -1852,7 +2065,7 @@ int player_get_video_stream_info(player_h player, int *fps, int *bit_rate) int ret = mm_player_get_attribute(handle->mm_handle, NULL,"content_video_fps",fps,"content_video_bitrate",bit_rate,(char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } return PLAYER_ERROR_NONE; } @@ -1873,13 +2086,13 @@ int player_get_video_size (player_h player, int *width, int *height) int ret = mm_player_get_attribute(handle->mm_handle, NULL,MM_PLAYER_VIDEO_WIDTH ,&w, MM_PLAYER_VIDEO_HEIGHT, &h, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { *width = w; *height = h; - LOGE("[%s] width : %d, height : %d",__FUNCTION__,w, h); + LOGI("[%s] width : %d, height : %d",__FUNCTION__,w, h); return PLAYER_ERROR_NONE; } } @@ -1898,155 +2111,11 @@ int player_get_album_art(player_h player, void **album_art, int *size) int ret = mm_player_get_attribute(handle->mm_handle, NULL,"tag_album_cover",album_art,size,(char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); - } - return PLAYER_ERROR_NONE; -} - -int player_get_track_count(player_h player, player_track_type_e type, int *count) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(count); - player_s * handle = (player_s *) player; - if (!__player_state_validate(handle, PLAYER_STATE_READY)) - { - LOGE("[%s] PLAYER_ERROR_INVALID_STATE (0x%08x) : current state - %d" ,__FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state); - return PLAYER_ERROR_INVALID_STATE; - } - int ret = mm_player_get_track_count(handle->mm_handle, type, count); - if(ret != MM_ERROR_NONE) - { - return __convert_error_code(ret,(char*)__FUNCTION__); - } - return PLAYER_ERROR_NONE; -} - -int player_audio_effect_set_value(player_h player, audio_effect_e effect, int value) -{ - PLAYER_INSTANCE_CHECK(player); - player_s * handle = (player_s *) player; - int ret = mm_player_audio_effect_custom_set_level(handle->mm_handle,effect,0,value); - if(ret != MM_ERROR_NONE) - { - return __convert_error_code(ret,(char*)__FUNCTION__); - } - else - { - ret = mm_player_audio_effect_custom_apply(handle->mm_handle); - return (ret==MM_ERROR_NONE)?PLAYER_ERROR_NONE:__convert_error_code(ret,(char*)__FUNCTION__); - } -} - -int player_audio_effect_get_value(player_h player, audio_effect_e effect, int *value) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(value); - player_s * handle = (player_s *) player; - int ret = mm_player_audio_effect_custom_get_level(handle->mm_handle,effect,0,value); - if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); - else - return PLAYER_ERROR_NONE; -} - -int player_audio_effect_clear(player_h player, audio_effect_e effect) -{ - PLAYER_INSTANCE_CHECK(player); - player_s * handle = (player_s *) player; - int ret = mm_player_audio_effect_custom_clear_ext_all(handle->mm_handle); - if(ret != MM_ERROR_NONE) - { - return __convert_error_code(ret,(char*)__FUNCTION__); - } - else - { - ret = mm_player_audio_effect_custom_apply(handle->mm_handle); - return (ret==MM_ERROR_NONE)?PLAYER_ERROR_NONE:__convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } -} - -int player_audio_effect_get_value_range(player_h player, audio_effect_e effect, int* min, int* max) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(min); - PLAYER_NULL_ARG_CHECK(max); - player_s * handle = (player_s *) player; - int ret = mm_player_audio_effect_custom_get_level_range(handle->mm_handle, effect, min, max); - if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); - else - return PLAYER_ERROR_NONE; -} - -int player_audio_effect_is_available(player_h player, audio_effect_e effect, bool *available) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(available); - player_s * handle = (player_s *) player; - int ret = mm_player_is_supported_custom_effect_type(handle->mm_handle, effect); - if(ret != MM_ERROR_NONE) - *available = FALSE; - else - *available = TRUE; return PLAYER_ERROR_NONE; } -int player_audio_effect_foreach_supported_effect(player_h player, player_audio_effect_supported_effect_cb callback, void *user_data) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(callback); - player_s * handle = (player_s *) player; - - LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT); - handle->user_cb[_PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT] = callback; - handle->user_data[_PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT] = user_data; - int ret = mm_player_get_foreach_present_supported_effect_type(handle->mm_handle, MM_AUDIO_EFFECT_TYPE_CUSTOM, __supported_audio_effect_type, (void*)handle); - if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); - else - return PLAYER_ERROR_NONE; -} - -int player_audio_effect_set_preset(player_h player, audio_effect_preset_e preset) -{ - PLAYER_INSTANCE_CHECK(player); - player_s * handle = (player_s *) player; - int ret = mm_player_audio_effect_preset_apply(handle->mm_handle, preset); - if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); - else - return PLAYER_ERROR_NONE; -} - -int player_audio_effect_preset_is_available(player_h player, audio_effect_preset_e preset, bool *available) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(available); - player_s * handle = (player_s *) player; - int ret = mm_player_is_supported_preset_effect_type(handle->mm_handle, preset); - if(ret != MM_ERROR_NONE) - *available = FALSE; - else - *available = TRUE; - return PLAYER_ERROR_NONE; -} - -int player_audio_effect_foreach_supported_preset(player_h player, player_audio_effect_supported_preset_cb callback, void *user_data) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(callback); - player_s * handle = (player_s *) player; - - LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT_PRESET); - handle->user_cb[_PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT_PRESET] = callback; - handle->user_data[_PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT_PRESET] = user_data; - int ret = mm_player_get_foreach_present_supported_effect_type(handle->mm_handle, MM_AUDIO_EFFECT_TYPE_PRESET, __supported_audio_effect_preset, (void*)handle); - if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); - else - return PLAYER_ERROR_NONE; -} - int player_audio_effect_get_equalizer_bands_count (player_h player, int *count) { PLAYER_INSTANCE_CHECK(player); @@ -2054,7 +2123,7 @@ int player_audio_effect_get_equalizer_bands_count (player_h player, int *count) player_s * handle = (player_s *) player; int ret = mm_player_audio_effect_custom_get_eq_bands_number(handle->mm_handle, count); if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); else return PLAYER_ERROR_NONE; } @@ -2067,12 +2136,12 @@ int player_audio_effect_set_equalizer_all_bands(player_h player, int *band_level int ret = mm_player_audio_effect_custom_set_level_eq_from_list(handle->mm_handle, band_levels, length); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { ret = mm_player_audio_effect_custom_apply(handle->mm_handle); - return (ret==MM_ERROR_NONE)?PLAYER_ERROR_NONE:__convert_error_code(ret,(char*)__FUNCTION__); + return (ret==MM_ERROR_NONE)?PLAYER_ERROR_NONE:__player_convert_error_code(ret,(char*)__FUNCTION__); } } @@ -2083,12 +2152,12 @@ int player_audio_effect_set_equalizer_band_level(player_h player, int index, int int ret = mm_player_audio_effect_custom_set_level(handle->mm_handle,MM_AUDIO_EFFECT_CUSTOM_EQ, index, level); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { ret = mm_player_audio_effect_custom_apply(handle->mm_handle); - return (ret==MM_ERROR_NONE)?PLAYER_ERROR_NONE:__convert_error_code(ret,(char*)__FUNCTION__); + return (ret==MM_ERROR_NONE)?PLAYER_ERROR_NONE:__player_convert_error_code(ret,(char*)__FUNCTION__); } } @@ -2099,7 +2168,7 @@ int player_audio_effect_get_equalizer_band_level(player_h player, int index, int player_s * handle = (player_s *) player; int ret = mm_player_audio_effect_custom_get_level(handle->mm_handle,MM_AUDIO_EFFECT_CUSTOM_EQ, index, level); if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); else return PLAYER_ERROR_NONE; } @@ -2112,7 +2181,7 @@ int player_audio_effect_get_equalizer_level_range(player_h player, int* min, int player_s * handle = (player_s *) player; int ret = mm_player_audio_effect_custom_get_level_range(handle->mm_handle, MM_AUDIO_EFFECT_CUSTOM_EQ, min, max); if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); else return PLAYER_ERROR_NONE; } @@ -2124,7 +2193,7 @@ int player_audio_effect_get_equalizer_band_frequency(player_h player, int index, player_s * handle = (player_s *) player; int ret = mm_player_audio_effect_custom_get_eq_bands_freq(handle->mm_handle, index, frequency); if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); else return PLAYER_ERROR_NONE; } @@ -2136,7 +2205,7 @@ int player_audio_effect_get_equalizer_band_frequency_range(player_h player, int player_s * handle = (player_s *) player; int ret = mm_player_audio_effect_custom_get_eq_bands_width(handle->mm_handle, index, range); if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); else return PLAYER_ERROR_NONE; } @@ -2148,12 +2217,12 @@ int player_audio_effect_equalizer_clear(player_h player) int ret = mm_player_audio_effect_custom_clear_eq_all(handle->mm_handle); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { ret = mm_player_audio_effect_custom_apply(handle->mm_handle); - return (ret==MM_ERROR_NONE)?PLAYER_ERROR_NONE:__convert_error_code(ret,(char*)__FUNCTION__); + return (ret==MM_ERROR_NONE)?PLAYER_ERROR_NONE:__player_convert_error_code(ret,(char*)__FUNCTION__); } } @@ -2173,23 +2242,26 @@ int player_audio_effect_equalizer_is_available(player_h player, bool *available) int player_set_subtitle_path(player_h player,const char* path) { PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(path); player_s * handle = (player_s *) player; - PLAYER_STATE_CHECK(handle,PLAYER_STATE_IDLE); - int ret = mm_player_set_attribute(handle->mm_handle, NULL,"subtitle_uri" , path, strlen(path), (char*)NULL); + if ((path == NULL) && (handle->state != PLAYER_STATE_IDLE)) + { + return PLAYER_ERROR_INVALID_PARAMETER; + } + + int ret = mm_player_set_external_subtitle_path(handle->mm_handle, path); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else return PLAYER_ERROR_NONE; } -int player_set_subtitle_position(player_h player, int millisecond) +int player_set_subtitle_position_offset(player_h player, int millisecond) { PLAYER_INSTANCE_CHECK(player); - PLAYER_CHECK_CONDITION(millisecond>=0 ,PLAYER_ERROR_INVALID_PARAMETER ,"PLAYER_ERROR_INVALID_PARAMETER" ); +//PLAYER_CHECK_CONDITION(millisecond>=0 ,PLAYER_ERROR_INVALID_PARAMETER ,"PLAYER_ERROR_INVALID_PARAMETER" ); player_s * handle = (player_s *) player; if (!__player_state_validate(handle, PLAYER_STATE_PLAYING)) { @@ -2200,7 +2272,7 @@ int player_set_subtitle_position(player_h player, int millisecond) int ret = mm_player_adjust_subtitle_position(handle->mm_handle, MM_PLAYER_POS_FORMAT_TIME, millisecond); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else return PLAYER_ERROR_NONE; @@ -2213,10 +2285,10 @@ int player_set_progressive_download_path(player_h player, const char *path) player_s * handle = (player_s *) player; PLAYER_STATE_CHECK(handle,PLAYER_STATE_IDLE); - int ret = mm_player_set_attribute(handle->mm_handle, NULL,"pd_mode", MM_PLAYER_PD_MODE_URI, "pd_location", path, strlen(path), (char*)NULL); + int ret = mm_player_set_attribute(handle->mm_handle, NULL, "pd_mode", MM_PLAYER_PD_MODE_URI, "pd_location", path, strlen(path), (char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -2242,7 +2314,7 @@ int player_get_progressive_download_status(player_h player, unsigned long *curre int ret = mm_player_get_pd_status(handle->mm_handle, &_current, &_total); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -2265,12 +2337,12 @@ int player_capture_video(player_h player, player_video_captured_cb callback, voi } else { - LOGE("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_CAPTURE); + LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_CAPTURE); handle->user_cb[_PLAYER_EVENT_TYPE_CAPTURE] = callback; handle->user_data[_PLAYER_EVENT_TYPE_CAPTURE] = user_data; } - if(handle->state == PLAYER_STATE_PAUSED || handle->state == PLAYER_STATE_PLAYING ) + if(handle->state >= PLAYER_STATE_READY) { int ret = mm_player_do_video_capture(handle->mm_handle); if(ret==MM_ERROR_PLAYER_NO_OP) @@ -2284,7 +2356,7 @@ int player_capture_video(player_h player, player_video_captured_cb callback, voi { handle->user_cb[_PLAYER_EVENT_TYPE_CAPTURE] = NULL; handle->user_data[_PLAYER_EVENT_TYPE_CAPTURE] = NULL; - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else return PLAYER_ERROR_NONE; @@ -2309,7 +2381,7 @@ int player_set_streaming_cookie(player_h player, const char *cookie, int size) int ret = mm_player_set_attribute(handle->mm_handle, NULL,"streaming_cookie", cookie, size, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else return PLAYER_ERROR_NONE; @@ -2326,7 +2398,7 @@ int player_set_streaming_user_agent(player_h player, const char *user_agent, int int ret = mm_player_set_attribute(handle->mm_handle, NULL,"streaming_user_agent", user_agent, size, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else return PLAYER_ERROR_NONE; @@ -2348,7 +2420,7 @@ int player_get_streaming_download_progress(player_h player, int *start, int *cur int ret = mm_player_get_buffer_position(handle->mm_handle,MM_PLAYER_POS_FORMAT_PERCENT,&_start,&_current); if(ret != MM_ERROR_NONE) { - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -2408,121 +2480,92 @@ int player_unset_subtitle_updated_cb (player_h player) return __unset_callback(_PLAYER_EVENT_TYPE_SUBTITLE,player); } -int player_set_video_frame_decoded_cb(player_h player, player_video_frame_decoded_cb callback, void *user_data) +int player_set_progressive_download_message_cb(player_h player, player_pd_message_cb callback, void *user_data) { PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(callback); player_s * handle = (player_s *) player; - if (handle->state != PLAYER_STATE_IDLE ) + if (handle->state != PLAYER_STATE_IDLE && handle->state != PLAYER_STATE_READY) { LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state); return PLAYER_ERROR_INVALID_STATE; } - int ret = mm_player_set_video_stream_callback(handle->mm_handle, __video_stream_callback, (void*)handle); + int ret = mm_player_set_pd_message_callback(handle->mm_handle, __pd_message_callback, (void*)handle); if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); - handle->user_cb[_PLAYER_EVENT_TYPE_VIDEO_FRAME] = callback; - handle->user_data[_PLAYER_EVENT_TYPE_VIDEO_FRAME] = user_data; - LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_VIDEO_FRAME); + handle->user_cb[_PLAYER_EVENT_TYPE_PD] = callback; + handle->user_data[_PLAYER_EVENT_TYPE_PD] = user_data; + LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_PD); return PLAYER_ERROR_NONE; } -int player_unset_video_frame_decoded_cb(player_h player) -{ - PLAYER_INSTANCE_CHECK(player); - player_s * handle = (player_s *) player; - handle->user_cb[_PLAYER_EVENT_TYPE_VIDEO_FRAME] = NULL; - handle->user_data[_PLAYER_EVENT_TYPE_VIDEO_FRAME] = NULL; - LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_VIDEO_FRAME); - int ret = mm_player_set_video_stream_callback(handle->mm_handle, NULL, NULL); - if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); - else - return PLAYER_ERROR_NONE; -} - -int player_set_audio_frame_decoded_cb(player_h player, int start, int end, player_audio_frame_decoded_cb callback, void *user_data) +int player_unset_progressive_download_message_cb(player_h player) { PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(callback); - PLAYER_CHECK_CONDITION(start>=0 ,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER" ); - PLAYER_CHECK_CONDITION(end>=start ,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER" ); player_s * handle = (player_s *) player; - if (handle->state != PLAYER_STATE_IDLE) - { - LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state); - return PLAYER_ERROR_INVALID_STATE; - } - int ret = mm_player_set_attribute(handle->mm_handle, NULL, "pcm_extraction",TRUE, "pcm_extraction_start_msec", start, "pcm_extraction_end_msec", end, NULL); - if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); + handle->user_cb[_PLAYER_EVENT_TYPE_PD] = NULL; + handle->user_data[_PLAYER_EVENT_TYPE_PD] = NULL; + LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_PD); - ret = mm_player_set_audio_stream_callback(handle->mm_handle, __audio_stream_callback, (void*)handle); + int ret = mm_player_set_pd_message_callback(handle->mm_handle, NULL, NULL); if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); - - handle->user_cb[_PLAYER_EVENT_TYPE_AUDIO_FRAME] = callback; - handle->user_data[_PLAYER_EVENT_TYPE_AUDIO_FRAME] = user_data; - LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_AUDIO_FRAME); - return PLAYER_ERROR_NONE; + return __player_convert_error_code(ret,(char*)__FUNCTION__); + else + return PLAYER_ERROR_NONE; } -int player_unset_audio_frame_decoded_cb(player_h player) +int player_ignore_session(player_h player) { PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; + PLAYER_STATE_CHECK(handle,PLAYER_STATE_IDLE); - handle->user_cb[_PLAYER_EVENT_TYPE_AUDIO_FRAME] = NULL; - handle->user_data[_PLAYER_EVENT_TYPE_AUDIO_FRAME] = NULL; - LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_AUDIO_FRAME); - - int ret = mm_player_set_attribute(handle->mm_handle, NULL, "pcm_extraction",FALSE, NULL); - if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); - - ret = mm_player_set_audio_stream_callback(handle->mm_handle, NULL, NULL); + int ret = MM_ERROR_NONE; //CHECK = mm_player_ignore_session(handle->mm_handle); if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); else return PLAYER_ERROR_NONE; } -int player_set_progressive_download_message_cb(player_h player, player_pd_message_cb callback, void *user_data) +int player_set_media_packet_video_frame_decoded_cb(player_h player, player_media_packet_video_decoded_cb callback, void *user_data) { PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(callback); + player_s * handle = (player_s *) player; - if (handle->state != PLAYER_STATE_IDLE && handle->state != PLAYER_STATE_READY) + if (handle->state != PLAYER_STATE_IDLE) { LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state); return PLAYER_ERROR_INVALID_STATE; } - int ret = mm_player_set_pd_message_callback(handle->mm_handle, __pd_message_callback, (void*)handle); + mm_player_enable_media_packet_video_stream(handle->mm_handle, TRUE); + + int ret = mm_player_set_video_stream_callback(handle->mm_handle, __video_stream_callback, (void*)handle); if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); + + handle->user_cb[_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME] = callback; + handle->user_data[_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME] = user_data; + LOGI("Event type : %d ", _PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME); - handle->user_cb[_PLAYER_EVENT_TYPE_PD] = callback; - handle->user_data[_PLAYER_EVENT_TYPE_PD] = user_data; - LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_PD); return PLAYER_ERROR_NONE; } -int player_unset_progressive_download_message_cb(player_h player) +int player_unset_media_packet_video_frame_decoded_cb(player_h player) { PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; + handle->user_cb[_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME] = NULL; + handle->user_data[_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME] = NULL; + LOGI("Event type : %d ", _PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME); - handle->user_cb[_PLAYER_EVENT_TYPE_PD] = NULL; - handle->user_data[_PLAYER_EVENT_TYPE_PD] = NULL; - LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_PD); - - int ret = mm_player_set_pd_message_callback(handle->mm_handle, NULL, NULL); + int ret = mm_player_set_video_stream_callback(handle->mm_handle, NULL, NULL); if(ret != MM_ERROR_NONE) - return __convert_error_code(ret,(char*)__FUNCTION__); + return __player_convert_error_code(ret,(char*)__FUNCTION__); else return PLAYER_ERROR_NONE; } diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1df3198..35bf443 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -19,6 +19,7 @@ FOREACH(flag ${${fw_test}_CFLAGS}) ENDFOREACH(flag) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib/gstreamer-0.10") IF(WAYLAND_SUPPORT) ADD_DEFINITIONS("-DHAVE_WAYLAND") diff --git a/test/player_test.c b/test/player_test.c old mode 100644 new mode 100755 index 176c567..ed2f1de --- a/test/player_test.c +++ b/test/player_test.c @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - #include #include #include @@ -29,46 +28,81 @@ #include #endif - +//#define _USE_X_DIRECT_ +#ifdef _USE_X_DIRECT_ +#include +#endif #define PACKAGE "player_test" -#define MAX_STRING_LEN 2048 +#define MAX_STRING_LEN 2048 #define MMTS_SAMPLELIST_INI_DEFAULT_PATH "/opt/etc/mmts_filelist.ini" +#define PLAYER_TEST_DUMP_PATH_PREFIX "/opt/usr/media/dump_pcm_" #define INI_SAMPLE_LIST_MAX 9 +#define DEFAULT_HTTP_TIMEOUT -1 + +gboolean g_memory_playback = FALSE; char g_uri[MAX_STRING_LEN]; char g_subtitle_uri[MAX_STRING_LEN]; - +FILE *g_pcm_fd; enum { CURRENT_STATUS_MAINMENU, + CURRENT_STATUS_HANDLE_NUM, CURRENT_STATUS_FILENAME, CURRENT_STATUS_VOLUME, + CURRENT_STATUS_SOUND_TYPE, CURRENT_STATUS_MUTE, - CURRENT_STATUS_REAL_POSITION_TIME, - CURRENT_STATUS_KEY_FRAME_POSITION_TIME, - CURRENT_STATUS_POSITION_PERCENT, + CURRENT_STATUS_POSITION_TIME, CURRENT_STATUS_LOOPING, + CURRENT_STATUS_DISPLAY_SURFACE_CHANGE, CURRENT_STATUS_DISPLAY_MODE, CURRENT_STATUS_DISPLAY_ROTATION, CURRENT_STATUS_DISPLAY_VISIBLE, - CURRENT_STATUS_DISPLAY_ROI, - CURRENT_STATUS_SUBTITLE_FILENAME + CURRENT_STATUS_DISPLAY_ROI_MODE, + CURRENT_STATUS_DISPLAY_DST_ROI, + CURRENT_STATUS_DISPLAY_SRC_CROP, + CURRENT_STATUS_SUBTITLE_FILENAME, + CURRENT_STATUS_AUDIO_EQUALIZER, }; +#define MAX_HANDLE 20 + +/* for video display */ +Evas_Object* g_xid; +Evas_Object* g_eo_win; +Evas_Object* g_eo[MAX_HANDLE] = {0}; +int g_current_surface_type = PLAYER_DISPLAY_TYPE_OVERLAY; + struct appdata { - Evas *evas; - Ecore_Evas *ee; - Evas_Object *win; - Evas_Object *layout_main; /* layout widget based on EDJ */ - #ifdef HAVE_X11 + Evas_Object *win; + Evas_Object *bg; + Evas_Object *rect; +#ifdef HAVE_X11 Ecore_X_Window xid; - #elif HAVE_WAYLAND +#elif HAVE_WAYLAND unsigned int xid; - #endif +#endif + Evas_Object *layout_main; /* layout widget based on EDJ */ /* add more variables here */ }; +static Evas_Object *create_bg(Evas_Object *pParent) +{ + if(!pParent) { + return NULL; + } + + Evas_Object *pObj = NULL; + + pObj = elm_bg_add(pParent); + evas_object_size_hint_weight_set(pObj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(pParent, pObj); + evas_object_color_set(pObj, 0, 0, 0, 0); + evas_object_show(pObj); + return pObj; +} + static void win_del(void *data, Evas_Object *obj, void *event) { elm_exit(); @@ -76,8 +110,7 @@ static void win_del(void *data, Evas_Object *obj, void *event) static Evas_Object* create_win(const char *name) { - Evas_Object *eo; - int w, h; + Evas_Object *eo = NULL; printf ("[%s][%d] name=%s\n", __func__, __LINE__, name); @@ -86,58 +119,103 @@ static Evas_Object* create_win(const char *name) elm_win_title_set(eo, name); elm_win_borderless_set(eo, EINA_TRUE); evas_object_smart_callback_add(eo, "delete,request",win_del, NULL); - #ifdef HAVE_X11 - Ecore_X_Window xwin; - xwin = elm_win_xwindow_get(eo); - if (xwin != 0) - ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h); - else { - #endif - #ifdef HAVE_WAYLAND - Ecore_Wl_Window *wlwin; - wlwin = elm_win_wl_window_get(eo); - if (wlwin != NULL) - ecore_wl_screen_size_get(&w, &h); - #endif - #ifdef HAVE_X11 - } - #endif - evas_object_resize(eo, w, h); + elm_win_autodel_set(eo, EINA_TRUE); } - return eo; } +static Evas_Object *create_image_object(Evas_Object *eo_parent) +{ + if(!eo_parent) { + return NULL; + } + Evas *evas = evas_object_evas_get(eo_parent); + Evas_Object *eo = NULL; + + eo = evas_object_image_add(evas); + + return eo; +} + +static Evas_Object *create_render_rect(Evas_Object *pParent) +{ + if(!pParent) { + return NULL; + } + + Evas *pEvas = evas_object_evas_get(pParent); + Evas_Object *pObj = evas_object_rectangle_add(pEvas); + if(pObj == NULL) { + return NULL; + } + + evas_object_size_hint_weight_set(pObj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_color_set(pObj, 0, 0, 0, 0); + evas_object_render_op_set(pObj, EVAS_RENDER_COPY); + evas_object_show(pObj); + elm_win_resize_object_add(pParent, pObj); + + return pObj; +} + static int app_create(void *data) { - struct appdata *ad = data; - Evas_Object *win; - /* create window */ - win = create_win(PACKAGE); - if (win == NULL) - return -1; - ad->win = win; - evas_object_show(win); - return 0; + struct appdata *ad = data; + Evas_Object *win = NULL; + + /* use gl backend */ + elm_config_preferred_engine_set("opengl_x11"); + + /* create window */ + win = create_win(PACKAGE); + if (win == NULL) + return -1; + ad->win = win; + g_eo_win = win; + ad->bg = create_bg(ad->win); + ad->rect = create_render_rect(ad->win); + g_xid = ad->win; + /* Create evas image object for EVAS surface */ + g_eo[0] = create_image_object(ad->win); + evas_object_image_size_set(g_eo[0], 500, 500); + evas_object_image_fill_set(g_eo[0], 0, 0, 500, 500); + evas_object_resize(g_eo[0], 500, 500); + + elm_win_activate(win); + evas_object_show(win); + + return 0; } static int app_terminate(void *data) { - struct appdata *ad = data; - - if (ad->win) - evas_object_del(ad->win); + struct appdata *ad = data; + int i = 0; - return 0; + for (i = 0 ; i < MAX_HANDLE; i++) + { + if (g_eo[i]) + { + evas_object_del(g_eo[i]); + g_eo[i] = NULL; + } + } + if (g_eo_win) { + evas_object_del(g_eo_win); + g_eo_win = NULL; + } + ad->win = NULL; + return 0; } struct appcore_ops ops = { - .create = app_create, - .terminate = app_terminate, + .create = app_create, + .terminate = app_terminate, }; struct appdata ad; -static player_h g_player = 0; +static player_h g_player[MAX_HANDLE] = {0}; +int g_handle_num = 1; int g_menu_state = CURRENT_STATUS_MAINMENU; char g_file_list[9][256]; gboolean quit_pushing; @@ -167,19 +245,29 @@ static void completed_cb(void *user_data) g_print("[Player_Test] completed_cb!!!!\n"); } -static void audio_frame_decoded_cb(unsigned char *data, unsigned int size, void *user_data) +static void error_cb(int code, void *user_data) { - int pos=0; - player_get_position(g_player, &pos); - g_print("[Player_Test] audio_frame_decoded_cb [size: %d] --- current pos : %d!!!!\n", size, pos); + g_print("[Player_Test] error_cb!!!! code : %d\n", code); +} + +static void interrupted_cb(player_interrupted_code_e code, void *user_data) +{ + g_print("[Player_Test] interrupted_cb!!!! code : %d\n", code); } -void video_frame_decoded_cb(unsigned char *data, int width, int height, unsigned int size, void *user_data) +#if 0 +static void audio_frame_decoded_cb(unsigned char *data, unsigned int size, void *user_data) { int pos=0; - player_get_position(g_player, &pos); - g_print("[Player_Test] video_frame_decoded_cb!!!! width: %d, height : %d, size :%d ---- current pos: %d \n",width, height,size,pos); + + if (data && g_pcm_fd) + { + fwrite(data, 1, size, g_pcm_fd); + } + player_get_play_position(g_player[0], &pos); + g_print("[Player_Test] audio_frame_decoded_cb [size: %d] --- current pos : %d!!!!\n", size, pos); } +#endif static void subtitle_updated_cb(unsigned long duration, char *text, void *user_data) { @@ -191,22 +279,74 @@ static void video_captured_cb(unsigned char *data, int width, int height,unsigne g_print("[Player_Test] video_captured_cb!!!! width: %d, height : %d, size : %d \n",width, height,size); } +int _save(unsigned char * src, int length) +{ //unlink(CAPTUERD_IMAGE_SAVE_PATH); + FILE* fp; + char filename[256] = {0,}; + static int WRITE_COUNT = 0; + + //gchar *filename = CAPTUERD_IMAGE_SAVE_PATH; + sprintf (filename, "ALBUM_ART_IMAGE_%d", WRITE_COUNT); + WRITE_COUNT++; + fp=fopen(filename, "w+"); + if(fp==NULL) + { + g_print("file open error!!\n"); + return FALSE; + } + else + { + g_print("open success\n"); + if(fwrite(src, 1, length, fp )!=1) + { + g_print("file write error!!\n"); + fclose(fp); + return FALSE; + } + g_print("write success(%s)\n", filename); + fclose(fp); + } + + return TRUE; +} + +static void reset_display() +{ + int i = 0; + + /* delete evas window, if it is */ + for (i = 0 ; i < MAX_HANDLE; i++) + { + if (g_eo[i]) + { + evas_object_del(g_eo[i]); + g_eo[i] = NULL; + } + } + +} + static void input_filename(char *filename) { int len = strlen(filename); + int i = 0; if ( len < 0 || len > MAX_STRING_LEN ) return; - if(g_player!=NULL) - { - player_unprepare(g_player); - player_destroy(g_player); - } - g_player = 0; - if ( player_create(&g_player) != PLAYER_ERROR_NONE ) + for (i = 0; i < g_handle_num; i++) { - g_print("player create is failed\n"); + if(g_player[i]!=NULL) + { + player_unprepare(g_player[i]); + player_destroy(g_player[i]); + } + g_player[i] = 0; + + if ( player_create(&g_player[i]) != PLAYER_ERROR_NONE ) + { + g_print("player create is failed\n"); + } } strncpy (g_uri, filename,len); @@ -228,19 +368,38 @@ static void input_filename(char *filename) g_sprintf(uri, "mem://ext=%s,size=%d", ext ? ext : "", file_size); g_print("[uri] = %s\n", uri); - mm_player_set_attribute(g_player, + mm_player_set_attribute(g_player[0], &g_err_name, "profile_uri", uri, strlen(uri), "profile_user_param", g_media_mem, file_size NULL); #else - //player_set_uri(g_player, filename); + //player_set_uri(g_player[0], filename); #endif /* APPSRC_TEST */ int ret; player_state_e state; - ret = player_get_state(g_player, &state); - g_print("1. After player_create() - Current State : %d \n", state); + for (i = 0; i < g_handle_num; i++) + { + ret = player_get_state(g_player[i], &state); + g_print("player_get_state returned [%d]", ret); + g_print("1. After player_create() - Current State : %d \n", state); + } +} + +// use this API instead of player_set_uri +static void player_set_memory_buffer_test() +{ + GMappedFile *file; + gsize file_size; + guint8* g_media_mem = NULL; + + file = g_mapped_file_new (g_uri, FALSE, NULL); + file_size = g_mapped_file_get_length (file); + g_media_mem = (guint8 *) g_mapped_file_get_contents (file); + + int ret = player_set_memory_buffer(g_player[0], (void*)g_media_mem, file_size); + g_print("player_set_memory_buffer ret : %d\n", ret); } static void _player_prepare(bool async) @@ -251,90 +410,274 @@ static void _player_prepare(bool async) if ( slen > 0 && slen < MAX_STRING_LEN ) { g_print("0. set subtile path() (size : %d) - %s \n", slen, g_subtitle_uri); - player_set_subtitle_path(g_player,g_subtitle_uri); - player_set_subtitle_updated_cb(g_player, subtitle_updated_cb, (void*)g_player); + player_set_subtitle_path(g_player[0],g_subtitle_uri); + player_set_subtitle_updated_cb(g_player[0], subtitle_updated_cb, (void*)g_player[0]); + } + if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) + { + player_set_display(g_player[0], g_current_surface_type, GET_DISPLAY(g_xid)); + player_set_buffering_cb(g_player[0], buffering_cb, (void*)g_player[0]); + player_set_completed_cb(g_player[0], completed_cb, (void*)g_player[0]); + player_set_interrupted_cb(g_player[0], interrupted_cb, (void*)g_player[0]); + player_set_error_cb(g_player[0], error_cb, (void*)g_player[0]); + if (g_memory_playback) + player_set_memory_buffer_test(); + else + player_set_uri(g_player[0], g_uri); + } + else + { + int i = 0; + for (i = 0; i < g_handle_num; i++) + { + player_set_display(g_player[i], g_current_surface_type, g_eo[i]); + player_set_buffering_cb(g_player[i], buffering_cb, (void*)g_player[i]); + player_set_completed_cb(g_player[i], completed_cb, (void*)g_player[i]); + player_set_interrupted_cb(g_player[i], interrupted_cb, (void*)g_player[i]); + player_set_error_cb(g_player[i], error_cb, (void*)g_player[i]); + if (g_memory_playback) + player_set_memory_buffer_test(); + else + player_set_uri(g_player[i], g_uri); + } } - #ifdef HAVE_X11 - player_set_display(g_player,PLAYER_DISPLAY_TYPE_X11,GET_DISPLAY(ad.xid)); - #elif HAVE_WAYLAND - player_set_display(g_player,PLAYER_DISPLAY_TYPE_EVAS,GET_DISPLAY(ad.xid)); - #endif - - - player_set_buffering_cb(g_player, buffering_cb, (void*)g_player); - player_set_completed_cb(g_player, completed_cb, (void*)g_player); - player_set_uri(g_player, g_uri); - if ( async ) + if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) { - ret = player_prepare_async(g_player, prepared_cb, (void*) g_player); + if ( async ) + { + ret = player_prepare_async(g_player[0], prepared_cb, (void*) g_player[0]); + } + else + ret = player_prepare(g_player[0]); } else - ret = player_prepare(g_player); + { + int i = 0; + for (i = 0; i < g_handle_num; i++) + { + if ( async ) + { + ret = player_prepare_async(g_player[i], prepared_cb, (void*) g_player[i]); + } + else + ret = player_prepare(g_player[i]); + } + } if ( ret != PLAYER_ERROR_NONE ) { g_print("prepare is failed (errno = %d) \n", ret); } player_state_e state; - ret = player_get_state(g_player, &state); - g_print("After player_prepare() - Current State : %d \n", state); + if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) + { + ret = player_get_state(g_player[0], &state); + g_print("After player_prepare() - Current State : %d \n", state); + } + else + { + int i = 0; + for (i = 0; i < g_handle_num; i++) + { + ret = player_get_state(g_player[i], &state); + g_print("After player_prepare() - Current State : %d \n", state); + } + } + } static void _player_unprepare() { int ret = FALSE; - ret = player_unprepare(g_player); - if ( ret != PLAYER_ERROR_NONE ) + int i = 0; + if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) { - g_print("unprepare is failed (errno = %d) \n", ret); + ret = player_unprepare(g_player[0]); + if ( ret != PLAYER_ERROR_NONE ) + { + g_print("unprepare is failed (errno = %d) \n", ret); + } + ret = player_unset_subtitle_updated_cb(g_player[0]); + g_print("player_unset_subtitle_updated_cb ret %d\n", ret); + + ret = player_unset_buffering_cb(g_player[0]); + g_print("player_unset_buffering_cb ret %d\n", ret); + + ret = player_unset_completed_cb(g_player[0]); + g_print("player_unset_completed_cb ret %d\n", ret); + + ret = player_unset_interrupted_cb(g_player[0]); + g_print("player_unset_interrupted_cb ret %d\n", ret); + + ret = player_unset_error_cb(g_player[0]); + g_print("player_unset_error_cb ret %d\n", ret); + } + else + { + for (i = 0; i < g_handle_num ; i++) + { + if(g_player[i]!=NULL) + { + ret = player_unprepare(g_player[i]); + if ( ret != PLAYER_ERROR_NONE ) + { + g_print("unprepare is failed (errno = %d) \n", ret); + } + ret = player_unset_subtitle_updated_cb(g_player[i]); + g_print("player_unset_subtitle_updated_cb [%d] ret %d\n", i, ret); + + ret = player_unset_buffering_cb(g_player[i]); + g_print("player_unset_buffering_cb [%d] ret %d\n", i, ret); + + ret = player_unset_completed_cb(g_player[i]); + g_print("player_unset_completed_cb [%d] ret %d\n", i, ret); + + ret = player_unset_interrupted_cb(g_player[i]); + g_print("player_unset_interrupted_cb [%d] ret %d\n", i, ret); + + ret = player_unset_error_cb(g_player[i]); + g_print("player_unset_error_cb [%d] ret %d\n", i, ret); + } + } + } + reset_display(); memset(g_subtitle_uri, 0 , sizeof(g_subtitle_uri)); player_state_e state; - ret = player_get_state(g_player, &state); - g_print(" After player_unprepare() - Current State : %d \n", state); + if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) + { + ret = player_get_state(g_player[0], &state); + g_print(" After player_unprepare() - Current State : %d \n", state); + } + else + { + for (i = 0; i < g_handle_num ; i++) + { + ret = player_get_state(g_player[i], &state); + g_print(" After player_unprepare() - Current State : %d \n", state); + } + } +} + +static void _player_destroy() +{ + int i = 0; + if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) + { + player_unprepare(g_player[0]); + for (i = 0; i < g_handle_num ; i++) + { + player_destroy(g_player[i]); + g_player[i] = 0; + } + } + else + { + for (i = 0; i < g_handle_num ; i++) + { + if(g_player[i]!=NULL) + { + player_unprepare(g_player[i]); + player_destroy(g_player[i]); + g_player[i] = 0; + } + } + } } static void _player_play() { int bRet = FALSE; - bRet = player_start(g_player); + int i = 0; + if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) + { + bRet = player_start(g_player[0]); + g_print("player_start returned [%d]", bRet); + } + else + { + for (i = 0; i < g_handle_num ; i++) + { + bRet = player_start(g_player[i]); + g_print("player_start returned [%d]", bRet); + } + } } static void _player_stop() { int bRet = FALSE; - bRet = player_stop(g_player); + int i = 0; + if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) + { + bRet = player_stop(g_player[0]); + g_print("player_stop returned [%d]", bRet); + } + else + { + for (i = 0; i < g_handle_num ; i++) + { + bRet = player_stop(g_player[i]); + g_print("player_stop returned [%d]", bRet); + } + } } static void _player_resume() { int bRet = FALSE; - bRet = player_start(g_player); + int i = 0; + if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) + { + bRet = player_start(g_player[0]); + g_print("player_start returned [%d]", bRet); + } + else + { + for (i = 0; i < g_handle_num ; i++) + { + bRet = player_start(g_player[i]); + g_print("player_start returned [%d]", bRet); + } + } } static void _player_pause() { int bRet = FALSE; - bRet = player_pause(g_player); + int i = 0; + if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) + { + bRet = player_pause(g_player[0]); + g_print("player_pause returned [%d]", bRet); + } + else + { + for (i = 0; i < g_handle_num ; i++) + { + bRet = player_pause(g_player[i]); + g_print("player_pause returned [%d]", bRet); + } + } } static void _player_state() { player_state_e state; - player_get_state(g_player, &state); + player_get_state(g_player[0], &state); g_print(" ==> [Player_Test] Current Player State : %d\n", state); } static void _player_set_progressive_download() { - player_set_progressive_download_path(g_player, "/opt/test.pd"); - player_set_progressive_download_message_cb(g_player, progress_down_cb, (void*)g_player); + player_set_progressive_download_path(g_player[0], "/opt/test.pd"); + player_set_progressive_download_message_cb(g_player[0], progress_down_cb, (void*)g_player[0]); } static void set_volume(float volume) { - if ( player_set_volume(g_player, volume, volume) != PLAYER_ERROR_NONE ) + if ( player_set_volume(g_player[0], volume, volume) != PLAYER_ERROR_NONE ) { g_print("failed to set volume\n"); } @@ -342,13 +685,13 @@ static void set_volume(float volume) static void get_volume(float* left, float* right) { - player_get_volume(g_player, left, right); + player_get_volume(g_player[0], left, right); g_print(" ==> [Player_Test] volume - left : %f, right : %f\n", *left, *right); } static void set_mute(bool mute) { - if ( player_set_mute(g_player, mute) != PLAYER_ERROR_NONE ) + if ( player_set_mute(g_player[0], mute) != PLAYER_ERROR_NONE ) { g_print("failed to set_mute\n"); } @@ -356,44 +699,41 @@ static void set_mute(bool mute) static void get_mute(bool *mute) { - player_is_muted(g_player, mute); + player_is_muted(g_player[0], mute); g_print(" ==> [Player_Test] mute = %d\n", *mute); } +static void set_sound_type(sound_type_e type) +{ + if ( player_set_sound_type(g_player[0], type) != PLAYER_ERROR_NONE ) + { + g_print("failed to set sound type(%d)\n", type); + } + else + g_print("set sound type(%d) success", type); +} + static void get_position() { int position = 0; - int percent = 0; int ret; - ret = player_get_position(g_player, &position); - g_print(" ==> [Player_Test] player_get_position() return : %d\n",ret); - ret = player_get_position_ratio(g_player, &percent); - g_print(" ==> [Player_Test] player_get_position_ratio() return : %d\n",ret); - g_print(" ==> [Player_Test] Pos: [%d ] msec\n", position); - g_print(" ==> [Player_Test] Pos: [%d] percent\n", percent); + ret = player_get_play_position(g_player[0], &position); + g_print(" ==> [Player_Test] player_get_play_position()%d return : %d\n", ret, position); } -static void set_position(int position, bool flag) +static void set_position(int position) { - if ( player_seek(g_player, position, flag, seek_completed_cb, g_player) != PLAYER_ERROR_NONE ) + if ( player_set_play_position(g_player[0], position, TRUE, seek_completed_cb, g_player[0]) != PLAYER_ERROR_NONE ) { g_print("failed to set position\n"); } } -static void set_position_ratio(int percent) -{ - if ( player_set_position_ratio(g_player, percent, seek_completed_cb, g_player) != PLAYER_ERROR_NONE ) - { - g_print("failed to set position ratio\n"); - } -} - static void get_duration() { int duration = 0; int ret; - ret = player_get_duration(g_player, &duration); + ret = player_get_duration(g_player[0], &duration); g_print(" ==> [Player_Test] player_get_duration() return : %d\n",ret); g_print(" ==> [Player_Test] Duration: [%d ] msec\n",duration); } @@ -402,20 +742,21 @@ static void get_stream_info() { int w = 0; int h = 0; + char *value = NULL; - player_get_content_info(g_player, PLAYER_CONTENT_INFO_ALBUM, &value); + player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_ALBUM, &value); g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_ALBUM: [%s ] \n",value); - player_get_content_info(g_player, PLAYER_CONTENT_INFO_ARTIST, &value); + player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_ARTIST, &value); g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_ARTIST: [%s ] \n",value); - player_get_content_info(g_player, PLAYER_CONTENT_INFO_AUTHOR, &value); + player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_AUTHOR, &value); g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_AUTHOR: [%s ] \n",value); - player_get_content_info(g_player, PLAYER_CONTENT_INFO_GENRE, &value); + player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_GENRE, &value); g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_GENRE: [%s ] \n",value); - player_get_content_info(g_player, PLAYER_CONTENT_INFO_TITLE, &value); + player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_TITLE, &value); g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_TITLE: [%s ] \n",value); void *album; int size; - player_get_album_art(g_player, &album, &size); + player_get_album_art(g_player[0], &album, &size); g_print(" ==> [Player_Test] Album art : [ data : %p, size : %d ]\n", (unsigned int *)album, size); if(value!=NULL) { @@ -426,12 +767,16 @@ static void get_stream_info() int sample_rate; int channel; int bit_rate; - player_get_audio_stream_info(g_player, &sample_rate, &channel, &bit_rate); + int fps, v_bit_rate; + player_get_audio_stream_info(g_player[0], &sample_rate, &channel, &bit_rate); g_print(" ==> [Player_Test] Sample Rate: [%d ] , Channel: [%d ] , Bit Rate: [%d ] \n",sample_rate,channel,bit_rate); + player_get_video_stream_info(g_player[0], &fps, &v_bit_rate); + g_print(" ==> [Player_Test] fps: [%d ] , Bit Rate: [%d ] \n",fps,v_bit_rate); + char *audio_codec = NULL; char *video_codec = NULL; - player_get_codec_info(g_player, &audio_codec, &video_codec); + player_get_codec_info(g_player[0], &audio_codec, &video_codec); if(audio_codec!=NULL) { g_print(" ==> [Player_Test] Audio Codec: [%s ] \n",audio_codec); @@ -444,27 +789,116 @@ static void get_stream_info() free(video_codec); video_codec = NULL; } - player_get_video_size(g_player, &w, &h); + player_get_video_size(g_player[0], &w, &h); g_print(" ==> [Player_Test] Width: [%d ] , Height: [%d ] \n",w,h); -} + } static void set_looping(bool looping) { - if ( player_set_looping(g_player, looping) != PLAYER_ERROR_NONE ) + if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) { - g_print("failed to set_looping\n"); + if ( player_set_looping(g_player[0], looping) != PLAYER_ERROR_NONE ) + { + g_print("failed to set_looping\n"); + } + } + else + { + int i = 0; + for (i = 0; i < g_handle_num; i++) + { + if ( player_set_looping(g_player[i], looping) != PLAYER_ERROR_NONE ) + { + g_print("failed to set_looping\n"); + } + } } } static void get_looping(bool *looping) { - player_is_looping(g_player, looping); + player_is_looping(g_player[0], looping); g_print(" ==> [Player_Test] looping = %d\n", *looping); } +static void change_surface(int option) +{ + player_display_type_e surface_type = 0; + int ret = PLAYER_ERROR_NONE; + + switch (option) + { + case 0: /* X surface */ + surface_type = PLAYER_DISPLAY_TYPE_OVERLAY; + g_print("change surface type to X\n"); + break; + case 1: /* EVAS surface */ + surface_type = PLAYER_DISPLAY_TYPE_EVAS; + g_print("change surface type to EVAS\n"); + break; + default: + g_print("invalid surface type\n"); + return; + } + + if (surface_type == g_current_surface_type) + { + g_print("same with the previous surface type(%d)\n", g_current_surface_type); + return; + } + else + { + player_state_e player_state = PLAYER_STATE_NONE; + ret = player_get_state(g_player[0], &player_state); + if (ret) + { + g_print("failed to player_get_state(), ret(0x%x)\n", ret); + } + /* state check */ + if (player_state == PLAYER_STATE_NONE || player_state == PLAYER_STATE_IDLE ) + { + reset_display(); + + if (surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) + { + g_xid = g_eo_win; + ret = player_set_display(g_player[0], surface_type, GET_DISPLAY(g_xid)); + } + else + { + int i = 0; + for (i = 0; i < g_handle_num ; i++) + { + /* Create evas image object for EVAS surface */ + if (!g_eo[i]) + { + g_eo[i] = create_image_object(g_eo_win); + evas_object_image_size_set(g_eo[i], 500, 500); + evas_object_image_fill_set(g_eo[i], 0, 0, 500, 500); + evas_object_resize(g_eo[i], 500, 500); + evas_object_move(g_eo[i], i*20, i*20); + } + ret = player_set_display(g_player[i], surface_type, g_eo[i]); + } + } + if (ret) + { + g_print("failed to set display, surface_type(%d)\n", surface_type); + return; + } + g_current_surface_type = surface_type; + } + else + { + g_print("could not change surface type, current_state(%d)\n", player_state); + } + } + return; +} + static void set_display_mode(int mode) { - if ( player_set_display_mode(g_player, mode) != PLAYER_ERROR_NONE ) + if ( player_set_display_mode(g_player[0], mode) != PLAYER_ERROR_NONE ) { g_print("failed to player_set_display_mode\n"); } @@ -473,13 +907,13 @@ static void set_display_mode(int mode) static void get_display_mode() { player_display_mode_e mode; - player_get_display_mode(g_player, &mode); + player_get_display_mode(g_player[0], &mode); g_print(" ==> [Player_Test] Display mode: [%d ] \n",mode); } static void set_display_rotation(int rotation) { - if ( player_set_x11_display_rotation(g_player, rotation) != PLAYER_ERROR_NONE ) + if ( player_set_display_rotation(g_player[0], rotation) != PLAYER_ERROR_NONE ) { g_print("failed to set_display_rotation\n"); } @@ -488,14 +922,14 @@ static void set_display_rotation(int rotation) static void get_display_rotation() { player_display_rotation_e rotation = 0; - player_get_x11_display_rotation(g_player, &rotation); + player_get_display_rotation(g_player[0], &rotation); g_print(" ==> [Player_Test] X11 Display rotation: [%d ] \n",rotation); } static void set_display_visible(bool visible) { - if ( player_set_x11_display_visible(g_player, visible) != PLAYER_ERROR_NONE ) + if ( player_set_display_visible(g_player[0], visible) != PLAYER_ERROR_NONE ) { g_print("failed to player_set_x11_display_visible\n"); } @@ -503,32 +937,91 @@ static void set_display_visible(bool visible) static void get_display_visible(bool *visible) { - player_is_x11_display_visible(g_player, visible); + player_is_display_visible(g_player[0], visible); g_print(" ==> [Player_Test] X11 Display Visible = %d\n", *visible); } -static void set_display_roi(int x, int y, int w, int h) +static void set_display_dst_roi(int x, int y, int w, int h) +{ +#if 0 + if ( player_set_x11_display_dst_roi(g_player[0], x, y, w, h) != PLAYER_ERROR_NONE ) + { + g_print("failed to player_set_x11_display_dst_roi\n"); + } else { + g_print(" ==> [Player_Test] set X11 Display DST ROI (x:%d, y:%d, w:%d, h:%d)\n", x, y, w, h); + } +#endif +} + +static void get_display_dst_roi() +{ +#if 0 + int x = 0; + int y = 0; + int w = 0; + int h = 0; + + if ( player_get_x11_display_dst_roi(g_player[0], &x, &y, &w, &h) != PLAYER_ERROR_NONE ) + { + g_print("failed to player_get_x11_display_dst_roi\n"); + } else { + g_print(" ==> [Player_Test] got X11 Display DST ROI (x:%d, y:%d, w:%d, h:%d)\n", x, y, w, h); + } +#endif +} + +static void set_display_roi_mode(int mode) +{ +#if 0 + if ( player_set_x11_display_roi_mode(g_player[0], (player_display_roi_mode_e)mode) != PLAYER_ERROR_NONE ) + { + g_print("failed to player_set_x11_display_roi_mode\n"); + } else { + g_print(" ==> [Player_Test] set X11 Display ROI mode (%d)\n", mode); + } +#endif +} + +static void get_display_roi_mode() { - if ( player_set_x11_display_roi(g_player, x, y, w, h) != PLAYER_ERROR_NONE ) +#if 0 + player_display_roi_mode_e mode; + if ( player_get_x11_display_roi_mode(g_player[0], &mode) != PLAYER_ERROR_NONE ) { - g_print("failed to player_set_x11_display_roi\n"); + g_print("failed to player_get_x11_display_roi_mode\n"); } else { - g_print(" ==> [Player_Test] set X11 Display ROI (x:%d, y:%d, w:%d, h:%d)\n", x, y, w, h); + g_print(" ==> [Player_Test] got X11 Display ROI mode (%d)\n", mode); } +#endif } -static void get_display_roi() +static void set_display_src_crop(int x, int y, int w, int h) { +#if 0 + if ( player_set_x11_display_src_crop(g_player[0], x, y, w, h) != PLAYER_ERROR_NONE ) + { + g_print("failed to player_set_x11_display_src_crop\n"); + } else { + g_print(" ==> [Player_Test] set X11 Display SRC CROP (x:%d, y:%d, w:%d, h:%d)\n", x, y, w, h); + } +#endif +} + +static void get_display_src_crop() +{ +#if 0 int x = 0; int y = 0; int w = 0; int h = 0; - if ( player_get_x11_display_roi(g_player, &x, &y, &w, &h) != PLAYER_ERROR_NONE ) + + if ( player_get_x11_display_src_crop(g_player[0], &x, &y, &w, &h) != PLAYER_ERROR_NONE ) { - g_print("failed to player_get_x11_display_roi\n"); + g_print("failed to player_get_x11_display_src_crop\n"); } else { - g_print(" ==> [Player_Test] got X11 Display ROI (x:%d, y:%d, w:%d, h:%d)\n", x, y, w, h); + g_print(" ==> [Player_Test] got X11 Display SRC CROP (x:%d, y:%d, w:%d, h:%d)\n", x, y, w, h); } +#endif } static void input_subtitle_filename(char *subtitle_filename) @@ -540,11 +1033,12 @@ static void input_subtitle_filename(char *subtitle_filename) strncpy (g_subtitle_uri, subtitle_filename,len); g_print("subtitle uri is set to %s\n", g_subtitle_uri); + player_set_subtitle_path (g_player[0], g_subtitle_uri); } static void capture_video() { - if( player_capture_video(g_player,video_captured_cb,NULL)!=PLAYER_ERROR_NONE) + if( player_capture_video(g_player[0],video_captured_cb,NULL)!=PLAYER_ERROR_NONE) { g_print("failed to player_capture_video\n"); } @@ -552,29 +1046,88 @@ static void capture_video() static void decoding_audio() { +#if 0 int ret; - ret =player_set_audio_frame_decoded_cb(g_player, 0,0,audio_frame_decoded_cb, (void*)g_player); + char *suffix, *dump_path; + GDateTime *time = g_date_time_new_now_local(); + + suffix = g_date_time_format(time, "%Y%m%d_%H%M%S.pcm"); + dump_path = g_strjoin(NULL, PLAYER_TEST_DUMP_PATH_PREFIX, suffix, NULL); + g_pcm_fd = fopen(dump_path, "w+"); + g_free(dump_path); + g_free(suffix); + g_date_time_unref(time); + if(!g_pcm_fd) { + g_print("Can not create debug dump file"); + } + + ret =player_set_audio_frame_decoded_cb(g_player[0], 0, 0,audio_frame_decoded_cb, (void*)g_player[0]); if ( ret != PLAYER_ERROR_NONE ) { g_print("player_set_audio_frame_decoded_cb is failed (errno = %d) \n", ret); } +#endif } - -static void decoding_video() +static void set_audio_eq(int value) { - int ret; - ret =player_set_video_frame_decoded_cb(g_player, video_frame_decoded_cb, (void*)g_player); - if ( ret != PLAYER_ERROR_NONE ) + bool available = FALSE; + int index, min, max; + + if(value) { - g_print("player_set_video_frame_decoded_cb is failed (errno = %d) \n", ret); + if(player_audio_effect_equalizer_is_available(g_player[0], &available)!=PLAYER_ERROR_NONE) + g_print("failed to player_audio_effect_equalizer_is_available\n"); + + if(available) + { + if((player_audio_effect_get_equalizer_bands_count(g_player[0], &index)!=PLAYER_ERROR_NONE) || + (player_audio_effect_get_equalizer_level_range(g_player[0], &min, &max)!=PLAYER_ERROR_NONE) || + (player_audio_effect_set_equalizer_band_level(g_player[0], index/2, max)!=PLAYER_ERROR_NONE)) + g_print("failed to player_audio_effect_set_equalizer_band_level index %d, level %d\n", index/2, max); + } } + + else + { + if(player_audio_effect_equalizer_clear(g_player[0])!=PLAYER_ERROR_NONE) + g_print("failed to player_audio_effect_equalizer_clear\n"); + } + +} + +static void get_audio_eq() +{ + int index, min, max, value; + player_audio_effect_get_equalizer_bands_count (g_player[0], &index); + g_print(" ==> [Player_Test] eq bands count: [%d] \n", index); + player_audio_effect_get_equalizer_level_range(g_player[0], &min, &max); + g_print(" ==> [Player_Test] eq bands range: [%d~%d] \n", min, max); + player_audio_effect_get_equalizer_band_level(g_player[0], index/2, &value); + g_print(" ==> [Player_Test] eq bands level: [%d] \n", value); + player_audio_effect_get_equalizer_band_frequency(g_player[0], 0, &value); + g_print(" ==> [Player_Test] eq bands frequency: [%d] \n", value); + player_audio_effect_get_equalizer_band_frequency_range(g_player[0], 0, &value); + g_print(" ==> [Player_Test] eq bands frequency range: [%d] \n", value); } void quit_program() { - player_unprepare(g_player); - player_destroy(g_player); - g_player = 0; + int i = 0; + + if(g_pcm_fd) + { + fclose(g_pcm_fd); + } + + for (i = 0; i < g_handle_num; i++) + { + if(g_player[i]!=NULL) + { + player_unprepare(g_player[i]); + player_destroy(g_player[i]); + g_player[i] = 0; + } + } elm_exit(); } @@ -651,7 +1204,7 @@ void _interpret_main_menu(char *cmd) } else if (strncmp(cmd, "f", 1) == 0) { - g_menu_state = CURRENT_STATUS_VOLUME; + g_menu_state = CURRENT_STATUS_VOLUME; } else if (strncmp(cmd, "g", 1) == 0) { @@ -659,9 +1212,13 @@ void _interpret_main_menu(char *cmd) float right; get_volume(&left, &right); } + else if (strncmp(cmd, "z", 1) == 0) + { + g_menu_state = CURRENT_STATUS_SOUND_TYPE; + } else if (strncmp(cmd, "h", 1) == 0 ) { - g_menu_state = CURRENT_STATUS_MUTE; + g_menu_state = CURRENT_STATUS_MUTE; } else if (strncmp(cmd, "i", 1) == 0 ) { @@ -670,23 +1227,19 @@ void _interpret_main_menu(char *cmd) } else if (strncmp(cmd, "j", 1) == 0 ) { - g_menu_state = CURRENT_STATUS_REAL_POSITION_TIME; - } - else if (strncmp(cmd, "k", 1) == 0 ) - { - g_menu_state = CURRENT_STATUS_POSITION_PERCENT; + g_menu_state = CURRENT_STATUS_POSITION_TIME; } else if (strncmp(cmd, "l", 1) == 0 ) { - get_position(); + get_position(); } else if (strncmp(cmd, "m", 1) == 0 ) { - get_duration(); + get_duration(); } else if (strncmp(cmd, "n", 1) == 0 ) { - get_stream_info(); + get_stream_info(); } else if (strncmp(cmd, "o", 1) == 0 ) { @@ -694,8 +1247,8 @@ void _interpret_main_menu(char *cmd) } else if (strncmp(cmd, "p", 1) == 0 ) { - bool looping; - get_looping(&looping); + bool looping; + get_looping(&looping); } else if (strncmp(cmd, "r", 1) == 0 ) { @@ -724,17 +1277,33 @@ void _interpret_main_menu(char *cmd) } else if (strncmp(cmd, "x", 1) == 0 ) { - g_menu_state = CURRENT_STATUS_DISPLAY_ROI; + g_menu_state = CURRENT_STATUS_DISPLAY_DST_ROI; } else if (strncmp(cmd, "y", 1) == 0 ) { - get_display_roi(); + get_display_dst_roi(); + } + else if (strncmp(cmd, "M", 1) == 0 ) + { + g_menu_state = CURRENT_STATUS_DISPLAY_ROI_MODE; + } + else if (strncmp(cmd, "N", 1) == 0 ) + { + get_display_roi_mode(); + } + else if (strncmp(cmd, "F", 1) == 0 ) + { + g_menu_state = CURRENT_STATUS_DISPLAY_SRC_CROP; + } + else if (strncmp(cmd, "G", 1) == 0 ) + { + get_display_src_crop(); } else if (strncmp(cmd, "A", 1) == 0 ) { g_menu_state = CURRENT_STATUS_SUBTITLE_FILENAME; } - else if (strncmp(cmd, "C", 1) == 0 ) + else if (strncmp(cmd, "C", 1) == 0 ) { capture_video(); } @@ -742,18 +1311,22 @@ void _interpret_main_menu(char *cmd) { decoding_audio(); } + else if (strncmp(cmd, "q", 1) == 0) + { + quit_pushing = TRUE; + quit_program(); + } else if (strncmp(cmd, "E", 1) == 0 ) { - decoding_video(); + g_menu_state = CURRENT_STATUS_AUDIO_EQUALIZER; } - else if (strncmp(cmd, "q", 1) == 0) + else if (strncmp(cmd, "H", 1) == 0 ) { - quit_pushing = TRUE; - quit_program(); + get_audio_eq(); } else { - g_print("unknown menu \n"); + g_print("unknown menu \n"); } } else if(len == 2) @@ -762,7 +1335,7 @@ void _interpret_main_menu(char *cmd) { _player_prepare(FALSE); // sync } - else if (strncmp(cmd, "pa", 2) == 0) + else if (strncmp(cmd, "pa", 2) == 0) { _player_prepare(TRUE); // async } @@ -770,20 +1343,33 @@ void _interpret_main_menu(char *cmd) { _player_unprepare(); } + else if (strncmp(cmd, "dt", 2) == 0) + { + _player_destroy(); + } else if (strncmp(cmd, "sp", 2) == 0) { _player_set_progressive_download(); } - else if (strncmp(cmd, "jj", 2) == 0 ) + else if (strncmp(cmd, "mp", 2) == 0) { - g_menu_state = CURRENT_STATUS_KEY_FRAME_POSITION_TIME; + g_memory_playback = (g_memory_playback ? FALSE : TRUE); + g_print("memory playback = %d\n", g_memory_playback); } - else + else if (strncmp(cmd, "ds", 2) == 0 ) + { + g_menu_state = CURRENT_STATUS_DISPLAY_SURFACE_CHANGE; + } + else if (strncmp(cmd, "nb", 2) == 0 ) + { + g_menu_state = CURRENT_STATUS_HANDLE_NUM; + } + else { - g_print("unknown menu \n"); + g_print("unknown menu \n"); } } - else + else { g_print("unknown menu \n"); } @@ -796,8 +1382,8 @@ void display_sub_basic() g_print("=========================================================================================\n"); g_print(" Player Test (press q to quit) \n"); g_print("-----------------------------------------------------------------------------------------\n"); - g_print("*. Sample List in [%s]\n", MMTS_SAMPLELIST_INI_DEFAULT_PATH); - + g_print("*. Sample List in [%s] \t", MMTS_SAMPLELIST_INI_DEFAULT_PATH); + g_print("nb. num. of handles \n"); for( idx = 1; idx <= INI_SAMPLE_LIST_MAX ; idx++ ) { if (strlen (g_file_list[idx-1]) > 0) @@ -811,32 +1397,33 @@ void display_sub_basic() g_print("c. Stop \t"); g_print("d. Resume\t"); g_print("e. Pause \t"); - g_print("un. Unprepare \n"); - g_print("[State] S. Player State \n"); + g_print("un. Unprepare \t"); + g_print("dt. Destroy \n"); + g_print("[State] S. Player State \n"); g_print("[ volume ] f. Set Volume\t"); - g_print("g. Get Volume\n"); + g_print("g. Get Volume\t"); + g_print("z. Set Sound type\t"); g_print("[ mute ] h. Set Mute\t"); g_print("i. Get Mute\n"); - g_print("[position] j. Set Position (T, accurate)\t"); - g_print("[position] jj. Set Position (T, key frame)\t"); - g_print("k. Set Position (%%)\t"); + g_print("[audio eq] E. Set Audio EQ\t"); + g_print("H. Get Audio EQ\n"); + g_print("[position] j. Set Position \t"); g_print("l. Get Position\n"); g_print("[duration] m. Get Duration\n"); g_print("[Stream Info] n. Get stream info (Video Size, codec, audio stream info, and tag info)\n"); g_print("[Looping] o. Set Looping\t"); g_print("p. Get Looping\n"); + g_print("[display] v. Set display visible\t"); + g_print("w. Get display visible\n"); + g_print("[display] ds. Change display surface type\n"); g_print("[x display] r. Set display mode\t"); - g_print("s. Get display mode\t"); - g_print("t. Set display Rotation\t"); - g_print("u. Get display Rotation\n"); - g_print("[x display] v. Set display visible\t"); - g_print("w. Get display visible\t"); - g_print("x. Set ROI\t"); - g_print("y. Get ROI\n"); - g_print("[subtitle] A. Set subtitle path\n"); + g_print("s. Get display mode\n"); + g_print("[x display] t. Set display Rotation\t"); + g_print("[Track] tl. Get Track language info(single only)\n"); + g_print("[subtitle] A. Set(or change) subtitle path\n"); g_print("[Video Capture] C. Capture \n"); - g_print("[Audio Frame Decode] D. Decoding Audio Frame E. Decoding Video Frame \n"); - g_print("[etc] sp. Set Progressive Download\n"); + g_print("[etc] sp. Set Progressive Download\t"); + g_print("mp. memory playback\n"); g_print("\n"); g_print("=========================================================================================\n"); } @@ -847,6 +1434,10 @@ static void displaymenu() { display_sub_basic(); } + else if (g_menu_state == CURRENT_STATUS_HANDLE_NUM) + { + g_print("*** input number of handles.(recommended only for EVAS surface)\n"); + } else if (g_menu_state == CURRENT_STATUS_FILENAME) { g_print("*** input mediapath.\n"); @@ -855,28 +1446,30 @@ static void displaymenu() { g_print("*** input volume value.(0~1.0)\n"); } + else if (g_menu_state == CURRENT_STATUS_SOUND_TYPE) + { + g_print("*** input sound type.(0:SYSTEM 1:NOTIFICATION 2:ALARM 3:RINGTONE 4:MEDIA 5:CALL 6:VOIP 7:FIXED)\n"); + } else if (g_menu_state == CURRENT_STATUS_MUTE) { g_print("*** input mute value.(0: Not Mute, 1: Mute) \n"); } - else if (g_menu_state == CURRENT_STATUS_REAL_POSITION_TIME - || g_menu_state == CURRENT_STATUS_KEY_FRAME_POSITION_TIME) + else if (g_menu_state == CURRENT_STATUS_POSITION_TIME) { g_print("*** input position value(msec)\n"); } - else if (g_menu_state == CURRENT_STATUS_POSITION_PERCENT) - { - g_print("*** input position percent(%%)\n"); - } else if (g_menu_state == CURRENT_STATUS_LOOPING) { g_print("*** input looping value.(0: Not Looping, 1: Looping) \n"); } + else if (g_menu_state == CURRENT_STATUS_DISPLAY_SURFACE_CHANGE) { + g_print("*** input display surface type.(0: X surface, 1: EVAS surface) \n"); + } else if (g_menu_state == CURRENT_STATUS_DISPLAY_MODE) { - g_print("*** input display mode value.(0: LETTER BOX, 1: ORIGIN SIZE, 2: FULL_SCREEN, 3: CROPPED_FULL) \n"); + g_print("*** input display mode value.(0: LETTER BOX, 1: ORIGIN SIZE, 2: FULL_SCREEN, 3: CROPPED_FULL, 4: ORIGIN_OR_LETTER, 5: ROI) \n"); } - else if (g_menu_state == CURRENT_STATUS_DISPLAY_ROTATION) + else if (g_menu_state == CURRENT_STATUS_DISPLAY_ROTATION) { g_print("*** input display rotation value.(0: NONE, 1: 90, 2: 180, 3: 270, 4:F LIP_HORZ, 5: FLIP_VERT ) \n"); } @@ -884,15 +1477,27 @@ static void displaymenu() { g_print("*** input display visible value.(0: HIDE, 1: SHOW) \n"); } - else if (g_menu_state == CURRENT_STATUS_DISPLAY_ROI) + else if (g_menu_state == CURRENT_STATUS_DISPLAY_ROI_MODE) + { + g_print("*** input display roi mode.(0: FULL_SCREEN, 1: LETTER BOX)\n"); + } + else if (g_menu_state == CURRENT_STATUS_DISPLAY_DST_ROI) { - g_print("*** input display roi value sequencially.(x, y, w, h)\n"); + g_print("*** input display roi value sequentially.(x, y, w, h)\n"); } - else if (g_menu_state == CURRENT_STATUS_SUBTITLE_FILENAME) + else if (g_menu_state == CURRENT_STATUS_DISPLAY_SRC_CROP) + { + g_print("*** input display source crop value sequentially.(x, y, w, h)\n"); + } + else if (g_menu_state == CURRENT_STATUS_SUBTITLE_FILENAME) { g_print(" *** input subtitle file path.\n"); } - else + else if (g_menu_state == CURRENT_STATUS_AUDIO_EQUALIZER) + { + g_print(" *** input audio eq value.(0: UNSET, 1: SET) \n"); + } + else { g_print("*** unknown status.\n"); quit_program(); @@ -926,6 +1531,20 @@ static void interpret (char *cmd) _interpret_main_menu(cmd); } break; + case CURRENT_STATUS_HANDLE_NUM: + { + int num_handle = atoi(cmd); + if (0 >= num_handle || num_handle > MAX_HANDLE) + { + g_print("not supported this number for handles(%d)\n", num_handle); + } + else + { + g_handle_num = num_handle; + } + reset_menu_state(); + } + break; case CURRENT_STATUS_FILENAME: { input_filename(cmd); @@ -939,38 +1558,38 @@ static void interpret (char *cmd) reset_menu_state(); } break; - case CURRENT_STATUS_MUTE: + case CURRENT_STATUS_SOUND_TYPE: { - int mute = atoi(cmd); - set_mute(mute); + int type = atoi(cmd); + set_sound_type(type); reset_menu_state(); } break; - case CURRENT_STATUS_REAL_POSITION_TIME: + case CURRENT_STATUS_MUTE: { - long position = atol(cmd); - set_position(position, 1); + int mute = atoi(cmd); + set_mute(mute); reset_menu_state(); } break; - case CURRENT_STATUS_KEY_FRAME_POSITION_TIME: + case CURRENT_STATUS_POSITION_TIME: { long position = atol(cmd); - set_position(position, 0); + set_position(position); reset_menu_state(); } break; - case CURRENT_STATUS_POSITION_PERCENT: + case CURRENT_STATUS_LOOPING: { - long percent = atol(cmd); - set_position_ratio(percent); + int looping = atoi(cmd); + set_looping(looping); reset_menu_state(); } break; - case CURRENT_STATUS_LOOPING: + case CURRENT_STATUS_DISPLAY_SURFACE_CHANGE: { - int looping = atoi(cmd); - set_looping(looping); + int type = atoi(cmd); + change_surface(type); reset_menu_state(); } break; @@ -981,7 +1600,7 @@ static void interpret (char *cmd) reset_menu_state(); } break; - case CURRENT_STATUS_DISPLAY_ROTATION: + case CURRENT_STATUS_DISPLAY_ROTATION: { int rotation = atoi(cmd); set_display_rotation(rotation); @@ -995,7 +1614,7 @@ static void interpret (char *cmd) reset_menu_state(); } break; - case CURRENT_STATUS_DISPLAY_ROI: + case CURRENT_STATUS_DISPLAY_DST_ROI: { int value = atoi(cmd); static int roi_x = 0; @@ -1019,7 +1638,7 @@ static void interpret (char *cmd) case 3: cnt = 0; roi_h = value; - set_display_roi(roi_x, roi_y, roi_w, roi_h); + set_display_dst_roi(roi_x, roi_y, roi_w, roi_h); roi_x = roi_y = roi_w = roi_h = 0; reset_menu_state(); break; @@ -1028,13 +1647,60 @@ static void interpret (char *cmd) } } break; - case CURRENT_STATUS_SUBTITLE_FILENAME: + case CURRENT_STATUS_DISPLAY_SRC_CROP: + { + int value = atoi(cmd); + static int crop_x = 0; + static int crop_y = 0; + static int crop_w = 0; + static int crop_h = 0; + static int crop_cnt = 0; + switch (crop_cnt) { + case 0: + crop_x = value; + crop_cnt++; + break; + case 1: + crop_y = value; + crop_cnt++; + break; + case 2: + crop_w = value; + crop_cnt++; + break; + case 3: + crop_cnt = 0; + crop_h = value; + set_display_src_crop(crop_x, crop_y, crop_w, crop_h); + crop_x = crop_y = crop_w = crop_h = 0; + reset_menu_state(); + break; + default: + break; + } + } + break; + case CURRENT_STATUS_DISPLAY_ROI_MODE: + { + int value = atoi(cmd); + set_display_roi_mode(value); + reset_menu_state(); + } + break; + case CURRENT_STATUS_SUBTITLE_FILENAME: { input_subtitle_filename(cmd); reset_menu_state(); } break; - } + case CURRENT_STATUS_AUDIO_EQUALIZER: + { + int value = atoi(cmd); + set_audio_eq(value); + reset_menu_state(); + } + break; + } g_timeout_add(100, timeout_menu_display, 0); } @@ -1065,4 +1731,3 @@ int main(int argc, char *argv[]) return appcore_efl_main(PACKAGE, &argc, &argv, &ops); } - -- 2.7.4