From 8795d140ef3195849f9a3d6d4b8e1b85c4914df4 Mon Sep 17 00:00:00 2001 From: Hyunil Park Date: Fri, 9 Jan 2015 11:21:50 +0900 Subject: [PATCH] Revert "Featuer Enhancement : A Media Player libray API is changed to Tizen2.3 version" This reverts commit e797c47808d78c9b802629505012faeb57a75824. Change-Id: I37d815cbd8b13afcc139e32f87f203022d3ff724 Signed-off-by: Hyunil Park --- AUTHORS | 4 +- CMakeLists.txt | 23 +- LICENSE.APLv2 | 2 - capi-media-player.manifest | 8 - capi-media-player.pc.in | 2 +- doc/images/capi_media_player_state_diagram.png | Bin 50644 -> 0 bytes doc/player_doc.h | 359 ----- include/player.h | 1720 ++++++++++++++---------- include/player_private.h | 35 +- packaging/capi-media-player.spec | 53 +- src/player.c | 1602 +++++++++++----------- test/CMakeLists.txt | 18 +- test/player_media_packet_test.c | 449 ------- test/player_test.c | 1119 ++++----------- 14 files changed, 2097 insertions(+), 3297 deletions(-) delete mode 100644 capi-media-player.manifest delete mode 100644 doc/images/capi_media_player_state_diagram.png delete mode 100644 doc/player_doc.h delete mode 100644 test/player_media_packet_test.c diff --git a/AUTHORS b/AUTHORS index b01c60f..68b49ae 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,2 +1,2 @@ -Kangho Hur -Seungkeun Lee +Kangho Hur +Seungkeun Lee diff --git a/CMakeLists.txt b/CMakeLists.txt index 298b94b..4497476 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 "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") +SET(dependents "dlog mm-player capi-base-common capi-media-sound-manager mm-ta") +SET(pc_dependents "capi-base-common capi-media-sound-manager") INCLUDE(FindPkgConfig) pkg_check_modules(${fw_name} REQUIRED ${dependents}) @@ -19,17 +19,24 @@ FOREACH(flag ${${fw_name}_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) -SET(CMAKE_C_FLAGS "-I./include ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror") +SET(CMAKE_C_FLAGS "-I./include ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -Wno-error=unused-but-set-variable -DGST_EXT_TIME_ANALYSIS") SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") IF("${ARCH}" STREQUAL "arm") ADD_DEFINITIONS("-DTARGET") ENDIF("${ARCH}" STREQUAL "arm") +IF(WAYLAND_SUPPORT) + ADD_DEFINITIONS("-DHAVE_WAYLAND") +ENDIF(WAYLAND_SUPPORT) +IF(X11_SUPPORT) + ADD_DEFINITIONS("-DHAVE_X11") +ENDIF(X11_SUPPORT) + ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") ADD_DEFINITIONS("-DTIZEN_DEBUG") -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib") +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}") aux_source_directory(src SOURCES) ADD_LIBRARY(${fw_name} SHARED ${SOURCES}) @@ -43,7 +50,7 @@ SET_TARGET_PROPERTIES(${fw_name} CLEAN_DIRECT_OUTPUT 1 ) -INSTALL(TARGETS ${fw_name} DESTINATION lib) +INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR}) INSTALL( DIRECTORY ${INC_DIR}/ DESTINATION include/media FILES_MATCHING @@ -61,7 +68,7 @@ CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc @ONLY ) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION lib/pkgconfig) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) ADD_SUBDIRECTORY(test) @@ -69,10 +76,10 @@ IF(UNIX) ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution) ADD_CUSTOM_COMMAND( - DEPENDS clean + DEPENDS clean COMMENT "distribution clean" COMMAND find - ARGS . + ARGS . -not -name config.cmake -and \( -name tester.c -or -name Testing -or diff --git a/LICENSE.APLv2 b/LICENSE.APLv2 index bbe9d02..9c13a9b 100644 --- a/LICENSE.APLv2 +++ b/LICENSE.APLv2 @@ -202,5 +202,3 @@ Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. See the License for the specific language governing permissions and limitations under the License. - - diff --git a/capi-media-player.manifest b/capi-media-player.manifest deleted file mode 100644 index e3deed8..0000000 --- a/capi-media-player.manifest +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/capi-media-player.pc.in b/capi-media-player.pc.in index 5d02f8d..1997d91 100644 --- a/capi-media-player.pc.in +++ b/capi-media-player.pc.in @@ -3,7 +3,7 @@ prefix=@PREFIX@ exec_prefix=/usr -libdir=/usr/lib +libdir=@LIB_INSTALL_DIR@ includedir=/usr/include/media Name: @PC_NAME@ diff --git a/doc/images/capi_media_player_state_diagram.png b/doc/images/capi_media_player_state_diagram.png deleted file mode 100644 index 2d62d9989e29c6a0e170e422635cf631ce500069..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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=xh6dvesbAXLgNJrb>#-~KL#r16A}Cn%U)7O3~K@#8;g{^ zS2Ua*enf09rfx4{V`XJzZI2SMGkR)oWJu{`W^YRQSW-q_?G-K|3Pp*M6ctu>9$g-H zc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w$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 08f3656..d1a3e95 100644 --- a/include/player.h +++ b/include/player.h @@ -19,13 +19,12 @@ #include #include -#include #ifdef __cplusplus extern "C" { #endif -#define PLAYER_ERROR_CLASS TIZEN_ERROR_PLAYER | 0x20 +#define PLAYER_ERROR_CLASS TIZEN_ERROR_MULTIMEDIA_CLASS | 0x20 /** * @file player.h @@ -38,112 +37,104 @@ extern "C" { */ /** - * @brief The media player's type handle. - * @since_tizen 2.3 + * @brief Media player handle type. */ typedef struct player_s *player_h; /** - * @brief Enumeration for media player state. - * @since_tizen 2.3 + * @brief Enumerations of media player state */ typedef enum { - PLAYER_STATE_NONE, /**< Player is not created */ - PLAYER_STATE_IDLE, /**< Player is created, but not prepared */ - PLAYER_STATE_READY, /**< Player is ready to play media */ - PLAYER_STATE_PLAYING, /**< Player is playing media */ - PLAYER_STATE_PAUSED, /**< Player is paused while playing media */ + PLAYER_STATE_NONE, /**< Player is not created */ + PLAYER_STATE_IDLE, /**< Player is created, but not prepared */ + PLAYER_STATE_READY, /**< Player is ready to play media */ + PLAYER_STATE_PLAYING, /**< Player is playing media */ + PLAYER_STATE_PAUSED, /**< Player is paused while playing media */ } player_state_e; + + /** - * @brief Enumeration for media player's error codes. - * @since_tizen 2.3 + * @brief Error codes for media player */ typedef enum { - PLAYER_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ - PLAYER_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */ - PLAYER_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */ - PLAYER_ERROR_NO_SUCH_FILE = TIZEN_ERROR_NO_SUCH_FILE, /**< No such file or directory */ - PLAYER_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */ - PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE = TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE, /**< No space left on the device */ - PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */ - PLAYER_ERROR_SEEK_FAILED = PLAYER_ERROR_CLASS | 0x01, /**< Seek operation failure */ - PLAYER_ERROR_INVALID_STATE = PLAYER_ERROR_CLASS | 0x02, /**< Invalid state */ - PLAYER_ERROR_NOT_SUPPORTED_FILE = PLAYER_ERROR_CLASS | 0x03, /**< File format not supported */ - PLAYER_ERROR_INVALID_URI = PLAYER_ERROR_CLASS | 0x04, /**< Invalid URI */ - PLAYER_ERROR_SOUND_POLICY = PLAYER_ERROR_CLASS | 0x05, /**< Sound policy error */ - PLAYER_ERROR_CONNECTION_FAILED = PLAYER_ERROR_CLASS | 0x06, /**< Streaming connection failed */ - PLAYER_ERROR_VIDEO_CAPTURE_FAILED = PLAYER_ERROR_CLASS | 0x07, /**< Video capture failed */ - PLAYER_ERROR_DRM_EXPIRED = PLAYER_ERROR_CLASS | 0x08, /**< Expired license */ - PLAYER_ERROR_DRM_NO_LICENSE = PLAYER_ERROR_CLASS | 0x09, /**< No license */ - PLAYER_ERROR_DRM_FUTURE_USE = PLAYER_ERROR_CLASS | 0x0a, /**< License for future use */ - PLAYER_ERROR_DRM_NOT_PERMITTED = PLAYER_ERROR_CLASS | 0x0b, /**< Format not permitted */ - PLAYER_ERROR_RESOURCE_LIMIT = PLAYER_ERROR_CLASS | 0x0c, /**< Resource limit */ - PLAYER_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */ + PLAYER_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ + PLAYER_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */ + PLAYER_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */ + PLAYER_ERROR_NO_SUCH_FILE = TIZEN_ERROR_NO_SUCH_FILE, /**< No such file or directory */ + PLAYER_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */ + PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE = TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE, /**< No space left on device */ + PLAYER_ERROR_SEEK_FAILED = PLAYER_ERROR_CLASS | 0x01 , /**< Seek operation failure */ + PLAYER_ERROR_INVALID_STATE = PLAYER_ERROR_CLASS | 0x02 , /**< Invalid state */ + PLAYER_ERROR_NOT_SUPPORTED_FILE = PLAYER_ERROR_CLASS | 0x03 , /**< Not supported file format */ + PLAYER_ERROR_INVALID_URI = PLAYER_ERROR_CLASS | 0x04 , /**< Invalid URI */ + PLAYER_ERROR_SOUND_POLICY = PLAYER_ERROR_CLASS | 0x05 , /**< Sound policy error */ + PLAYER_ERROR_CONNECTION_FAILED = PLAYER_ERROR_CLASS | 0x06, /**< Streaming connection failed */ + PLAYER_ERROR_VIDEO_CAPTURE_FAILED = PLAYER_ERROR_CLASS | 0x07, /**< Video capture failure */ + PLAYER_ERROR_DRM_EXPIRED = PLAYER_ERROR_CLASS | 0x08, /**< Expired license */ + PLAYER_ERROR_DRM_NO_LICENSE = PLAYER_ERROR_CLASS | 0x09, /**< No license */ + PLAYER_ERROR_DRM_FUTURE_USE = PLAYER_ERROR_CLASS | 0x0a, /**< License for future use */ + PLAYER_ERROR_DRM_NOT_PERMITTED = PLAYER_ERROR_CLASS | 0x0b /**< Not permitted format */ } player_error_e; /** - * @brief Enumeration for media player's interruption type. - * @since_tizen 2.3 + * @brief Enumerations of player interrupted type */ typedef enum { - PLAYER_INTERRUPTED_COMPLETED = 0, /**< Interrupt completed */ - PLAYER_INTERRUPTED_BY_MEDIA, /**< Interrupted by a non-resumable media application */ - PLAYER_INTERRUPTED_BY_CALL, /**< Interrupted by an incoming call */ - PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG, /**< Interrupted by unplugging headphones */ - 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_NOTIFICATION, /**< Interrupted by a notification */ + PLAYER_INTERRUPTED_COMPLETED = 0, /**< Interrupt completed*/ + PLAYER_INTERRUPTED_BY_MEDIA, /**< Interrupted by non-resumable media application*/ + PLAYER_INTERRUPTED_BY_CALL, /**< Interrupted by incoming call*/ + PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG, /**< Interrupted by unplugging headphone*/ + PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT, /**< Interrupted by resource conflict*/ + PLAYER_INTERRUPTED_BY_ALARM, /**< Interrupted by alarm*/ + PLAYER_INTERRUPTED_BY_EMERGENCY, /**< Interrupted by emergency*/ + PLAYER_INTERRUPTED_BY_RESUMABLE_MEDIA, /**< Interrupted by resumable media application*/ } player_interrupted_code_e; /** - * @brief Enumeration for progressive download message type. - * @since_tizen 2.3 + * @brief Enumerations of progressive download message type */ typedef enum { - PLAYER_PD_STARTED = 0, /**< Progressive download is started */ - PLAYER_PD_COMPLETED, /**< Progressive download is completed */ + PLAYER_PD_STARTED = 0, /**< Progressive download is started */ + PLAYER_PD_COMPLETED, /**< Progressive download is completed */ } player_pd_message_type_e; /** - * @brief Enumeration for display type. - * @since_tizen 2.3 + * @brief + * Enumerations of display type */ typedef enum { - 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_X11 = 0, /**< X surface display */ + PLAYER_DISPLAY_TYPE_EVAS = 1, /**< Evas image object surface display */ } player_display_type_e; /** - * @brief Enumeration for audio latency mode. - * @since_tizen 2.3 + * @brief Enumerations of audio latency mode */ typedef enum { - AUDIO_LATENCY_MODE_LOW = 0, /**< Low audio latency mode */ - AUDIO_LATENCY_MODE_MID, /**< Middle audio latency mode */ - AUDIO_LATENCY_MODE_HIGH, /**< High audio latency mode */ + AUDIO_LATENCY_MODE_LOW = 0, /**< Low audio latency mode*/ + AUDIO_LATENCY_MODE_MID, /**< Middle audio latency mode*/ + AUDIO_LATENCY_MODE_HIGH, /**< High audio latency mode*/ } audio_latency_mode_e; /** - * @brief The player display handle. - * @since_tizen 2.3 + * @brief Player display handle + * */ typedef void* player_display_h; #ifndef GET_DISPLAY /** - * @brief Definition for a display handle from evas object. - * @since_tizen 2.3 + * @brief Gets a display handle from x window id or evas object */ -#define GET_DISPLAY(x) (void*)(x) +#include +#define GET_DISPLAY(x) ((void*)((intptr_t)(x))) #endif /** @@ -151,36 +142,35 @@ typedef void* player_display_h; */ /** - * @addtogroup CAPI_MEDIA_PLAYER_DISPLAY_MODULE + * @addtogroup CAPI_MEDIA_PLAYER_X11_DISPLAY_MODULE * @{ */ /** - * @brief Enumeration for display rotation type. - * @since_tizen 2.3 + * @brief Enumerations of x surface display rotation type. */ typedef enum { - PLAYER_DISPLAY_ROTATION_NONE, /**< Display is not rotated */ - PLAYER_DISPLAY_ROTATION_90, /**< Display is rotated 90 degrees */ - PLAYER_DISPLAY_ROTATION_180, /**< Display is rotated 180 degrees */ - PLAYER_DISPLAY_ROTATION_270, /**< Display is rotated 270 degrees */ + PLAYER_DISPLAY_ROTATION_NONE, /**< Display is not rotated */ + PLAYER_DISPLAY_ROTATION_90, /**< Display is rotated 90 degrees */ + PLAYER_DISPLAY_ROTATION_180, /**< Display is rotated 180 degrees */ + PLAYER_DISPLAY_ROTATION_270, /**< Display is rotated 270 degrees */ } player_display_rotation_e; /** - * @brief Enumeration for x surface display aspect ratio. - * @since_tizen 2.3 + * @brief Enumerations of x surface display aspect ratio */ 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_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_ROI, /**< ROI mode*/ } player_display_mode_e; + /** * @} */ @@ -191,74 +181,155 @@ typedef enum */ /** - * @brief Enumeration for media stream content information. - * @since_tizen 2.3 + * @brief Enumerations of media stream content information */ typedef enum { - PLAYER_CONTENT_INFO_ALBUM, /**< Album */ - PLAYER_CONTENT_INFO_ARTIST, /**< Artist */ - PLAYER_CONTENT_INFO_AUTHOR, /**< Author */ - PLAYER_CONTENT_INFO_GENRE, /**< Genre */ - PLAYER_CONTENT_INFO_TITLE, /**< Title */ - PLAYER_CONTENT_INFO_YEAR, /**< Year */ + PLAYER_CONTENT_INFO_ALBUM, /**< Album */ + PLAYER_CONTENT_INFO_ARTIST, /**< Artist */ + PLAYER_CONTENT_INFO_AUTHOR, /**< Author */ + PLAYER_CONTENT_INFO_GENRE, /**< Genre */ + PLAYER_CONTENT_INFO_TITLE, /**< Title */ + PLAYER_CONTENT_INFO_YEAR, /**< Year */ } 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; +/** * @} */ +/** + * @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; + +/** + * @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; + +/** + * @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); + +/** + * @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); + +/** + * @} + */ /** - * @addtogroup CAPI_MEDIA_PLAYER_SUBTITLE_MODULE + * @addtogroup CAPI_MEDIA_PLAYER_X11_DISPLAY_MODULE * @{ */ /** - * @brief Called when the subtitle is updated. - * @since_tizen 2.3 - * @param[in] duration The duration of the updated subtitle - * @param[in] text The text of the updated subtitle - * @param[in] user_data The user data passed from the callback registration function - * @see player_set_subtitle_updated_cb() - * @see player_unset_subtitle_updated_cb() + * @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 void (*player_subtitle_updated_cb)(unsigned long duration, char *text, void *user_data); +typedef unsigned int (*player_x11_pixmap_updated_cb)(void *user_data); + +/** + * @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); /** * @} */ + /** * @addtogroup CAPI_MEDIA_PLAYER_MODULE * @{ */ /** - * @brief Called when the media player is prepared. - * @since_tizen 2.3 - * @details It will be invoked when player has reached the begin of stream. + * @brief Called when the media player is prepared. + * @details It will be invoked when player has reached the begin of stream * @param[in] user_data The user data passed from the callback registration function - * @pre player_prepare_async() will cause this callback. - * @post The player state will be #PLAYER_STATE_READY. + * @pre player_prepare_async() will cause this callback + * @post The player state will be #PLAYER_STATE_READY * @see player_prepare_async() */ typedef void (*player_prepared_cb)(void *user_data); /** - * @brief Called when the media player is completed. - * @since_tizen 2.3 - * @details It will be invoked when player has reached the end of the stream. + * @brief Called when the media player is completed. + * @details It will be invoked when player has reached to the end of the stream. * @param[in] user_data The user data passed from the callback registration function - * @pre It will be invoked when the playback is completed if you register this callback using player_set_completed_cb(). + * @pre It will be invoked when playback completed if you register this callback using player_set_completed_cb() * @see player_set_completed_cb() * @see player_unset_completed_cb() */ typedef void (*player_completed_cb)(void *user_data); /** - * @brief Called when the seek operation is completed. - * @since_tizen 2.3 + * @brief Called when the seek operation is completed. * @param[in] user_data The user data passed from the callback registration function * @see player_set_position() * @see player_set_position_ratio() @@ -266,8 +337,7 @@ typedef void (*player_completed_cb)(void *user_data); typedef void (*player_seek_completed_cb)(void *user_data); /** - * @brief Called when the media player is interrupted. - * @since_tizen 2.3 + * @brief Called when the media player is interrupted. * @param[in] error_code The interrupted error code * @param[in] user_data The user data passed from the callback registration function * @see player_set_interrupted_cb() @@ -276,9 +346,8 @@ typedef void (*player_seek_completed_cb)(void *user_data); typedef void (*player_interrupted_cb)(player_interrupted_code_e code, void *user_data); /** - * @brief Called when an error occurs in the media player. - * @since_tizen 2.3 - * @param[in] error_code The error code + * @brief Called when the media player occured error. + * @param[in] error_code Error code * @param[in] user_data The user data passed from the callback registration function * @see player_set_error_cb() * @see player_unset_error_cb() @@ -287,8 +356,7 @@ typedef void (*player_interrupted_cb)(player_interrupted_code_e code, void *user typedef void (*player_error_cb)(int error_code, void *user_data); /** - * @brief Called when the buffering percentage of the media playback is updated. - * @since_tizen 2.3 + * @brief Called when the buffering percentage of media playback is updated. * @details If the buffer is full, it will return 100%. * @param[in] percent The percentage of buffering completed (0~100) * @param[in] user_data The user data passed from the callback registration function @@ -297,50 +365,69 @@ typedef void (*player_error_cb)(int error_code, void *user_data); */ typedef void (*player_buffering_cb)(int percent, void *user_data); + /** - * @brief Called when progressive download is started or completed. - * @since_tizen 2.3 - * @param[in] type The message type for progressive download + * @brief Called when the subtitle is updated. + * @param[in] duration The duration of subtitle updated + * @param[in] text The text of subtitle updated + * @param[in] user_data The user data passed from the callback registration function + * @see player_set_subtitle_updated_cb() + * @see player_unset_subtitle_updated_cb() + */ +typedef void (*player_subtitle_updated_cb)(unsigned long duration, char *text, void *user_data); + +/** + * @brief Called when the progressive download is started or completed. + * @param[in] type The message type of progressive download * @param[in] user_data The user data passed from the callback registration function * @see player_set_progressive_download_path() */ typedef void (*player_pd_message_cb)(player_pd_message_type_e type, void *user_data); /** - * @brief Called when the video is captured. - * @since_tizen 2.3 - * @remarks The color space format of the captured image is IMAGE_UTIL_COLORSPACE_RGB888. + * @brief Called when the video is captured. + * @remarks The color space format of the captured image is #IMAGE_UTIL_COLORSPACE_RGB888. * @param[in] data The captured image buffer - * @param[in] width The width of the captured image - * @param[in] height The height of the captured image - * @param[in] size The size of the captured image + * @param[in] width The width of captured image + * @param[in] height The height of captured image + * @param[in] size The size of captured image * @param[in] user_data The user data passed from the callback registration function * @see player_capture_video() */ typedef void (*player_video_captured_cb)(unsigned char *data, int width, int height, unsigned int size, void *user_data); /** - * @brief Called to register for notifications about delivering media packet when every video frame is decoded. - * @since_tizen 2.3 - * - * @remarks This function is issued in the context of gstreamer so the UI update code should not be directly invoked.\n - * the packet should be released by media_packet_destroy() after use. \n - * Otherwises, decoder can't work more because it can't have enough buffer to fill decoded frame. - * - * @param[in] pkt Reference pointer to the media packet - * @param[in] user_data The user data passed from the callback registration function + * @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_media_packet_video_decoded_cb)(media_packet_h pkt, void *user_data); +typedef void (*player_video_frame_decoded_cb)(unsigned char *data, int width, int height, unsigned int size, void *user_data); + +/** + * @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); /** * @brief Creates a player handle for playing multimedia content. - * @since_tizen 2.3 - * @remarks You must release @a player by using player_destroy().\n - * Although you can create multiple player handles at the same time, - * the player cannot guarantee proper operation because of limited resources, such as - * audio or display device. + * @remarks @a player must be released player_destroy() by you. + * @remarks + * Although you can create multiple player handles at the same time, + * the player cannot guarantee proper operation because of limited resources, such as + * audio or display device. * - * @param[out] player A new handle to the media player + * @param[out] player A new handle to media player * @retval #PLAYER_ERROR_NONE Successful * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter * @retval #PLAYER_ERROR_OUT_OF_MEMORY Out of memory @@ -350,17 +437,18 @@ typedef void (*player_media_packet_video_decoded_cb)(media_packet_h pkt, void *u */ int player_create(player_h *player); + /** * @brief Destroys the media player handle and releases all its resources. - * @since_tizen 2.3 + * * @remarks To completely shutdown player operation, call this function with a valid player handle from any player state. - * @param[in] player The handle to the media player to be destroyed - * @return @c 0 on success, - * otherwise a negative error value + * + * @param[in] player The handle to media player to be destroyed + * @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 set to #PLAYER_STATE_IDLE. + * @pre The player state should be #PLAYER_STATE_IDLE * @post The player state will be #PLAYER_STATE_NONE. * @see player_create() */ @@ -368,22 +456,16 @@ int player_destroy(player_h player); /** * @brief Prepares the media player for playback. - * @since_tizen 2.3 - * @remarks The mediastorage privilege(http://tizen.org/privilege/mediastorage) should be added if any video/audio files are used to play located in the internal storage. - * @remarks The externalstorage privilege(http://tizen.org/privilege/externalstorage) should be added if any video/audio files are used to play located in the external storage. - * @remarks The internet privilege(http://tizen.org/privilege/internet) should be added if any URLs are used to play from network. - * @param[in] player The handle to the media player - * @return @c 0 on success, - * otherwise a negative error value + * @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_URI Invalid URI * @retval #PLAYER_ERROR_NO_SUCH_FILE File not found - * @retval #PLAYER_ERROR_NOT_SUPPORTED_FILE File not supported + * @retval #PLAYER_ERROR_NOT_SUPPORTED_FILE Not supported file * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @retval #PLAYER_ERROR_PERMISSION_DENIED Permission denied - * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). After that, call player_set_uri() to load the media content you want to play. + * @pre The player state should be #PLAYER_STATE_IDLE by player_create() or player_unprepare(). After that, call player_set_uri() to load the media content you want to play. * @post The player state will be #PLAYER_STATE_READY. * @see player_prepare_async() * @see player_unprepare() @@ -393,25 +475,17 @@ int player_prepare(player_h player); /** * @brief Prepares the media player for playback, asynchronously. - * @since_tizen 2.3 - * @remarks The mediastorage privilege(http://tizen.org/privilege/mediastorage) should be added if any video/audio files are used to play located in the internal storage. - * @remarks The externalstorage privilege(http://tizen.org/privilege/externalstorage) should be added if any video/audio files are used to play located in the external storage. - * @remarks The internet privilege(http://tizen.org/privilege/internet) should be added if any URLs are used to play from network. - * @param[in] player The handle to the 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 @c 0 on success, - * otherwise a negative error value + * @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_URI Invalid URI * @retval #PLAYER_ERROR_NO_SUCH_FILE File not found - * @retval #PLAYER_ERROR_NOT_SUPPORTED_FILE File not supported + * @retval #PLAYER_ERROR_NOT_SUPPORTED_FILE Not supported file * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @retval #PLAYER_ERROR_PERMISSION_DENIED Permission denied - * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). After that, call player_set_uri() to load the media content you want to play. - * @post It invokes player_prepared_cb() when playback is prepared. + * @pre The player state should be #PLAYER_STATE_IDLE by player_create() or player_unprepare().. After that, call player_set_uri() to load the media content you want to play.. + * @post It invokes player_prepared_cb() when playback is prepare. * @see player_prepare() * @see player_prepared_cb() * @see player_unprepare() @@ -420,43 +494,43 @@ int player_prepare(player_h player); int player_prepare_async (player_h player, player_prepared_cb callback, void* user_data); /** - * @brief Resets the media player. - * @details The most recently used media is reset and no longer associated with the player. - * Playback is no longer possible. If you want to use the player again, you will have to set the data URI and call - * player_prepare() again. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @return @c 0 on success, - * otherwise a negative error value + * @brief Reset the media player. + * @details + * The most recently used media is reset and no longer associated with the player. + * Playback is no longer possible. If you want to use the player again, you will have to set the data URI and call + * player_prepare() again. + * @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 * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @pre The player state should be higher than #PLAYER_STATE_IDLE. + * @pre The player state should be #PLAYER_STATE_READY by player_prepare() or player_stop(). * @post The player state will be #PLAYER_STATE_IDLE. * @see player_prepare() */ int player_unprepare(player_h player); /** - * @brief Sets the data source (file-path, HTTP or RSTP URI) to use. + * @brief Sets the data source (file-path, http or rtsp URI) to use. * - * @details Associates media contents, referred to by the URI, with the player. - * If the function call is successful, subsequent calls to player_prepare() and player_start() will start playing the media. - * @since_tizen 2.3 - * @remarks If you use HTTP or RSTP, URI should start with "http://" or "rtsp://". The default protocol is "file://". - * If you provide an invalid URI, you won't receive an error message until you call player_start(). + * @details + * Associates media contents, referred to by the URI, with the player. + * If the function call is successful, subsequent calls to player_prepare() and player_start() will start playing the media. * - * @param[in] player The handle to the media player - * @param[in] uri The content location, such as the file path, the URI of the HTTP or RSTP stream you want to play + * @remarks + * If you use http or rtsp, URI should start with "http://" or "rtsp://". The default protocol is "file://". + * If you provide an invalid URI, you won't receive an error message until you call player_start(). * - * @return @c 0 on success, - * otherwise a negative error value + * @param[in] player The handle to media player + * @param[in] uri Specifies the content location, such as the file path, the URI of the http or rtsp stream you want to play + * + * @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 set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). + * @pre The player state should be #PLAYER_STATE_IDLE by player_create() or player_unprepare(). * @see player_set_memory_buffer() */ int player_set_uri(player_h player, const char * uri); @@ -464,51 +538,51 @@ int player_set_uri(player_h player, const char * uri); /** * @brief Sets memory as the data source. * - * @details Associates media content, cached in memory, with the player. Unlike the case of player_set_uri(), the media resides in memory. - * If the function call is successful, subsequent calls to player_prepare() and player_start() will start playing the media. - * @since_tizen 2.3 - * @remarks If you provide an invalid data, you won't receive an error message until you call player_start(). + * @details + * Associates media content, cached in memory, with the player. Unlike the case of player_set_uri(), the media resides in memory. + * If the function call is successful, subsequent calls to player_prepare() and player_start() will start playing the media. + * + * @remarks + * If you provide an invalid data, you won't receive an error message until you call player_start(). * - * @param[in] player The handle to the media player + * + * @param[in] player The handle to media player * @param[in] data The memory pointer of media data * @param[in] size The size of media data - * @return @c 0 on success, - * otherwise a negative error value + * @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 set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). + * @pre The player state should be #PLAYER_STATE_IDLE by player_create() or player_unprepare(). * @see player_set_uri() */ int player_set_memory_buffer(player_h player, const void * data, int size); /** * @brief Gets the player's current state. - * @since_tizen 2.3 - * @param[in] player The handle to the media player + * @param[in] player The handle to media player * @param[out] state The current state of the player - * @return @c 0 on success, - * otherwise a negative error value + * @return 0 on success, otherwise a negative error value. * @retval #PLAYER_ERROR_NONE Successful * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter * @see #player_state_e */ int player_get_state(player_h player, player_state_e *state); + /** * @brief Sets the player's volume. - * @since_tizen 2.3 - * @details Setting this volume adjusts the player's instance volume, not the system volume. - * The valid range is from 0 to 1.0, inclusive (1.0 = 100%). Default value is 1.0. - * To change system volume, use the @ref CAPI_MEDIA_SOUND_MANAGER_MODULE API. - * Finally, it does not support to set other value into each channel currently. * - * @param[in] player The handle to the media player - * @param[in] left The left volume scalar - * @param[in] right The right volume scalar - * @return @c 0 on success, - * otherwise a negative error value + * @details + * The range of @a left and @c right is from 0 to 1.0, inclusive (1.0 = 100%). Default value is 1.0. + * Setting this volume adjusts the player volume, not the system volume. + * To change system volume, use the @ref CAPI_MEDIA_SOUND_MANAGER_MODULE API. + * + * @param[in] player The handle to media player + * @param[in] left Left volume scalar + * @param[in] right Right volume scalar + * @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 @@ -516,18 +590,17 @@ int player_get_state(player_h player, player_state_e *state); */ int player_set_volume(player_h player, float left, float right); + /** * @brief Gets the player's current volume factor. - * @since_tizen 2.3 - * @details The range of @a left and @a right is from @c 0 to @c 1.0, inclusive (1.0 = 100%). - * This function gets the player volume, not the system volume. - * To get the system volume, use the @ref CAPI_MEDIA_SOUND_MANAGER_MODULE API. * - * @param[in] player The handle to the media player + * @details The range of @a left and @a right is from 0 to 1.0, inclusive (1.0 = 100%). This function gets the player volume, not the system volume. + * To get the system volume, use the @ref CAPI_MEDIA_SOUND_MANAGER_MODULE API. + * + * @param[in] player The handle to media player * @param[out] left The current left volume scalar * @param[out] right The current right volume scalar - * @return @c 0 on success, - * otherwise a negative error value + * @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 @@ -536,73 +609,68 @@ int player_set_volume(player_h player, float left, float right); int player_get_volume(player_h player, float *left, float *right); /** - * @brief Sets the player's volume type. - * @since_tizen 2.3 - * @remarks The default sound type of the player is #SOUND_TYPE_MEDIA. - * To get the current sound type, use sound_manager_get_current_sound_type(). + * @brief Sets the player's sound type. * - * @param[in] player The handle to the media player + * @remarks + * The default sound type of player is #SOUND_TYPE_MEDIA. + * To get current sound type, use the sound_manager_get_current_sound_type(). + * + * @param[in] player The handle to media player * @param[in] type The sound type - * @return @c 0 on success, - * otherwise a negative error value + * @return 0 on success, otherwise a negative error value. * @retval #PLAYER_ERROR_NONE Successful * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create(). + * @pre The player state must be #PLAYER_STATE_IDLE by player_create(). * @see sound_manager_get_current_sound_type() */ int player_set_sound_type(player_h player, sound_type_e type); /** - * @brief Sets the audio latency mode. - * @since_tizen 2.3 - * @remarks The default audio latency mode of the player is #AUDIO_LATENCY_MODE_MID. - * To get the current audio latency mode, use player_get_audio_latency_mode(). - * If it's high mode, audio output interval can be increased so, it can keep more audio data to play. - * But, state transition like pause or resume can be more slower than default(mid) mode. + * @brief Set the latency mode of audio. * - * @param[in] player The handle to the media player - * @param[in] latency_mode The latency mode to be applied to the audio - * @return @c 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 #audio_latency_mode_e - * @see player_get_audio_latency_mode() + * @remarks + * The default audio latency mode of player is #AUDIO_LATENCY_MODE_MID. + * To get current audio latency mode, use player_get_audio_latency_mode(). + * + * @param[in] player The handle to media player. + * @param[in] latency_mode The latency mode to be applyed to audio. + * @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 #audio_latency_mode_e. + * @see player_get_audio_latency_mode(). */ int player_set_audio_latency_mode(player_h player, audio_latency_mode_e latency_mode); /** - * @brief Gets the current audio latency mode. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @param[out] latency_mode The latency mode to get from the audio - * @return @c 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 #audio_latency_mode_e - * @see player_set_audio_latency_mode() + * @brief Get current latency mode of audio. + * @param[in] player The handle to media player. + * @param[out] latency_mode The latency mode to get from audio. + * @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 #audio_latency_mode_e. + * @see player_set_audio_latency_mode(). */ int player_get_audio_latency_mode(player_h player, audio_latency_mode_e *latency_mode); /** * @brief Starts or resumes playback. - * @since_tizen 2.3 + * * @details Plays current media content, or resumes play if paused. * - * @param[in] player The handle to the media player - * @return @c 0 on success, - * otherwise a negative error value + * @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 * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state * @retval #PLAYER_ERROR_CONNECTION_FAILED Network connection failed * @retval #PLAYER_ERROR_SOUND_POLICY Sound policy error - * @pre player_prepare() must be called before calling this function. - * @pre The player state must be set to #PLAYER_STATE_READY by calling player_prepare() or set to #PLAYER_STATE_PAUSED by calling player_pause(). + * @pre Call player_prepare() before calling this function. + * @pre The player state must be #PLAYER_STATE_READY by player_prepare() or #PLAYER_STATE_PAUSED by player_pause(). * @post The player state will be #PLAYER_STATE_PLAYING. * @post It invokes player_completed_cb() when playback completes, if you set a callback with player_set_completed_cb(). * @post It invokes player_pd_message_cb() when progressive download starts or completes, if you set a download path with player_set_progressive_download_path() and a callback with player_set_progressive_download_message_cb(). @@ -618,18 +686,17 @@ int player_get_audio_latency_mode(player_h player, audio_latency_mode_e *latency */ int player_start(player_h player); + /** * @brief Stops playing media content. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @return @c 0 on success, - * otherwise a negative error value + * @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 state * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state * @retval #PLAYER_ERROR_SOUND_POLICY Sound policy error - * @pre The player state must be set to #PLAYER_STATE_PLAYING by calling player_start() or set to #PLAYER_STATE_PAUSED by calling player_pause(). + * @pre The player state must be either #PLAYER_STATE_PLAYING by player_start() or #PLAYER_STATE_PAUSED by player_pause(). * @post The player state will be #PLAYER_STATE_READY. * @post The downloading will be aborted if you use progressive download. * @see player_start() @@ -639,18 +706,17 @@ int player_stop(player_h player); /** * @brief Pauses the player. - * @since_tizen 2.3 - * @remarks You can resume playback using player_start(). * - * @param[in] player The handle to the media player - * @return @c 0 on success, - * otherwise a negative error value + * @remarks Playback can be resumed with player_start(). + * + * @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 state * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state * @retval #PLAYER_ERROR_SOUND_POLICY Sound policy error - * @pre The player state must be set to #PLAYER_STATE_PLAYING. + * @pre The player state must be #PLAYER_STATE_PLAYING. * @post The player state will be #PLAYER_STATE_READY. * @see player_start() */ @@ -658,52 +724,103 @@ int player_pause(player_h player); /** * @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 - * @param[in] accurate If @c true the selected position is returned, but this might be considerably slow, - * otherwise @c false + * @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 @c 0 on success, - * otherwise a negative error value + * @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_play_position() + * @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); + +/** + * @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); + +/** + * @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_play_position(player_h player, int millisecond, bool accurate, player_seek_completed_cb callback, void *user_data); +int player_set_position_ratio(player_h player, int percent, player_seek_completed_cb callback, void *user_data); /** - * @brief Gets the current position in milliseconds. - * @since_tizen 2.3 - * @param[in] player The handle to the media player + * @brief Gets current position in milliseconds. + * @param[in] player The handle to media player * @param[out] millisecond The current position in milliseconds - * @return @c 0 on success, - * otherwise a negative error value + * @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_set_play_position() + * @see player_get_position_ratio() + * @see player_set_position() + * @see player_set_position_ratio() + */ + +int player_get_position(player_h player, int *millisecond); + +/** + * @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_play_position(player_h player, int *millisecond); +int player_get_position_ratio(player_h player, int *percent); /** * @brief Sets the player's mute status. - * @since_tizen 2.3 - * @details If the mute status is @c true, no sounds are played. - * If it is @c false, sounds are played at the previously set volume level. - * Until this function is called, by default the player is not muted. * - * @param[in] player The handle to the media player - * @param[in] muted The new mute status: (@c true = mute, @c false = not muted) - * @return @c 0 on success, - * otherwise a negative error value + * @details If the mute status is @c true, no sounds will be played. If @c false, sounds will be played at the previously set volume level. Until this function is called, by default the player is not muted. + * + * @param[in] player The handle to media player + * @param[in] muted New mute status: (@c true = mute, @c false = not muted) + * @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 @@ -714,14 +831,12 @@ int player_set_mute(player_h player, bool muted); /** * @brief Gets the player's mute status. - * @since_tizen 2.3 - * @details If the mute status is @c true, no sounds are played. - * If it is @c false, sounds are played at the previously set volume level. * - * @param[in] player The handle to the media player + * @details If the mute status is @c true, no sounds are played. If @c false, sounds are played at previously set volume level. + * + * @param[in] player The handle to media player * @param[out] muted The current mute status: (@c true = mute, @c false = not muted) - * @return @c 0 on success, - * otherwise a negative error value + * @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 @@ -732,14 +847,12 @@ int player_is_muted(player_h player, bool *muted); /** * @brief Sets the player's looping status. - * @since_tizen 2.3 - * @details If the looping status is @c true, playback automatically restarts upon finishing. - * If it is @c false, it won't. The default value is @c false. * - * @param[in] player The handle to the media player - * @param[in] looping The new looping status: (@c true = looping, @c false = non-looping ) - * @return @c 0 on success, - * otherwise a negative error value + * @details If the looping status is @c true, playback will automatically restart upon finishing. If @c false, it won't. The default value is false. + * + * @param[in] player The handle to media player + * @param[in] looping New looping status: (@c true = looping, @c false = non-looping ) + * @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 @@ -749,16 +862,15 @@ int player_is_muted(player_h player, bool *muted); */ int player_set_looping(player_h player, bool looping); + /** * @brief Gets the player's looping status. - * @since_tizen 2.3 - * @details If the looping status is @c true, playback automatically restarts upon finishing. - * If it is @c false, it won't. * - * @param[in] player The handle to the media player + * @details If the looping status is @c true, playback will automatically restart upon finishing. If @c false, it won't. + * + * @param[in] player The handle to media player * @param[out] looping The looping status: (@c true = looping, @c false = non-looping ) - * @return @c 0 on success, - * otherwise a negative error value + * @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 @@ -769,57 +881,71 @@ int player_set_looping(player_h player, bool looping); int player_is_looping(player_h player, bool *looping); /** + * @brief Gets the total running time of the associated media. + * @remarks The media source is associated with the player, using either player_set_uri() or player_set_memory_buffer(). + * @remarks The playback type should be local playback or http streaming playback. + * @param[in] player The handle to media player + * @param[out] duration The duration is 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_INVALID_STATE Invalid player state + * @pre The player state must be one of: #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. + * @see player_get_position() + * @see player_set_uri() + * @see player_set_memory_buffer() + */ +int player_get_duration(player_h player, int *duration); + +/** * @brief Sets the video display. - * @since_tizen 2.3 - * @remarks To get @a display to set, use #GET_DISPLAY(). - * @remarks To use the multiple surface display mode, use player_set_display() again with a different display type. - * @param[in] player The handle to the media player + * @remaks To get @a display to set, use #GET_DISPLAY(). + * @remaks To use multiple surface display mode, use player_set_display() again with different display type. + * @param[in] player The handle to media player * @param[in] type The display type * @param[in] display The handle to display - * @return @c 0 on success, - * otherwise a negative error value + * @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_set_display_rotation */ int player_set_display(player_h player, player_display_type_e type, player_display_h display); /** - * @} - */ - -/** - * @addtogroup CAPI_MEDIA_PLAYER_DISPLAY_MODULE - * @{ + * @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); /** - * @brief Sets the video display mode. - * @since_tizen 2.3 - * @remarks If no display is set, no operation is performed. - * @param[in] player The handle to the media player + * @brief Sets a video display mode + * @remarks If no display is not set, no operation is performed. + * @param[in] player The handle to media player * @param[in] mode The display mode - * @return @c 0 on success, - * otherwise a negative error value + * @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 - * @pre The player should support display mode changes. + * @pre The player should be supported display mode changing. (player_is_display_mode_changeable()) * @see player_get_display_mode() */ int player_set_display_mode(player_h player, player_display_mode_e mode); /** - * @brief Gets the video display mode. - * @since_tizen 2.3 - * @remarks If no display is set, no operation is performed. - * @param[in] player The handle to the media player + * @brief Gets the video display mode + * @remarks If no display is not set, no operation is performed. + * @param[in] player The handle to media player * @param[out] mode The current display mode - * @return @c 0 on success, - * otherwise a negative error value + * @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() @@ -827,67 +953,199 @@ int player_set_display_mode(player_h player, player_display_mode_e mode); int player_get_display_mode(player_h player, player_display_mode_e *mode); /** + * @brief Sets the playback rate + * @details The default value is 1.0. + * @remarks #PLAYER_ERROR_INVALID_OPERATION occured if streaming playbak. + * @remarks No operation is performed, if @a rate is 0. + * @remarks The sound is muted, when playback rate is under 0.0 and over 2.0. + * @param[in] player The handle to media player + * @param[in] rate The playback rate (-5.0x ~ 5.0x) + * @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 #PLAYER_STATE_PLAYING by player_start(). + * @pre The player state must be #PLAYER_STATE_READY by player_prepare() or #PLAYER_STATE_PLAYING by player_start() or #PLAYER_STATE_PAUSED by player_pause(). + */ +int player_set_playback_rate(player_h player, float rate); + +/** + * @} + */ + +/** + * @addtogroup CAPI_MEDIA_PLAYER_X11_DISPLAY_MODULE + * @{ + */ + +/** + * @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); + +/** + * @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); + +/** * @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 ) - * @return @c 0 on success, - * otherwise a negative error value + * @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_display_visible() + * @see player_is_x11_display_visible() */ -int player_set_display_visible(player_h player, bool visible); +int player_set_x11_display_visible(player_h player, bool visible); /** - * @brief Gets the visibility of the x surface video display. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @param[out] visible The current visibility of the display (@c true = visible, @c false = non-visible ) - * @return @c 0 on success, - * otherwise a negative error value + * @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_display_visible() + * @see player_set_x11_display_visible() */ -int player_is_display_visible(player_h player, bool* visible); +int player_is_x11_display_visible(player_h player, bool* visible); /** - * @brief Sets the rotation settings of the video surface display. - * @since_tizen 2.3 - * @details Use this function to change the video orientation to portrait mode. - * @param[in] player The handle to the media player - * @param[in] rotation The rotation of the display - * @return @c 0 on success, - * otherwise a negative error value + * @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 - * @retval #PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature - * @retval #PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE In case of using evasimagesink by PLAYER_DISPLAY_TYPE_EVAS - * @see player_set_display - * @see player_get_display_rotation() + * @see player_get_x11_display_zoom() */ -int player_set_display_rotation(player_h player, player_display_rotation_e rotation); +int player_set_x11_display_zoom(player_h player, int level); /** - * @brief Gets the rotation of the video surface display. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @param[out] rotation The current rotation of the display - * @return @c 0 on success, - * otherwise a negative error value + * @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_display_rotation() + * @see player_set_x11_display_zoom() */ -int player_get_display_rotation( player_h player, player_display_rotation_e *rotation); +int player_get_x11_display_zoom( player_h player, int *level); + +/** + * @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); + +/** + * @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); + +/** + * @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); + +/** + * @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); /** * @} */ +/** + * @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); + +/** + * @} + */ /** * @addtogroup CAPI_MEDIA_PLAYER_STREAM_INFO_MODULE @@ -895,139 +1153,112 @@ int player_get_display_rotation( player_h player, player_display_rotation_e *rot */ /** - * @brief Gets the media content information. - * @since_tizen 2.3 - * @remarks You must release @a value using @c free(). - * @remarks The playback type should be local playback or HTTP streaming playback. - * @param[in] player The handle to the media player + * @brief Get the media content information + * @remarks @a value must be released with @c free() by you + * @remarks The playback type should be local playback or http streaming playback. + * @param[in] player The handle to media player * @param[in] key The key attribute name to get - * @param[out] value The value of the key attribute \n - * It can be an empty string if there is no content information. - * @return @c 0 on success, - * otherwise a negative error value + * @param[out] value The value of the key attribute. It can be empty string if there is no content information. + * @return 0 on success, otherwise a negative error value * @retval #PLAYER_ERROR_NONE Successful * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter * @retval #PLAYER_ERROR_OUT_OF_MEMORY Not enough memory is available * @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_PLAYING or #PLAYER_STATE_PAUSED. + * @pre The player state must be one of: #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. */ int player_get_content_info(player_h player, player_content_info_e key, char ** value); /** - * @brief Gets the audio and video codec information. - * @since_tizen 2.3 - * @remarks You must release @a audio_codec and @a video_codec using free(). - * @remarks The playback type should be local playback or HTTP streaming playback. - * @param[in] player The handle to the media player - * @param[out] audio_codec The name of the audio codec \n - * It can be @c NULL if there is no audio codec. - * @param[out] video_codec The name of the video codec \n - * It can be @c NULL if there is no video codec. - * @return @c 0 on success, - * otherwise a negative error value + * @brief Gets the audio and video codec information + * @remarks @a audio_codec and @a video_codec must be released with @c free() by you + * @remarks The playback type should be local playback or http streaming playback. + * @param[in] player The handle to media player + * @param[out] audio_codec The name of audio codec. It can be @c NULL if there is no audio codec. + * @param[out] video_codec The name of video codec. It can be @c NULL if there is no video codec. + * @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_PLAYING or #PLAYER_STATE_PAUSED. + * @pre The player state must be one of: #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. */ int player_get_codec_info(player_h player, char **audio_codec, char **video_codec); /** - * @brief Gets the audio stream information. - * @since_tizen 2.3 - * @remarks The playback type should be local playback or HTTP streaming playback. - * @param[in] player The handle to the media player - * @param[out] sample_rate The audio sample rate [Hz] \n - * Value can be invalid if there is no audio stream information. - * @param[out] channel The audio channel (1: mono, 2: stereo) \n - * Value can be invalid if there is no audio stream information. - * @param[out] bit_rate The audio bit rate [Hz] \n - * Value can be invalid if there is no audio stream information. - * @return @c 0 on success, - * otherwise a negative error value + * @brief Gets the audio stream information + * @remarks The playback type should be local playback or http streaming playback. + * @param[in] player The handle to media player + * @param[out] sample_rate The audio sample rate [Hz]. It can be invalid value if there is no audio stream information. + * @param[out] channel The audio channel (1: mono, 2: stereo). It can be invalid value if there is no audio stream information. + * @param[out] bit_rate The audio bit rate [Hz]. It can be invalid value if there is no audio stream information. + * @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_PLAYING or #PLAYER_STATE_PAUSED. + * @pre The player state must be one of: #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. */ int player_get_audio_stream_info(player_h player, int *sample_rate, int *channel, int *bit_rate); /** - * @brief Gets the video stream information. - * @since_tizen 2.3 - * @remarks The playback type should be local playback or HTTP streaming playback. - * @param[in] player The handle to the media player - * @param[out] fps The frame per second of the video \n - * It can be @c 0 if there is no video stream information. - * @param[out] bit_rate The video bit rate [Hz] \n - * It can be an invalid value if there is no video stream information. - * @return @c 0 on success, - * otherwise a negative error value + * @brief Gets the video stream information + * @remarks The playback type should be local playback or http streaming playback. + * @param[in] player The handle to media player + * @param[out] fps The frame per second of video. It can be 0 if there is no video stream information. + * @param[out] bit_rate The video bit rate [Hz]. It can be invalid value if there is no video stream information. + * @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_PLAYING or #PLAYER_STATE_PAUSED. + * @pre The player state must be one of: #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. */ int player_get_video_stream_info(player_h player, int *fps, int *bit_rate); /** * @brief Gets the video display's height and width. - * @since_tizen 2.3 - * @remarks The playback type should be local playback or HTTP streaming playback. - * @param[in] player The handle to the media player - * @param[out] width The width of the video \n - * Value can be invalid if there is no video or no display is set. - * @param[out] height The height of the video \n - * Value can be invalid value if there is no video or no display is set. - * @return @c 0 on success, - * otherwise a negative error value + * @remarks The playback type should be local playback or http streaming playback. + * @param[in] player The handle to media player + * @param[out] width The width of video. It can be invalid value if there is no video, no display was set. + * @param[out] height The height of video. It can be invalid value if there is no video, no display was 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_OPERATION Invalid operation * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @pre The player state must be one of these: #PLAYER_STATE_PLAYING or #PLAYER_STATE_PAUSED. + * @pre The player state must be one of: #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. */ int player_get_video_size(player_h player, int *width, int *height); /** - * @brief Gets the album art in the media resource. - * @since_tizen 2.3 - * @remarks You must not release @a album_art. It will be released by framework when the player is destroyed. - * @param[in] player The handle to the media player - * @param[out] album_art The encoded artwork image - * @param[out] size The encoded artwork size - * @return @c 0 on success, - * otherwise a negative error value + * @brief Gets the album art in media resource + * @remarks Do not release @a album_art. It will be released by framework when player destroys. + * @param[in] player The handle to media player + * @param [out] artwork encoded artwork image + * @param [out] size encoded artwork size + * @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_PLAYING or #PLAYER_STATE_PAUSED. + * @pre The player state must be one of: #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. */ int player_get_album_art(player_h player, void **album_art, int *size); /** - * @brief Gets the total running time of the associated media. - * @since_tizen 2.3 - * @remarks The media source is associated with the player, using either player_set_uri() or player_set_memory_buffer(). - * @remarks The playback type should be local playback or HTTP streaming playback. - * @param[in] player The handle to the media player - * @param[out] duration The duration in milliseconds - * @return @c 0 on success, - * otherwise a negative error value + * @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_PLAYING or #PLAYER_STATE_PAUSED. - * @see player_set_uri() - * @see player_set_memory_buffer() + * @pre The player state must be one of these: #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. */ -int player_get_duration(player_h player, int *duration); +int player_get_track_count(player_h player, player_track_type_e type, int *count); /** * @} @@ -1040,65 +1271,156 @@ int player_get_duration(player_h player, int *duration); */ /** - * @brief Gets the number of equalizer bands. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @param[out] count The number of equalizer bands - * @return @c 0 on success, - * otherwise a negative error value + * @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_set_equalizer_band_level() - * @see player_audio_effect_set_equalizer_all_bands() + * @see player_audio_effect_get_value() + * @see player_audio_effect_clear() + * @see player_audio_effect_get_value_range() */ -int player_audio_effect_get_equalizer_bands_count (player_h player, int *count); +int player_audio_effect_set_value(player_h player, audio_effect_e effect, int value); /** - * @brief Sets the gain set for the given equalizer band. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @param[in] index The index of the equalizer band to be set - * @param[in] level The new gain in decibel that is set to the given band [dB] - * @return @c 0 on success, - * otherwise a negative error value + * @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); + +/** + * @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_get_equalizer_bands_count() - * @see player_audio_effect_get_equalizer_level_range() - * @see player_audio_effect_get_equalizer_band_level() - * @see player_audio_effect_set_equalizer_all_bands() + * @see player_audio_effect_set_value() */ -int player_audio_effect_set_equalizer_band_level(player_h player, int index, int level); +int player_audio_effect_clear(player_h player, audio_effect_e effect); /** - * @brief Gets the gain set for the given equalizer band. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @param[in] index The index of the requested equalizer band - * @param[out] level The gain in decibel of the given band [dB] - * @return @c 0 on success, - * otherwise a negative error value + * @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); + +/** + * @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); + +/** + * @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); + +/** + * @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); + +/** + * @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); + +/** + * @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); + +/** + * @brief Gets the bands number of equalizer. + * @param[in] player The handle to media player + * @param[out] count The number of equalizer bands + * @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_equalizer_band_level() + * @see player_audio_effect_set_equalizer_all_bands() */ -int player_audio_effect_get_equalizer_band_level(player_h player, int index, int *level); +int player_audio_effect_get_equalizer_bands_count (player_h player, int *count); /** - * @brief Sets all bands of the equalizer. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @param[in] band_levels The list of band levels to be set + * @brief Sets the all bands of equalizer. + * @param[in] player The handle to media player + * @param[in] band_levels The list of band level to be set * @param[in] length The length of the band level - * @return @c 0 on success, - * otherwise a negative error value + * @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 @@ -1111,13 +1433,43 @@ int player_audio_effect_get_equalizer_band_level(player_h player, int index, int int player_audio_effect_set_equalizer_all_bands(player_h player, int *band_levels, int length); /** - * @brief Gets the valid band level range of the equalizer. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @param[out] min The minimum value to be set [dB] + * @brief Sets the gain set for the given equalizer band. + * @param[in] player The handle to media player + * @param[in] index The index of qualizer band to be set + * @param[in] level New gain in decibel that will be set to the given band.[dB] + * @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_equalizer_bands_count() + * @see player_audio_effect_get_equalizer_level_range() + * @see player_audio_effect_get_equalizer_band_level() + * @see player_audio_effect_set_equalizer_all_bands() + */ +int player_audio_effect_set_equalizer_band_level(player_h player, int index, int level); + +/** + * @brief Gets the gain set for the given equalizer band. + * @param[in] player The handle to media player + * @param[in] index The index of qualizer band which is requested + * @param[out] level The gain in decibel of the given band [dB] + * @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_equalizer_band_level() + */ +int player_audio_effect_get_equalizer_band_level(player_h player, int index, int *level); + +/** + * @brief Gets the valid band level range of equalizer. + * @param[in] player The handle to media player + * @param[out] min The minumum value to be set [dB] * @param[out] max The maximum value to be set [dB] - * @return @c 0 on success, - * otherwise a negative error value + * @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 @@ -1128,13 +1480,11 @@ int player_audio_effect_set_equalizer_all_bands(player_h player, int *band_level int player_audio_effect_get_equalizer_level_range(player_h player, int* min, int* max); /** - * @brief Gets the band frequency of the equalizer. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @param[in] index The index of the requested equalizer band + * @brief Gets the band frequency of equalizer. + * @param[in] player The handle to media player + * @param[in] index The index of qualizer band which is requested * @param[out] frequency The frequency of the given band [dB] - * @return @c 0 on success, - * otherwise a negative error value + * @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 @@ -1143,13 +1493,11 @@ int player_audio_effect_get_equalizer_level_range(player_h player, int* min, int int player_audio_effect_get_equalizer_band_frequency(player_h player, int index, int *frequency); /** - * @brief Gets the band frequency range of the equalizer. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @param[in] index The index of the requested equalizer band + * @brief Gets the band frequency range of equalizer. + * @param[in] player The handle to media player + * @param[in] index The index of qualizer band which is requested * @param[out] range The frequency range of the given band [dB] - * @return @c 0 on success, - * otherwise a negative error value + * @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 @@ -1159,8 +1507,8 @@ int player_audio_effect_get_equalizer_band_frequency_range(player_h player, int /** * @brief Clears the equalizer effect. - * @since_tizen 2.3 - * @param[in] player The handle to the media player + * @param[in] player The handle to media player + * @param[in] effect The audio effect type * @retval #PLAYER_ERROR_NONE Successful * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation @@ -1172,11 +1520,9 @@ int player_audio_effect_get_equalizer_band_frequency_range(player_h player, int int player_audio_effect_equalizer_clear(player_h player); /** - * @brief Checks whether the custom equalizer effect is available. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @param[out] available If @c true the specified audio effect is available, - * otherwise @c false + * @brief Checks whether the custom equilizer effect is avaliable or not. + * @param[in] player The handle to media player + * @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 @@ -1190,26 +1536,82 @@ int player_audio_effect_equalizer_is_available(player_h player, bool *available) * @} */ - /** * @addtogroup CAPI_MEDIA_PLAYER_MODULE * @{ */ /** + * @brief Sets a subtitle path. + * @remarks Only MicroDVD/SubViewer(*.sub), SAMI(*.smi), and SubRip(*.srt) subtitle formats are supported. + * @param[in] player The handle to media player + * @param[in] path The absolute path of the subtitle file + * @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 should be #PLAYER_STATE_IDLE by player_create() or player_unprepare(). + */ +int player_set_subtitle_path(player_h player,const char *path); + +/** + * @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); + +/** + * @brief Sets a path to download, progressively. + * @remarks Progressive download will be started when you invoke player_start(). + * @param[in] player The handle to media player + * @param[in] path The absolute path to download + * @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 should be #PLAYER_STATE_IDLE by player_create() or player_unprepare(). + * @see player_set_progressive_download_message_cb() + * @see player_unset_progressive_download_message_cb() + */ +int player_set_progressive_download_path(player_h player, const char *path); + +/** + * @brief Gets the staus of progressive download. + * @param[in] player The handle to media player + * @param[out] current The current download position (bytes) + * @param[out] total_size The total size of file (bytes) + * @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 progressive download path must be set by player_set_progressive_download_path(). + * @pre The player state must be either #PLAYER_STATE_PLAYING by player_start() or #PLAYER_STATE_PAUSED by player_pause(). + */ +int player_get_progressive_download_status(player_h player, unsigned long *current, unsigned long *total_size); + +/** * @brief Captures the video frame, asynchronously. - * @since_tizen 2.3 - * @param[in] player The handle to the media player + * @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 @c 0 on success, - * otherwise a negative error value + * @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 - * Video type should be set using player_set_display() otherwises, audio stream is only processed even though video file is set. * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @pre The player state must be set to #PLAYER_STATE_PLAYING by calling player_start() or set to #PLAYER_STATE_PAUSED by calling player_pause(). + * @pre The player state must be #PLAYER_STATE_PLAYING by player_start() or #PLAYER_STATE_PAUSED by player_pause(). * @post It invokes player_video_captured_cb() when capture completes, if you set a callback. * @see player_video_captured_cb() */ @@ -1217,66 +1619,58 @@ int player_capture_video(player_h player, player_video_captured_cb callback, voi /** * @brief Sets the cookie for streaming playback. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @param[in] cookie The cookie to set - * @param[in] size The size of the cookie - * @return @c 0 on success, - * otherwise a negative error value + * @param[in] player The handle to media player + * @param[in] cookie The cookie to set + * @param[in] size The size of cookie + * @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 set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). + * @pre The player state should be #PLAYER_STATE_IDLE by player_create() or player_unprepare(). * @see player_set_streaming_user_agent() */ int player_set_streaming_cookie(player_h player, const char *cookie, int size); /** - * @brief Sets the streaming user agent for playback. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @param[in] user_agent The user agent to set - * @param[in] size The size of the user agent - * @return @c 0 on success, - * otherwise a negative error value + * @brief Sets the user agent for streaming playback. + * @param[in] player The handle to media player + * @param[in] user_agent The user agent to set + * @param[in] size The size of user agent + * @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 set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). + * @pre The player state should be #PLAYER_STATE_IDLE by player_create() or player_unprepare(). * @see player_set_streaming_cookie() */ int player_set_streaming_user_agent(player_h player, const char *user_agent, int size); /** * @brief Gets the download progress for streaming playback. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @param[out] start The starting position in percentage [0, 100] - * @param[out] current The current position in percentage [0, 100] - * @return @c 0 on success, - * otherwise a negative error value + * @param[in] player The handle to media player + * @param[out] start The starting position in percent [0, 100] + * @param[out] current The current position in percent [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_INVALID_STATE Invalid player state - * @pre The player state must be set to #PLAYER_STATE_PLAYING by calling player_start() or set to #PLAYER_STATE_PAUSED by calling player_pause(). + * @pre The player state must be either #PLAYER_STATE_PLAYING by player_start() or #PLAYER_STATE_PAUSED by player_pause(). */ int player_get_streaming_download_progress(player_h player, int *start, int *current); /** - * @brief Registers a callback function to be invoked when the playback is finished. - * @since_tizen 2.3 - * @param[in] player The handle to the media player + * @brief Registers a callback function to be invoked when the playback finishes. + * @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 @c 0 on success, - * otherwise a negative error value + * @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 - * @post player_completed_cb() will be invoked. + * @post player_completed_cb() will be invoked * @see player_unset_completed_cb() * @see player_completed_cb() * @see player_start() @@ -1284,11 +1678,9 @@ int player_get_streaming_download_progress(player_h player, int *start, int *cur int player_set_completed_cb(player_h player, player_completed_cb callback, void *user_data); /** - * @brief Unregisters the callback function. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @return @c 0 on success, - * otherwise a negative error value + * @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 @@ -1297,17 +1689,15 @@ int player_set_completed_cb(player_h player, player_completed_cb callback, void int player_unset_completed_cb(player_h player); /** - * @brief Registers a callback function to be invoked when the playback is interrupted or the interrupt is completed. - * @since_tizen 2.3 - * @param[in] player The handle to the media player + * @brief Registers a callback function to be invoked when the playback is interrupted or interrupt completed. + * @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 @c 0 on success, - * otherwise a negative error value + * @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 - * @post player_interrupted_cb() will be invoked. + * @post player_interrupted_cb() will be invoked * @see player_unset_interrupted_cb() * @see #player_interrupted_code_e * @see player_interrupted_cb() @@ -1316,10 +1706,8 @@ int player_set_interrupted_cb(player_h player, player_interrupted_cb callback, v /** * @brief Unregisters the callback function. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @return @c 0 on success, - * otherwise a negative error value + * @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 @@ -1328,17 +1716,15 @@ int player_set_interrupted_cb(player_h player, player_interrupted_cb callback, v int player_unset_interrupted_cb(player_h player); /** - * @brief Registers a callback function to be invoked when an error occurs. - * @since_tizen 2.3 - * @param[in] player The handle to the media player + * @brief Registers a callback function to be invoked when error occured. + * @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 @c 0 on success, - * otherwise a negative error value + * @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 - * @post player_error_cb() will be invoked. + * @post player_error_cb() will be invoked * @see player_unset_error_cb() * @see player_error_cb() */ @@ -1346,10 +1732,9 @@ int player_set_error_cb(player_h player, player_error_cb callback, void *user_da /** * @brief Unregisters the callback function. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @return @c 0 on success, - * otherwise a negative error value + * + * @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 @@ -1359,17 +1744,15 @@ int player_unset_error_cb(player_h player); /** * @brief Registers a callback function to be invoked when there is a change in the buffering status of a media stream. - * @since_tizen 2.3 - * @remarks The media resource should be streamed over the network. - * @param[in] player The handle to the media player + * @remarks The media resource should be streamed over the network. + * @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 @c 0 on success, - * otherwise a negative error value + * @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 - * @post player_buffering_cb() will be invoked. + * @post player_buffering_cb() will be invoked * @see player_unset_buffering_cb() * @see player_set_uri() * @see player_buffering_cb() @@ -1378,10 +1761,8 @@ int player_set_buffering_cb(player_h player, player_buffering_cb callback, void /** * @brief Unregisters the callback function. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @return @c 0 on success, - * otherwise a negative error value + * @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 @@ -1390,53 +1771,16 @@ int player_set_buffering_cb(player_h player, player_buffering_cb callback, void int player_unset_buffering_cb(player_h player); /** - * @brief Sets a path to download, progressively. - * @since_tizen 2.3 - * @remarks Progressive download will be started when you invoke player_start(). - * @param[in] player The handle to the media player - * @param[in] path The absolute path to download - * @return @c 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 set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). - * @see player_set_progressive_download_message_cb() - * @see player_unset_progressive_download_message_cb() - */ -int player_set_progressive_download_path(player_h player, const char *path); - -/** - * @brief Gets the status of progressive download. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @param[out] current The current download position (bytes) - * @param[out] total_size The total size of the file (bytes) - * @return @c 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 progressive download path must be set by calling player_set_progressive_download_path(). - * @pre The player state must be set to #PLAYER_STATE_PLAYING by calling player_start() or set to #PLAYER_STATE_PAUSED by calling player_pause(). - */ -int player_get_progressive_download_status(player_h player, unsigned long *current, unsigned long *total_size); - -/** - * @brief Registers a callback function to be invoked when progressive download is started or completed. - * @since_tizen 2.3 - * @param[in] player The handle to the media player + * @brief Registers a callback function to be invoked when progressive download is starts or completes. + * @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 @c 0 on success, - * otherwise a negative error value + * @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 path to download must be set by calling player_set_progressive_download_path(). - * @post player_pd_message_cb() will be invoked. + * @pre The path to download must be set by player_set_progressive_download_path(). + * @post player_pd_message_cb() will be invoked * @see player_unset_progressive_download_message_cb() * @see player_set_progressive_download_path() */ @@ -1444,10 +1788,8 @@ int player_set_progressive_download_message_cb(player_h player, player_pd_messag /** * @brief Unregisters the callback function. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @return @c 0 on success, - * otherwise a negative error value + * @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 @@ -1456,60 +1798,16 @@ int player_set_progressive_download_message_cb(player_h player, player_pd_messag int player_unset_progressive_download_message_cb(player_h player); /** - * @brief Sets the playback rate. - * @since_tizen 2.3 - * @details The default value is @c 1.0. - * @remarks #PLAYER_ERROR_INVALID_OPERATION occurs when streaming playback. - * @remarks No operation is performed, if @a rate is @c 0. - * @remarks The sound is muted, when playback rate is under @c 0.0 and over @c 2.0. - * @param[in] player The handle to the media player - * @param[in] rate The playback rate (-5.0x ~ 5.0x) - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @pre The player state must be set to #PLAYER_STATE_PLAYING by calling player_start(). - * @pre The player state must be set to #PLAYER_STATE_READY by calling player_prepare() or set to #PLAYER_STATE_PLAYING by calling player_start() or set to #PLAYER_STATE_PAUSED by calling player_pause(). - */ -int player_set_playback_rate(player_h player, float rate); - -/** - * @} - */ - -/** - * @addtogroup CAPI_MEDIA_PLAYER_SUBTITLE_MODULE - * @{ - */ - -/** - * @brief Sets a subtitle path. - * @since_tizen 2.3 - * @remarks Only MicroDVD/SubViewer(*.sub), SAMI(*.smi), and SubRip(*.srt) subtitle formats are supported. - * @param[in] player The handle to the media player - * @param[in] path The absolute path of the subtitle file, it can be @c NULL in the #PLAYER_STATE_IDLE state. - * @return @c 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. - * @pre The path value can be @c NULL for reset when the player state is set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). - */ -int player_set_subtitle_path(player_h player,const char *path); - -/** - * @brief Registers a callback function to be invoked when a subtitle updates. - * @since_tizen 2.3 - * @param[in] player The handle to the media player + * @brief Registers a callback function to be invoked when subtitle updates. + * @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 @c 0 on success, - * otherwise a negative error value + * @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 subtitle must be set by calling player_set_subtitle_path(). - * @post player_subtitle_updated_cb() will be invoked. + * @pre The subtitle must be set by player_set_subtitle_path(). + * @post player_subtitle_updated_cb() will be invoked * @see player_unset_subtitle_updated_cb() * @see player_subtitle_updated_cb() * @see player_set_subtitle_path() @@ -1518,10 +1816,8 @@ int player_set_subtitle_updated_cb(player_h player, player_subtitle_updated_cb c /** * @brief Unregisters the callback function. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @return @c 0 on success, - * otherwise a negative error value + * @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 @@ -1530,56 +1826,60 @@ int player_set_subtitle_updated_cb(player_h player, player_subtitle_updated_cb c int player_unset_subtitle_updated_cb(player_h player); /** - * @internal - * @brief Sets the seek position for the subtitle. - * @since_tizen 2.3 - * @remarks Only MicroDVD/SubViewer(*.sub), SAMI(*.smi), and SubRip(*.srt) subtitle formats are supported. - * @param[in] player The handle to the media player - * @param[in] millisecond The position in milliseconds from the start to the seek point - * @return @c 0 on success, - * otherwise a negative error value + * @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 - * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @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. + * @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_subtitle_position_offset(player_h player, int millisecond); +int player_set_video_frame_decoded_cb(player_h player, player_video_frame_decoded_cb callback, void *user_data); /** - * @brief Registers a media packet video callback function to be called once per frame. - * @since_tizen 2.3 - * @remarks This function should be called before preparing. \n - * A registered callback is called on the internal thread of the player. \n - * A video frame can be retrieved using a registered callback as a media packet.\n - * The callback function holds the same buffer that will be drawn on the display device.\n - * So if you change the media packet in a registerd callback, it will be displayed on the device\n - * and the media packet is available until it's destroyed by media_packet_destroy(). - * @param[in] player The handle to the media player - * @param[in] callback The callback function to be registered - * @param[in] user_data The user data to be passed to the callback function - * @return @c 0 on success, - * otherwise a negative error value + * @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_STATE Invalid state - * @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 + * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation + * @see player_set_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_unset_video_frame_decoded_cb(player_h player); + +/** + * @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); /** * @brief Unregisters the callback function. - * @since_tizen 2.3 - * @param[in] player The handle to the media player - * @return @c 0 on success, - * otherwise a negative error value + * @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 - * @see player_set_media_packet_video_frame_decoded_cb() + * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation + * @see player_set_audio_frame_decoded_cb() */ -int player_unset_media_packet_video_frame_decoded_cb(player_h player); +int player_unset_audio_frame_decoded_cb(player_h player); /** * @} diff --git a/include/player_private.h b/include/player_private.h index 93501cd..39e7bee 100644 --- a/include/player_private.h +++ b/include/player_private.h @@ -23,28 +23,6 @@ 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, @@ -54,17 +32,13 @@ 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_AUDIO_FRAME, _PLAYER_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR, _PLAYER_EVENT_TYPE_PD, _PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT, _PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT_PRESET, _PLAYER_EVENT_TYPE_MISSED_PLUGIN, -#ifdef _PLAYER_FOR_PRODUCT - _PLAYER_EVENT_TYPE_IMAGE_BUFFER, - _PLAYER_EVENT_TYPE_SELECTED_SUBTITLE_LANGUAGE, -#endif _PLAYER_EVENT_TYPE_NUM }_player_event_e; @@ -80,15 +54,8 @@ 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 c780c43..52e0f75 100644 --- a/packaging/capi-media-player.spec +++ b/packaging/capi-media-player.spec @@ -1,23 +1,30 @@ +%bcond_with wayland +%bcond_with x + Name: capi-media-player Summary: A Media Player library in Tizen Native API -Version: 0.1.58 -Release: 0 +Version: 0.1.1 +Release: 1 Group: Multimedia/API License: Apache-2.0 Source0: %{name}-%{version}.tar.gz +Source1001: capi-media-player.manifest BuildRequires: cmake BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(mm-player) BuildRequires: pkgconfig(capi-base-common) BuildRequires: pkgconfig(capi-media-sound-manager) -BuildRequires: pkgconfig(gstreamer-1.0) +BuildRequires: pkgconfig(mm-ta) BuildRequires: pkgconfig(appcore-efl) BuildRequires: pkgconfig(elementary) BuildRequires: pkgconfig(ecore) BuildRequires: pkgconfig(evas) +%if %{with x} BuildRequires: pkgconfig(ecore-x) -BuildRequires: pkgconfig(capi-media-tool) -BuildRequires: pkgconfig(libtbm) +%endif +%if %{with wayland} +BuildRequires: pkgconfig(ecore-wayland) +%endif Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig @@ -25,26 +32,33 @@ Requires(postun): /sbin/ldconfig %description A Media Player library in Tizen Native API. + %package devel Summary: A Media Player library in Tizen Native API (Development) -Group: Multimedia/API +Group: Development/Multimedia Requires: %{name} = %{version}-%{release} %description devel %devel_desc + %prep %setup -q +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 . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} +%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \ +%if %{with wayland} + -DWAYLAND_SUPPORT=On \ +%else + -DWAYLAND_SUPPORT=Off \ +%endif +%if %{with x} + -DX11_SUPPORT=On +%else + -DX11_SUPPORT=Off +%endif make %{?jobs:-j%jobs} @@ -52,25 +66,26 @@ make %{?jobs:-j%jobs} %install rm -rf %{buildroot} mkdir -p %{buildroot}/usr/share/license -mkdir -p %{buildroot}/opt/usr/devel +mkdir -p %{buildroot}/usr/bin cp LICENSE.APLv2 %{buildroot}/usr/share/license/%{name} -cp test/player_test %{buildroot}/opt/usr/devel - +cp test/player_test %{buildroot}/usr/bin %make_install -%post -/sbin/ldconfig +%post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files +%manifest %{name}.manifest +%license LICENSE.APLv2 %manifest capi-media-player.manifest %{_libdir}/libcapi-media-player.so.* %{_datadir}/license/%{name} -/opt/usr/devel/* +%{_bindir}/* %files devel +%manifest %{name}.manifest %{_includedir}/media/*.h %{_libdir}/pkgconfig/*.pc %{_libdir}/libcapi-media-player.so diff --git a/src/player.c b/src/player.c index a496e11..97036c0 100644 --- a/src/player.c +++ b/src/player.c @@ -25,60 +25,34 @@ #include #include #include -#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) +#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") /* * Internal Implementation */ -int __player_convert_error_code(int code, char* func_name) +static int __convert_error_code(int code, char* func_name) { int ret = PLAYER_ERROR_INVALID_OPERATION; char* msg="PLAYER_ERROR_INVALID_OPERATION"; @@ -111,14 +85,14 @@ int __player_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_FEATURE_NOT_SUPPORTED_ON_DEVICE; - msg = "PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE"; + ret = PLAYER_ERROR_INVALID_OPERATION; + msg = "PLAYER_ERROR_INVALID_OPERATION (NOT SUPPORTED AUDIO EFFECT)"; break; case MM_ERROR_PLAYER_NO_FREE_SPACE: ret = PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE; @@ -199,181 +173,18 @@ int __player_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: @@ -389,12 +200,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; @@ -412,7 +223,7 @@ static player_state_e __convert_player_state(MMPlayerStateType state) return state +1; } -bool __player_state_validate(player_s * handle, player_state_e threshold) +static bool __player_state_validate(player_s * handle, player_state_e threshold) { if (handle->state < threshold) return FALSE; @@ -440,71 +251,29 @@ 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; - LOGW("[%s] Got message type : 0x%x" ,__FUNCTION__, message); + LOGE("[%s] Start : Got message type : 0x%x" ,__FUNCTION__, message); player_error_e err_code = PLAYER_ERROR_NONE; switch(message) { case MM_MESSAGE_ERROR: //0x01 - err_code = __player_convert_error_code(msg->code,(char*)__FUNCTION__); + err_code = __convert_error_code(msg->code,(char*)__FUNCTION__); break; case MM_MESSAGE_STATE_CHANGED: //0x03 - LOGI("STATE CHANGED INTERNALLY - from : %d, to : %d (CAPI State : %d)", msg->state.previous, msg->state.current, handle->state); + LOGE("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 { - LOGI("[%s] Prepared! [current state : %d]", __FUNCTION__, handle->state); - __ADD_ECORE_JOB(handle, __JOB_KEY_PREPARED, __job_prepared_cb); + 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; } } break; @@ -515,12 +284,13 @@ static int __msg_callback(int message, void *param, void *user_data) } break; case MM_MESSAGE_BEGIN_OF_STREAM: //0x104 - LOGI("[%s] Ready to streaming information (BOS) [current state : %d]", __FUNCTION__, handle->state); + MMTA_ACUM_ITEM_END("[CAPI] player_start ~ BOS", 0); + LOGE("[%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] ) { - __ADD_ECORE_JOB(handle, __JOB_KEY_EOS, __job_eos_cb); + ((player_completed_cb)handle->user_cb[_PLAYER_EVENT_TYPE_COMPLETE])(handle->user_data[_PLAYER_EVENT_TYPE_COMPLETE]); } break; case MM_MESSAGE_BUFFERING: //0x103 @@ -541,7 +311,7 @@ static int __msg_callback(int message, void *param, void *user_data) } break; case MM_MESSAGE_CONNECTION_TIMEOUT: //0x102 - LOGI("[%s] PLAYER_ERROR_CONNECTION_FAILED (0x%08x) : CONNECTION_TIMEOUT" ,__FUNCTION__, PLAYER_ERROR_CONNECTION_FAILED); + LOGE("[%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 @@ -551,7 +321,7 @@ static int __msg_callback(int message, void *param, void *user_data) } break; case MM_MESSAGE_VIDEO_NOT_CAPTURED: //0x113 - LOGI("[%s] PLAYER_ERROR_VIDEO_CAPTURE_FAILED (0x%08x)",__FUNCTION__, PLAYER_ERROR_VIDEO_CAPTURE_FAILED); + LOGE("[%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]); @@ -571,30 +341,6 @@ 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) @@ -608,22 +354,32 @@ static int __msg_callback(int message, void *param, void *user_data) } break; case MM_MESSAGE_FILE_NOT_SUPPORTED: //0x10f - LOGI("[%s] PLAYER_ERROR_NOT_SUPPORTED_FILE (0x%08x) : FILE_NOT_SUPPORTED" ,__FUNCTION__, PLAYER_ERROR_NOT_SUPPORTED_FILE); + LOGE("[%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 - LOGI("[%s] PLAYER_ERROR_NOT_SUPPORTED_FILE (0x%08x) : FILE_NOT_FOUND" ,__FUNCTION__, PLAYER_ERROR_NOT_SUPPORTED_FILE); + LOGE("[%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) - mm_player_set_attribute(handle->mm_handle, NULL,"display_visible" , 1, (char*)NULL); + { + 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); + } + + } } if( handle->user_cb[_PLAYER_EVENT_TYPE_SEEK]) { - __ADD_ECORE_JOB(handle, __JOB_KEY_SEEK_DONE, __job_seek_done_cb); + ((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; } break; case MM_MESSAGE_UNKNOWN: //0x00 @@ -643,143 +399,47 @@ static int __msg_callback(int message, void *param, void *user_data) if(err_code != PLAYER_ERROR_NONE && handle->user_cb[_PLAYER_EVENT_TYPE_ERROR]) { - handle->error_code = err_code; - __ADD_ECORE_JOB(handle, __JOB_KEY_ERROR, __job_error_cb); + ((player_error_cb)handle->user_cb[_PLAYER_EVENT_TYPE_ERROR])(err_code,handle->user_data[_PLAYER_EVENT_TYPE_ERROR]); } - LOGW("[%s] End", __FUNCTION__); + LOGE("[%s] End", __FUNCTION__); return 1; } -#if 0 // //is blocked temporary to avoid build error until libmm-player is updated -static bool __video_stream_callback(void *stream, void *user_data) + +static bool __video_stream_callback(void *stream, int stream_size, void *user_data, int width, int height) { player_s * handle = (player_s*)user_data; - 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++; - } - } - - /* 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; - } - - 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( 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; +} - if (bo_num == 0) - tbm_surface_unmap(tsurf); - } - } +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; +} +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]); + } return TRUE; } -#endif static int __pd_message_callback(int message, void *param, void *user_data) { @@ -803,36 +463,64 @@ static int __pd_message_callback(int message, void *param, void *user_data) } return 0; } -static void __job_key_to_remove(gpointer key) + +static bool __supported_audio_effect_type (int filter, int type, void *user_data) { - LOGI("%s",key); - g_free(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; } -static void __job_value_to_destroy(gpointer value) +static bool __supported_audio_effect_preset (int filter, int type, void *user_data) { - Ecore_Job *job = (Ecore_Job *)value; - LOGI("%p", job); - __DELETE_ECORE_ITEM(job); + 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; } + /* * 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) + if (handle != NULL) + { + LOGE("[%s] Start, %p", __FUNCTION__, handle); 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); @@ -848,38 +536,26 @@ 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; - 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); + LOGE("[%s] End, new handle : %p", __FUNCTION__, *player); return PLAYER_ERROR_NONE; } } int player_destroy (player_h player) { - LOGI("[%s] Start, handle to destroy : %p", __FUNCTION__, player); + LOGE("[%s] Start, handle to destroy : %p", __FUNCTION__, player); PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; - if (handle->is_doing_jobs) - { - 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); + MMTA_ACUM_ITEM_SHOW_RESULT_TO(MMTA_SHOW_FILE); + MMTA_RELEASE(); - if (handle->pkt_fmt) { - media_format_unref(handle->pkt_fmt); - handle->pkt_fmt = NULL; + if (handle->prepare_async_thread) + { + pthread_join(handle->prepare_async_thread, NULL); + handle->prepare_async_thread = 0; } - LOGI("[%s] Done mm_player_destroy", __FUNCTION__); - - if (ret != MM_ERROR_NONE) + if (mm_player_destroy(handle->mm_handle)!= MM_ERROR_NONE) { LOGE("[%s] PLAYER_ERROR_INVALID_OPERATION(0x%08x)" ,__FUNCTION__,PLAYER_ERROR_INVALID_OPERATION); return PLAYER_ERROR_INVALID_OPERATION; @@ -889,7 +565,7 @@ int player_destroy (player_h player) handle->state = PLAYER_STATE_NONE; free(handle); handle= NULL; - LOGI("[%s] End", __FUNCTION__); + LOGE("[%s] End", __FUNCTION__); return PLAYER_ERROR_NONE; } } @@ -899,37 +575,24 @@ __prepare_async_thread_func(void *data) { player_s *handle = data; int ret = MM_ERROR_NONE; - LOGI("[%s]", __FUNCTION__); + LOGE("[%s] Start", __FUNCTION__); ret = mm_player_pause(handle->mm_handle); - if(ret != MM_ERROR_NONE) + if(ret != MM_ERROR_NONE) // MM_MESSAGE_ERROR should be posted through __msg_callback { 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); } - LOGI("[%s], done", __FUNCTION__); + LOGE("[%s] End", __FUNCTION__); return NULL; } int player_prepare_async (player_h player, player_prepared_cb callback, void* user_data) { - LOGI("[%s] Start", __FUNCTION__); + LOGE("[%s] Start", __FUNCTION__); PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; PLAYER_STATE_CHECK(handle,PLAYER_STATE_IDLE); - int ret; - bool visible; - bool 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); @@ -937,11 +600,12 @@ 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) { @@ -958,32 +622,24 @@ int player_prepare_async (player_h player, player_prepared_cb callback, void* us } else { - 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,"display_visible", 0, (char*)NULL); + if(ret != MM_ERROR_NONE) + { + LOGW("[%s] Failed to set display visible (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_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_realize(handle->mm_handle); if(ret != MM_ERROR_NONE) { LOGE("[%s] Failed to realize - 0x%x", __FUNCTION__, ret); - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } if (!handle->is_progressive_download) @@ -998,20 +654,19 @@ int player_prepare_async (player_h player, player_prepared_cb callback, void* us } } - LOGI("[%s] End", __FUNCTION__); + LOGE("[%s] End", __FUNCTION__); return PLAYER_ERROR_NONE; } int player_prepare (player_h player) { - LOGI("[%s] Start", __FUNCTION__); + LOGE("[%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; - bool visible; - bool value; ret = mm_player_set_message_callback(handle->mm_handle, __msg_callback, (void*)handle); if(ret != MM_ERROR_NONE) { @@ -1028,22 +683,7 @@ int player_prepare (player_h player) } else { - 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); - + 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 display_visible '0' (0x%x)" ,__FUNCTION__, ret); @@ -1054,150 +694,70 @@ int player_prepare (player_h player) if(ret != MM_ERROR_NONE) { LOGE("[%s] Failed to realize - 0x%x", __FUNCTION__,ret); - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { handle->state = PLAYER_STATE_READY; - LOGI("[%s] End", __FUNCTION__); + LOGE("[%s] End", __FUNCTION__); return PLAYER_ERROR_NONE; } } int player_unprepare (player_h player) { - LOGI("[%s] Start", __FUNCTION__); + LOGE("[%s] Start", __FUNCTION__); PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; - - if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) + 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; } - __RELEASEIF_PREPARE_THREAD(handle->prepare_async_thread); - int ret = mm_player_unrealize(handle->mm_handle); - if(ret != MM_ERROR_NONE) { - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __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; - LOGI("[%s] End", __FUNCTION__); + LOGE("[%s] End", __FUNCTION__); return PLAYER_ERROR_NONE; } } int player_set_uri (player_h player, const char *uri) { -#if 0//is blocked temporary to avoid build error until libmm-player is updated. - PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(uri); player_s * handle = (player_s *) player; PLAYER_STATE_CHECK(handle,PLAYER_STATE_IDLE); - int ret = mm_player_set_uri(handle->mm_handle, uri); - - if(ret != MM_ERROR_NONE) - { - return __player_convert_error_code(ret,(char*)__FUNCTION__); - } - else -#endif - return PLAYER_ERROR_NONE; -} - -int player_set_next_uri (player_h player, const char *uri) -{ -#if 0 //is blocked temporary to avoid build error until libmm-player is updated. - 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 -#endif - return PLAYER_ERROR_NONE; -} - -int player_get_next_uri (player_h player, char **uri) -{ -#if 0 //is blocked temporary to avoid build error until libmm-player is updated. - - 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); + int uri_length = strlen(uri); + int ret = mm_player_set_attribute(handle->mm_handle, NULL,MM_PLAYER_CONTENT_URI , uri, uri_length, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __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; - } -#endif - return PLAYER_ERROR_NONE; //is blocked temporary to avoid build error until libmm-player is updated. } int player_set_memory_buffer (player_h player, const void *data, int size) @@ -1214,7 +774,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else return PLAYER_ERROR_NONE; @@ -1228,7 +788,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; } @@ -1244,7 +804,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1262,7 +822,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1286,7 +846,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else return PLAYER_ERROR_NONE; @@ -1297,9 +857,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,"sound_latency_mode" , latency_mode, (char*)NULL); + int ret = mm_player_set_attribute(handle->mm_handle, NULL,"audio_latency_mode" , latency_mode, (char*)NULL); if(ret != MM_ERROR_NONE) - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); else return PLAYER_ERROR_NONE; } @@ -1310,26 +870,29 @@ 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,"sound_latency_mode" , latency_mode, (char*)NULL); + int ret = mm_player_get_attribute(handle->mm_handle, NULL,"audio_latency_mode" , latency_mode, (char*)NULL); if(ret != MM_ERROR_NONE) - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); else return PLAYER_ERROR_NONE; } int player_start (player_h player) { - LOGI("[%s] Start", __FUNCTION__); + LOGE("[%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_OVERLAY || handle->display_type == PLAYER_DISPLAY_TYPE_EVAS) + if(handle->display_type == PLAYER_DISPLAY_TYPE_X11 || 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); } } @@ -1342,7 +905,7 @@ int player_start (player_h player) } ret = mm_player_start(handle->mm_handle); - LOGI("[%s] stop -> start() ",__FUNCTION__); + LOGE("[%s] stop -> start() ",__FUNCTION__); } else { @@ -1360,48 +923,43 @@ int player_start (player_h player) if(ret != MM_ERROR_NONE) { - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { handle->is_stopped = FALSE; handle->state = PLAYER_STATE_PLAYING; - LOGI("[%s] End", __FUNCTION__); + LOGE("[%s] End", __FUNCTION__); return PLAYER_ERROR_NONE; } } int player_stop (player_h player) { - LOGI("[%s] Start", __FUNCTION__); + LOGE("[%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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } - else + if(handle->display_type == PLAYER_DISPLAY_TYPE_X11 || handle->display_type == PLAYER_DISPLAY_TYPE_EVAS) { - if (handle->user_cb[_PLAYER_EVENT_TYPE_SEEK]) + ret = mm_player_set_attribute(handle->mm_handle, NULL,"display_visible" , 0, (char*)NULL); + if(ret != MM_ERROR_NONE) { - handle->user_cb[_PLAYER_EVENT_TYPE_SEEK] = NULL; - handle->user_data[_PLAYER_EVENT_TYPE_SEEK] = NULL; + return __convert_error_code(ret,(char*)__FUNCTION__); } - - handle->state = PLAYER_STATE_READY; - handle->is_stopped = TRUE; - LOGI("[%s] End", __FUNCTION__); - return PLAYER_ERROR_NONE; + 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; } else { @@ -1412,7 +970,7 @@ int player_stop (player_h player) int player_pause (player_h player) { - LOGI("[%s] Start", __FUNCTION__); + LOGE("[%s] Start", __FUNCTION__); PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; PLAYER_STATE_CHECK(handle,PLAYER_STATE_PLAYING); @@ -1420,12 +978,12 @@ int player_pause (player_h player) int ret = mm_player_pause(handle->mm_handle); if(ret != MM_ERROR_NONE) { - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { handle->state = PLAYER_STATE_PAUSED; - LOGI("[%s] End", __FUNCTION__); + LOGE("[%s] End", __FUNCTION__); return PLAYER_ERROR_NONE; } } @@ -1434,6 +992,7 @@ 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)) { @@ -1448,22 +1007,20 @@ int player_set_position (player_h player, int millisecond, player_seek_completed } else { - LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_SEEK); + LOGE("[%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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __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) { - handle->user_cb[_PLAYER_EVENT_TYPE_SEEK] = NULL; - handle->user_data[_PLAYER_EVENT_TYPE_SEEK] = NULL; - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1471,7 +1028,7 @@ int player_set_position (player_h player, int millisecond, player_seek_completed } } -int player_set_play_position (player_h player, int millisecond, bool accurate, player_seek_completed_cb callback, void *user_data) +int player_seek (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" ); @@ -1489,7 +1046,7 @@ int player_set_play_position (player_h player, int millisecond, bool accurate, p } else { - LOGI("[%s] Event type : %d, pos : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_SEEK, millisecond); + LOGE("[%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; } @@ -1497,14 +1054,12 @@ int player_set_play_position (player_h player, int millisecond, bool accurate, p int ret = mm_player_set_attribute(handle->mm_handle, NULL, "accurate_seek", accurated, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __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) { - handle->user_cb[_PLAYER_EVENT_TYPE_SEEK] = NULL; - handle->user_data[_PLAYER_EVENT_TYPE_SEEK] = NULL; - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1512,30 +1067,82 @@ int player_set_play_position (player_h player, int millisecond, bool accurate, p } } -int player_get_play_position (player_h player, int *millisecond) +int player_set_position_ratio (player_h player, int percent, player_seek_completed_cb callback, void *user_data) { PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(millisecond); + PLAYER_CHECK_CONDITION(percent>=0 && percent <= 100 ,PLAYER_ERROR_INVALID_PARAMETER ,"PLAYER_ERROR_INVALID_PARAMETER" ); + player_s * handle = (player_s *) player; - if (!__player_state_validate(handle, PLAYER_STATE_READY)) + if(handle->user_cb[_PLAYER_EVENT_TYPE_SEEK]) { - LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state); - return PLAYER_ERROR_INVALID_STATE; + 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; } - int pos; - int ret = mm_player_get_position(handle->mm_handle, MM_PLAYER_POS_FORMAT_TIME , &pos); + 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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { - *millisecond = pos; return PLAYER_ERROR_NONE; } } -int player_set_mute (player_h player, bool muted) +int player_get_position (player_h player, int *millisecond) +{ + PLAYER_INSTANCE_CHECK(player); + PLAYER_NULL_ARG_CHECK(millisecond); + 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_TIME , &pos); + if(ret != MM_ERROR_NONE) + { + return __convert_error_code(ret,(char*)__FUNCTION__); + } + else + { + *millisecond = pos; + return PLAYER_ERROR_NONE; + } +} + +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) { PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; @@ -1543,7 +1150,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1561,7 +1168,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1596,7 +1203,7 @@ int player_set_looping (player_h player, bool looping) if(ret != MM_ERROR_NONE) { - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1618,7 +1225,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1648,12 +1255,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __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; } } @@ -1662,9 +1269,6 @@ 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)) @@ -1673,12 +1277,6 @@ 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) @@ -1694,57 +1292,12 @@ int player_set_display(player_h player, player_display_type_e type, player_displ } } - 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 */ + void* temp; if (handle->display_type == (int)MM_DISPLAY_SURFACE_NULL || type == handle->display_type) // first time or same type { - ret = mm_player_set_attribute(handle->mm_handle, NULL, - "display_surface_type", type, - "display_overlay", set_handle, - sizeof(display), (char*)NULL); - + 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); if (ret != MM_ERROR_NONE) { handle->display_handle = temp; @@ -1752,19 +1305,17 @@ int player_set_display(player_h player, player_display_type_e type, player_displ } else { - 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"); + handle->display_type = type; + LOGE("[%s] video display has been changed- type :%d, addr : 0x%x",__FUNCTION__,handle->display_type, handle->display_handle); } + LOGE("[%s] video display has been updated - type :%d",__FUNCTION__,type); } else //changing surface case { - ret = mm_player_change_videosink(handle->mm_handle, type, set_handle); + 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); if (ret != MM_ERROR_NONE) { handle->display_handle = temp; @@ -1781,32 +1332,62 @@ int player_set_display(player_h player, player_display_type_e type, player_displ else { handle->display_type = type; - LOGI("[%s] video display has been changed- type :%d, addr : 0x%x", - __FUNCTION__,handle->display_type, handle->display_handle); + LOGE("[%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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else return PLAYER_ERROR_NONE; @@ -1820,7 +1401,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1830,7 +1411,7 @@ int player_get_display_mode(player_h player, player_display_mode_e *mode) int player_set_playback_rate(player_h player, float rate) { - LOGI("[%s] rate : %0.1f", __FUNCTION__, rate); + LOGE("[%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; @@ -1855,13 +1436,13 @@ int player_set_playback_rate(player_h player, float rate) ret = PLAYER_ERROR_INVALID_OPERATION; break; default: - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } return ret; } -int player_set_display_rotation(player_h player, player_display_rotation_e rotation) +int player_set_x11_display_rotation(player_h player, player_display_rotation_e rotation) { PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; @@ -1869,13 +1450,13 @@ int player_set_display_rotation(player_h player, player_display_rotation_e rotat int ret = mm_player_set_attribute(handle->mm_handle, NULL,MM_PLAYER_VIDEO_ROTATION , rotation, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else return PLAYER_ERROR_NONE; } -int player_get_display_rotation( player_h player, player_display_rotation_e *rotation) +int player_get_x11_display_rotation( player_h player, player_display_rotation_e *rotation) { PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(rotation); @@ -1883,7 +1464,7 @@ int player_get_display_rotation( player_h player, player_display_rotation_e *rot int ret = mm_player_get_attribute(handle->mm_handle, NULL,MM_PLAYER_VIDEO_ROTATION ,rotation, (char*)NULL); if(ret != MM_ERROR_NONE) { - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1891,7 +1472,7 @@ int player_get_display_rotation( player_h player, player_display_rotation_e *rot } } -int player_set_display_visible(player_h player, bool visible) +int player_set_x11_display_visible(player_h player, bool visible) { PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; @@ -1905,7 +1486,7 @@ int player_set_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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1914,7 +1495,7 @@ int player_set_display_visible(player_h player, bool visible) } } -int player_is_display_visible(player_h player, bool* visible) +int player_is_x11_display_visible(player_h player, bool* visible) { PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(visible); @@ -1923,7 +1504,7 @@ int player_is_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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -1940,6 +1521,202 @@ int player_is_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); @@ -1982,7 +1759,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -2021,7 +1798,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -2056,7 +1833,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } return PLAYER_ERROR_NONE; } @@ -2075,7 +1852,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } return PLAYER_ERROR_NONE; } @@ -2096,13 +1873,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { *width = w; *height = h; - LOGI("[%s] width : %d, height : %d",__FUNCTION__,w, h); + LOGE("[%s] width : %d, height : %d",__FUNCTION__,w, h); return PLAYER_ERROR_NONE; } } @@ -2121,11 +1898,155 @@ 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 __player_convert_error_code(ret,(char*)__FUNCTION__); + 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__); } +} + +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); @@ -2133,7 +2054,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); else return PLAYER_ERROR_NONE; } @@ -2146,12 +2067,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + 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:__player_convert_error_code(ret,(char*)__FUNCTION__); + return (ret==MM_ERROR_NONE)?PLAYER_ERROR_NONE:__convert_error_code(ret,(char*)__FUNCTION__); } } @@ -2162,12 +2083,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + 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:__player_convert_error_code(ret,(char*)__FUNCTION__); + return (ret==MM_ERROR_NONE)?PLAYER_ERROR_NONE:__convert_error_code(ret,(char*)__FUNCTION__); } } @@ -2178,7 +2099,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); else return PLAYER_ERROR_NONE; } @@ -2191,7 +2112,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); else return PLAYER_ERROR_NONE; } @@ -2203,7 +2124,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); else return PLAYER_ERROR_NONE; } @@ -2215,7 +2136,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); else return PLAYER_ERROR_NONE; } @@ -2227,12 +2148,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + 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:__player_convert_error_code(ret,(char*)__FUNCTION__); + return (ret==MM_ERROR_NONE)?PLAYER_ERROR_NONE:__convert_error_code(ret,(char*)__FUNCTION__); } } @@ -2251,29 +2172,24 @@ int player_audio_effect_equalizer_is_available(player_h player, bool *available) int player_set_subtitle_path(player_h player,const char* path) { -#if 0 //is blocked temporary to avoid build error until libmm-player is updated. PLAYER_INSTANCE_CHECK(player); + PLAYER_NULL_ARG_CHECK(path); player_s * handle = (player_s *) player; + PLAYER_STATE_CHECK(handle,PLAYER_STATE_IDLE); - 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); + int ret = mm_player_set_attribute(handle->mm_handle, NULL,"subtitle_uri" , path, strlen(path), (char*)NULL); if(ret != MM_ERROR_NONE) { - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else -#endif return PLAYER_ERROR_NONE; } -int player_set_subtitle_position_offset(player_h player, int millisecond) +int player_set_subtitle_position(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)) { @@ -2284,7 +2200,7 @@ int player_set_subtitle_position_offset(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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else return PLAYER_ERROR_NONE; @@ -2297,10 +2213,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -2326,7 +2242,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -2349,12 +2265,12 @@ int player_capture_video(player_h player, player_video_captured_cb callback, voi } else { - LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_CAPTURE); + LOGE("[%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_READY) + if(handle->state == PLAYER_STATE_PAUSED || handle->state == PLAYER_STATE_PLAYING ) { int ret = mm_player_do_video_capture(handle->mm_handle); if(ret==MM_ERROR_PLAYER_NO_OP) @@ -2368,7 +2284,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else return PLAYER_ERROR_NONE; @@ -2393,7 +2309,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else return PLAYER_ERROR_NONE; @@ -2410,7 +2326,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else return PLAYER_ERROR_NONE; @@ -2432,7 +2348,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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); } else { @@ -2492,97 +2408,121 @@ int player_unset_subtitle_updated_cb (player_h player) return __unset_callback(_PLAYER_EVENT_TYPE_SUBTITLE,player); } -int player_set_progressive_download_message_cb(player_h player, player_pd_message_cb callback, void *user_data) +int player_set_video_frame_decoded_cb(player_h player, player_video_frame_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); + int ret = mm_player_set_video_stream_callback(handle->mm_handle, __video_stream_callback, (void*)handle); if(ret != MM_ERROR_NONE) - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); - 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); + 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); return PLAYER_ERROR_NONE; } -int player_unset_progressive_download_message_cb(player_h player) +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_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); + 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 __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); else return PLAYER_ERROR_NONE; } -int player_ignore_session(player_h player) +int player_set_audio_frame_decoded_cb(player_h player, int start, int end, player_audio_frame_decoded_cb callback, void *user_data) +{ + 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__); + + ret = mm_player_set_audio_stream_callback(handle->mm_handle, __audio_stream_callback, (void*)handle); + 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; +} + +int player_unset_audio_frame_decoded_cb(player_h player) { -#if 0 //is blocked temporary to avoid build error until libmm-player is updated. PLAYER_INSTANCE_CHECK(player); player_s * handle = (player_s *) player; - PLAYER_STATE_CHECK(handle,PLAYER_STATE_IDLE); - int ret = mm_player_ignore_session(handle->mm_handle); + 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); if(ret != MM_ERROR_NONE) - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); else -#endif return PLAYER_ERROR_NONE; } -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_progressive_download_message_cb(player_h player, player_pd_message_cb callback, void *user_data) { -#if 0 //is blocked temporary to avoid build error until libmm-player is updated. 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; } - 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); + int ret = mm_player_set_pd_message_callback(handle->mm_handle, __pd_message_callback, (void*)handle); if(ret != MM_ERROR_NONE) - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __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); -#endif + 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_media_packet_video_frame_decoded_cb(player_h player) +int player_unset_progressive_download_message_cb(player_h player) { -#if 0 //is blocked temporary to avoid build error until libmm-player is updated. 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); - int ret = mm_player_set_video_stream_callback(handle->mm_handle, NULL, NULL); + 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); if(ret != MM_ERROR_NONE) - return __player_convert_error_code(ret,(char*)__FUNCTION__); + return __convert_error_code(ret,(char*)__FUNCTION__); else -#endif return PLAYER_ERROR_NONE; } diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 461b088..1df3198 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,14 +4,30 @@ SET(fw_test "${fw_name}-test") INCLUDE_DIRECTORIES(../include) link_directories(${CMAKE_SOURCE_DIR}/../) +IF(X11_SUPPORT) + SET(WIN_PKG "ecore-x") +ENDIF(X11_SUPPORT) +IF(WAYLAND_SUPPORT) + SET(WIN_PKG "${WIN_PKG} ecore-wayland") +ENDIF(WAYLAND_SUPPORT) INCLUDE(FindPkgConfig) -pkg_check_modules(${fw_test} REQUIRED mm-player appcore-efl elementary ecore evas ecore-x capi-media-sound-manager) +pkg_check_modules(${fw_test} REQUIRED mm-player appcore-efl elementary ecore evas capi-media-sound-manager ${WIN_PKG}) + + FOREACH(flag ${${fw_test}_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") +IF(WAYLAND_SUPPORT) + ADD_DEFINITIONS("-DHAVE_WAYLAND") +ENDIF(WAYLAND_SUPPORT) + +IF(X11_SUPPORT) + ADD_DEFINITIONS("-DHAVE_X11") +ENDIF(X11_SUPPORT) + aux_source_directory(. sources) FOREACH(src ${sources}) GET_FILENAME_COMPONENT(src_name ${src} NAME_WE) diff --git a/test/player_media_packet_test.c b/test/player_media_packet_test.c deleted file mode 100644 index f4bb7d5..0000000 --- a/test/player_media_packet_test.c +++ /dev/null @@ -1,449 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include -#include -#include -#include - -#define KEY_END "XF86Stop" -#define MEDIA_FILE_PATH "/opt/usr/media/Color.mp4" -#ifdef PACKAGE -#undef PACKAGE -#endif -#define PACKAGE "player_test" - -#ifdef LOG_TAG -#undef LOG_TAG -#endif -#define LOG_TAG "PLAYER_TEST" - -static int app_create(void *data); -static int app_reset(bundle *b, void *data); -static int app_resume(void *data); -static int app_pause(void *data); -static int app_terminate(void *data); - -struct appcore_ops ops = { - .create = app_create, - .terminate = app_terminate, - .pause = app_pause, - .resume = app_resume, - .reset = app_reset, -}; - -typedef struct appdata { - Evas_Object *win; - Evas_Object *img; - media_packet_h packet; - Ecore_Pipe *pipe; - player_h player_handle; - GList *packet_list; - GMutex buffer_lock; - int w, h; -} appdata_s; -#if 0 //is blocked temporary to avoid build error until dependency package is updated. -static void -win_delete_request_cb(void *data , Evas_Object *obj , void *event_info) -{ - elm_exit(); -} - -static Eina_Bool -keydown_cb(void *data , int type , void *event) -{ - //appdata_s *ad = data; - Ecore_Event_Key *ev = event; - - LOGD("start"); - - if (!strcmp(ev->keyname, KEY_END)) { - /* Let window go to hide state. */ - //elm_win_lower(ad->win); - LOGD("elm exit"); - elm_exit(); - - return ECORE_CALLBACK_DONE; - } - - LOGD("done"); - - return ECORE_CALLBACK_PASS_ON; -} - -static void -create_base_gui(appdata_s *ad) -{ - /* Enable GLES Backened */ - elm_config_preferred_engine_set("opengl_x11"); - - /* Window */ - ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE); - elm_win_wm_desktop_layout_support_set(ad->win, EINA_TRUE); - elm_win_autodel_set(ad->win, EINA_TRUE); -#if 0 - if (elm_win_wm_rotation_supported_get(ad->win)) { - int rots[4] = { 0, 90, 180, 270 }; - elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4); - } -#endif - evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, ad); - - Evas *e = evas_object_evas_get(ad->win); - - elm_win_screen_size_get(ad->win, NULL, NULL, &ad->w, &ad->h); - LOGD("surface size (%d x %d)\n", ad->w, ad->h); - - /* Image Object */ - ad->img = evas_object_image_filled_add(e); - evas_object_image_size_set(ad->img, ad->w, ad->h); - evas_object_size_hint_weight_set(ad->img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(ad->img); - - elm_win_resize_object_add(ad->win, ad->img); - - /* Show window after base gui is set up */ - evas_object_show(ad->win); -} - -static void -_media_packet_video_decoded_cb(media_packet_h packet, void *user_data) -{ - /* This callback function would be called on different thread */ - appdata_s *ad = user_data; - - if (ad == NULL) { - LOGE("appdata is NULL"); - return; - } - - g_mutex_lock(&ad->buffer_lock); - - if (ad->pipe == NULL) { - media_packet_destroy(packet); - LOGW("release media packet immediately"); - return; - } - - /* add packet list */ - ad->packet_list = g_list_prepend(ad->packet_list, (gpointer)packet); - - LOGD("packet %p", packet); - - /* Send packet to main thread */ - ecore_pipe_write(ad->pipe, &packet, sizeof(media_packet_h)); - - g_mutex_unlock(&ad->buffer_lock); - - return; -} -static void -pipe_cb(void *data, void *buf, unsigned int len) -{ - - /* Now, we get a player surface to be set here. */ - appdata_s *ad = data; - tbm_surface_h surface; - Evas_Native_Surface surf; - int ret; - GList *last_item = NULL; - - LOGD("start"); - - g_mutex_lock(&ad->buffer_lock); - - /* Destroy previous packet */ - if (ad->packet) { - ret = media_packet_destroy(ad->packet); - if (ret != MEDIA_PACKET_ERROR_NONE) { - LOGE("Failed to destroy media packet. ret (%d)", ret); - } - ad->packet = NULL; - } - - /* remove packet from list */ - last_item = g_list_last(ad->packet_list); - if (last_item) { - /* Get new packet */ - ad->packet = (media_packet_h)last_item->data;; - ad->packet_list = g_list_remove(ad->packet_list, ad->packet); - LOGD("ad->packet %p", ad->packet); - } - - if (ad->packet == NULL) { - LOGW("NULL packet"); - g_mutex_unlock(&ad->buffer_lock); - return; - } - - ret = media_packet_get_tbm_surface(ad->packet, &surface); - if (ret != MEDIA_PACKET_ERROR_NONE) { - LOGE("Failed to get surface from media packet. ret(0x%x)", ret); - - media_packet_destroy(ad->packet); - ad->packet = NULL; - - g_mutex_unlock(&ad->buffer_lock); - - return; - } - - LOGD("surface %p", surface); - - g_mutex_unlock(&ad->buffer_lock); - - /* Set tbm surface to image native surface */ - memset(&surf, 0x0, sizeof(surf)); - surf.version = EVAS_NATIVE_SURFACE_VERSION; - surf.type = EVAS_NATIVE_SURFACE_TBM; - surf.data.tizen.buffer = surface; - surf.data.tizen.rot = 270; - evas_object_image_native_surface_set(ad->img, &surf); - - /* Set dirty image region to be redrawn */ - evas_object_image_data_update_add(ad->img, 0, 0, ad->w, ad->h); - - LOGD("done"); - - return; -} -#endif -static int app_create(void *data) -{ -#if 0 //is blocked temporary to avoid build error until dependency package is updated. - /* Hook to take necessary actions before main event loop starts - Initialize UI resources and application's data - If this function returns true, the main loop of application starts - If this function returns false, the application is terminated */ - appdata_s *ad = data; - - LOGD("start"); - - create_base_gui(ad); - ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, keydown_cb, NULL); - - g_mutex_init(&ad->buffer_lock); - - LOGD("done"); -#endif - return 0; -} - -static int app_pause(void *data) -{ -#if 0 //is blocked temporary to avoid build error until dependency package is updated. - - /* Take necessary actions when application becomes invisible. */ - appdata_s *ad = (appdata_s *)data; - GList *list = NULL; - media_packet_h packet = NULL; - int ret = PLAYER_ERROR_NONE; - - LOGD("start"); - - if (ad == NULL) { - LOGE("appdata is NULL"); - return -1; - } - - if (ad->player_handle == NULL) { - printf("player_handle is NULL"); - return -1; - } - - /* stop render last set frame */ - evas_object_image_native_surface_set(ad->img, NULL); - - g_mutex_lock(&ad->buffer_lock); - - /* remove ecore pipe */ - ecore_pipe_del(ad->pipe); - ad->pipe = NULL; - - /* remove packet list */ - list = ad->packet_list; - while (list) { - packet = list->data; - list = g_list_next(list); - - if (!packet) { - LOGW("packet is NULL"); - } else { - LOGD("destroy packet %p", packet); - media_packet_destroy(packet); - packet = NULL; - ad->packet_list = g_list_remove(ad->packet_list, packet); - } - } - - if (ad->packet_list) { - g_list_free(ad->packet_list); - ad->packet_list = NULL; - } - - /* Destroy previous packet */ - if (ad->packet) { - LOGD("destroy packet %p", ad->packet); - ret = media_packet_destroy(ad->packet); - if (ret != MEDIA_PACKET_ERROR_NONE) { - LOGE("Failed to destroy media packet. ret (%d)", ret); - } - ad->packet = NULL; - } - - g_mutex_unlock(&ad->buffer_lock); - - ret = player_unprepare(ad->player_handle); - if (ret != PLAYER_ERROR_NONE) { - printf("player_unprepare failed : 0x%x", ret); - return false; - } - - ret = player_destroy(ad->player_handle); - if (ret != PLAYER_ERROR_NONE) { - printf("player_destroy failed : 0x%x", ret); - return false; - } - - ad->player_handle = NULL; - - LOGD("done"); -#endif - - return 0; -} - -static int app_resume(void *data) -{ - LOGD("start"); - - LOGD("done"); - - return 0; -} - -static int app_reset(bundle *b, void *data) -{ -#if 0 //is blocked temporary to avoid build error until dependency package is updated. - - /* Take necessary actions when application becomes visible. */ - appdata_s *ad = (appdata_s *)data; - int ret = PLAYER_ERROR_NONE; - - LOGD("start"); - - if (ad == NULL) { - LOGE("appdata is NULL"); - return -1; - } - - /* create ecore pipe */ - ad->pipe = ecore_pipe_add(pipe_cb, ad); - - ret = player_create(&ad->player_handle); - if (ret != PLAYER_ERROR_NONE) { - LOGE("player_create failed : 0x%x", ret); - return -1; - } - - ret = player_set_media_packet_video_frame_decoded_cb(ad->player_handle, _media_packet_video_decoded_cb, ad); - if (ret != PLAYER_ERROR_NONE) { - LOGE("player_set_media_packet_video_frame_decoded_cb failed : 0x%x", ret); - goto FAILED; - } - - ret = player_set_display(ad->player_handle, PLAYER_DISPLAY_TYPE_NONE, NULL); - if (ret != PLAYER_ERROR_NONE) { - LOGE("player_set_display failed : 0x%x", ret); - goto FAILED; - } - - ret = player_set_uri(ad->player_handle, MEDIA_FILE_PATH); - if (ret != PLAYER_ERROR_NONE) { - LOGE("player_set_uri failed : 0x%x", ret); - goto FAILED; - } - - ret = player_prepare(ad->player_handle); - if (ret != PLAYER_ERROR_NONE) { - LOGE("player prepare failed : 0x%x", ret); - goto FAILED; - } - - ret = player_start(ad->player_handle); - if (ret != PLAYER_ERROR_NONE) { - LOGE("player start failed : 0x%x", ret); - goto FAILED; - } - - LOGD("done"); - - return 0; - -FAILED: - if (ad->player_handle) { - player_destroy(ad->player_handle); - ad->player_handle = NULL; - } - - return -1; -#endif - return 0; //temp return value -} - -static int app_terminate(void *data) -{ - /* Release all resources. */ - appdata_s *ad = (appdata_s *)data; - - LOGD("start"); - - if (ad == NULL) { - LOGE("appdata is NULL"); - return -1; - } - - app_pause(data); - - g_mutex_clear(&ad->buffer_lock); - - LOGD("done"); - - return 0; -} - -int main(int argc, char *argv[]) -{ - int ret = 0; - static appdata_s ad = {0,}; - - LOGD("start"); - - memset(&ad, 0x0, sizeof(appdata_s)); - - LOGD("call appcore_efl_main"); - - ops.data = &ad; - - ret = appcore_efl_main(PACKAGE, &argc, &argv, &ops); - - LOGD("appcore_efl_main() ret = 0x%x", ret); - - return ret; -} - diff --git a/test/player_test.c b/test/player_test.c index 6ea5792..176c567 100644 --- a/test/player_test.c +++ b/test/player_test.c @@ -13,89 +13,62 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #include #include #include #include #include #include + +#ifdef HAVE_X11 #include -//#define _USE_X_DIRECT_ -#ifdef _USE_X_DIRECT_ -#include #endif +#ifdef HAVE_WAYLAND +#include +#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 - 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_POSITION_TIME, + CURRENT_STATUS_REAL_POSITION_TIME, + CURRENT_STATUS_KEY_FRAME_POSITION_TIME, + CURRENT_STATUS_POSITION_PERCENT, CURRENT_STATUS_LOOPING, - CURRENT_STATUS_DISPLAY_SURFACE_CHANGE, CURRENT_STATUS_DISPLAY_MODE, CURRENT_STATUS_DISPLAY_ROTATION, CURRENT_STATUS_DISPLAY_VISIBLE, - CURRENT_STATUS_DISPLAY_ROI_MODE, - CURRENT_STATUS_DISPLAY_DST_ROI, - CURRENT_STATUS_DISPLAY_SRC_CROP, - CURRENT_STATUS_SUBTITLE_FILENAME, + CURRENT_STATUS_DISPLAY_ROI, + CURRENT_STATUS_SUBTITLE_FILENAME }; -#define MAX_HANDLE 20 - -/* for video display */ -#ifdef _USE_X_DIRECT_ -Window g_xid; -Display *g_dpy; -GC g_gc; -#else -Evas_Object* g_xid; -#endif -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 *bg; - Evas_Object *rect; Evas_Object *layout_main; /* layout widget based on EDJ */ + #ifdef HAVE_X11 Ecore_X_Window xid; + #elif HAVE_WAYLAND + unsigned int xid; + #endif /* 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(); @@ -103,7 +76,8 @@ static void win_del(void *data, Evas_Object *obj, void *event) static Evas_Object* create_win(const char *name) { - Evas_Object *eo = NULL; + Evas_Object *eo; + int w, h; printf ("[%s][%d] name=%s\n", __func__, __LINE__, name); @@ -112,115 +86,58 @@ 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); - elm_win_autodel_set(eo, EINA_TRUE); + #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); } - 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; + return eo; } static int app_create(void *data) { - 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 = g_eo_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; + 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; } static int app_terminate(void *data) { - struct appdata *ad = data; - int i = 0; + struct appdata *ad = data; - 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; -#ifdef _USE_X_DIRECT_ - if(g_dpy) - { - if(g_gc) - XFreeGC (g_dpy, g_gc); - if(g_xid) - XDestroyWindow (g_dpy, g_xid); - XCloseDisplay (g_dpy); - g_xid = 0; - g_dpy = NULL; - } -#endif - return 0; + if (ad->win) + evas_object_del(ad->win); + + 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[MAX_HANDLE] = {0}; -int g_handle_num = 1; +static player_h g_player = 0; int g_menu_state = CURRENT_STATUS_MAINMENU; char g_file_list[9][256]; gboolean quit_pushing; @@ -250,29 +167,19 @@ static void completed_cb(void *user_data) g_print("[Player_Test] completed_cb!!!!\n"); } -static void error_cb(int code, void *user_data) -{ - g_print("[Player_Test] error_cb!!!! code : %d\n", code); -} - -static void interrupted_cb(player_interrupted_code_e code, void *user_data) +static void audio_frame_decoded_cb(unsigned char *data, unsigned int size, void *user_data) { - g_print("[Player_Test] interrupted_cb!!!! code : %d\n", code); + 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); } -#if 0 -static void audio_frame_decoded_cb(unsigned char *data, unsigned int size, void *user_data) +void video_frame_decoded_cb(unsigned char *data, int width, int height, unsigned int size, void *user_data) { int pos=0; - - 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); + 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); } -#endif static void subtitle_updated_cb(unsigned long duration, char *text, void *user_data) { @@ -284,87 +191,22 @@ 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; - } - } - -#ifdef _USE_X_DIRECT_ - /* delete x window, if it is */ - if(g_dpy) - { - if(g_gc) - XFreeGC (g_dpy, g_gc); - if(g_xid) - XDestroyWindow (g_dpy, g_xid); - XCloseDisplay (g_dpy); - g_xid = 0; - g_dpy = NULL; - } -#endif -} - static void input_filename(char *filename) { int len = strlen(filename); - int i = 0; if ( len < 0 || len > MAX_STRING_LEN ) return; - - for (i = 0; i < g_handle_num; i++) + if(g_player!=NULL) { - if(g_player[i]!=NULL) - { - player_unprepare(g_player[i]); - player_destroy(g_player[i]); - } - g_player[i] = 0; + player_unprepare(g_player); + player_destroy(g_player); + } + g_player = 0; - if ( player_create(&g_player[i]) != PLAYER_ERROR_NONE ) - { - g_print("player create is failed\n"); - } + if ( player_create(&g_player) != PLAYER_ERROR_NONE ) + { + g_print("player create is failed\n"); } strncpy (g_uri, filename,len); @@ -386,42 +228,21 @@ 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[0], + mm_player_set_attribute(g_player, &g_err_name, "profile_uri", uri, strlen(uri), "profile_user_param", g_media_mem, file_size NULL); #else - //player_set_uri(g_player[0], filename); + //player_set_uri(g_player, filename); #endif /* APPSRC_TEST */ int ret; player_state_e 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); - } + ret = player_get_state(g_player, &state); + g_print("1. After player_create() - Current State : %d \n", state); } -#if 0 -// use this API instead of player_set_uri -static void player_set_memory_buffer_test() -{ - if(!g_uri) - g_print("g_uri is NULL\n"); - 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); -} -#endif static void _player_prepare(bool async) { int ret = FALSE; @@ -430,270 +251,90 @@ 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[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]); - player_set_uri(g_player[0], g_uri); - //player_set_memory_buffer_test(); - } - 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]); - player_set_uri(g_player[i], g_uri); - //player_set_memory_buffer_test(); - } + player_set_subtitle_path(g_player,g_subtitle_uri); + player_set_subtitle_updated_cb(g_player, subtitle_updated_cb, (void*)g_player); } + #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 + - if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) + 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 ( async ) - { - ret = player_prepare_async(g_player[0], prepared_cb, (void*) g_player[0]); - } - else - ret = player_prepare(g_player[0]); + ret = player_prepare_async(g_player, prepared_cb, (void*) g_player); } else - { - 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]); - } - } + ret = player_prepare(g_player); if ( ret != PLAYER_ERROR_NONE ) { g_print("prepare is failed (errno = %d) \n", ret); } player_state_e 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); - } - } - + ret = player_get_state(g_player, &state); + g_print("After player_prepare() - Current State : %d \n", state); } static void _player_unprepare() { int ret = FALSE; - int i = 0; - if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) - { - 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 + ret = player_unprepare(g_player); + if ( ret != PLAYER_ERROR_NONE ) { - 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); - } - } + g_print("unprepare is failed (errno = %d) \n", ret); } - reset_display(); memset(g_subtitle_uri, 0 , sizeof(g_subtitle_uri)); player_state_e 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; - } - } - } + ret = player_get_state(g_player, &state); + g_print(" After player_unprepare() - Current State : %d \n", state); } static void _player_play() { int bRet = FALSE; - 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); - } - } + bRet = player_start(g_player); } static void _player_stop() { int bRet = FALSE; - 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); - } - } + bRet = player_stop(g_player); } static void _player_resume() { int bRet = FALSE; - 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); - } - } + bRet = player_start(g_player); } static void _player_pause() { int bRet = FALSE; - 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); - } - } + bRet = player_pause(g_player); } static void _player_state() { player_state_e state; - player_get_state(g_player[0], &state); + player_get_state(g_player, &state); g_print(" ==> [Player_Test] Current Player State : %d\n", state); } static void _player_set_progressive_download() { - 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]); + player_set_progressive_download_path(g_player, "/opt/test.pd"); + player_set_progressive_download_message_cb(g_player, progress_down_cb, (void*)g_player); } static void set_volume(float volume) { - if ( player_set_volume(g_player[0], volume, volume) != PLAYER_ERROR_NONE ) + if ( player_set_volume(g_player, volume, volume) != PLAYER_ERROR_NONE ) { g_print("failed to set volume\n"); } @@ -701,13 +342,13 @@ static void set_volume(float volume) static void get_volume(float* left, float* right) { - player_get_volume(g_player[0], left, right); + player_get_volume(g_player, 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[0], mute) != PLAYER_ERROR_NONE ) + if ( player_set_mute(g_player, mute) != PLAYER_ERROR_NONE ) { g_print("failed to set_mute\n"); } @@ -715,41 +356,44 @@ static void set_mute(bool mute) static void get_mute(bool *mute) { - player_is_muted(g_player[0], mute); + player_is_muted(g_player, 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_play_position(g_player[0], &position); - g_print(" ==> [Player_Test] player_get_play_position()%d return : %d\n", ret, position); + 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); } -static void set_position(int position) +static void set_position(int position, bool flag) { - if ( player_set_play_position(g_player[0], position, TRUE, seek_completed_cb, g_player[0]) != PLAYER_ERROR_NONE ) + if ( player_seek(g_player, position, flag, seek_completed_cb, g_player) != 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[0], &duration); + ret = player_get_duration(g_player, &duration); g_print(" ==> [Player_Test] player_get_duration() return : %d\n",ret); g_print(" ==> [Player_Test] Duration: [%d ] msec\n",duration); } @@ -758,21 +402,20 @@ static void get_stream_info() { int w = 0; int h = 0; - char *value = NULL; - player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_ALBUM, &value); + player_get_content_info(g_player, PLAYER_CONTENT_INFO_ALBUM, &value); g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_ALBUM: [%s ] \n",value); - player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_ARTIST, &value); + player_get_content_info(g_player, PLAYER_CONTENT_INFO_ARTIST, &value); g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_ARTIST: [%s ] \n",value); - player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_AUTHOR, &value); + player_get_content_info(g_player, PLAYER_CONTENT_INFO_AUTHOR, &value); g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_AUTHOR: [%s ] \n",value); - player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_GENRE, &value); + player_get_content_info(g_player, PLAYER_CONTENT_INFO_GENRE, &value); g_print(" ==> [Player_Test] PLAYER_CONTENT_INFO_GENRE: [%s ] \n",value); - player_get_content_info(g_player[0], PLAYER_CONTENT_INFO_TITLE, &value); + player_get_content_info(g_player, 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[0], &album, &size); + player_get_album_art(g_player, &album, &size); g_print(" ==> [Player_Test] Album art : [ data : %p, size : %d ]\n", (unsigned int *)album, size); if(value!=NULL) { @@ -783,16 +426,12 @@ static void get_stream_info() int sample_rate; int channel; int bit_rate; - int fps, v_bit_rate; - player_get_audio_stream_info(g_player[0], &sample_rate, &channel, &bit_rate); + player_get_audio_stream_info(g_player, &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[0], &audio_codec, &video_codec); + player_get_codec_info(g_player, &audio_codec, &video_codec); if(audio_codec!=NULL) { g_print(" ==> [Player_Test] Audio Codec: [%s ] \n",audio_codec); @@ -805,130 +444,27 @@ static void get_stream_info() free(video_codec); video_codec = NULL; } - player_get_video_size(g_player[0], &w, &h); + player_get_video_size(g_player, &w, &h); g_print(" ==> [Player_Test] Width: [%d ] , Height: [%d ] \n",w,h); - } +} static void set_looping(bool looping) { - if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) + if ( player_set_looping(g_player, looping) != PLAYER_ERROR_NONE ) { - 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"); - } - } + g_print("failed to set_looping\n"); } } static void get_looping(bool *looping) { - player_is_looping(g_player[0], looping); + player_is_looping(g_player, 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) - { -#ifdef _USE_X_DIRECT_ - /* Create xwindow for X surface */ - if(!g_dpy) - { - g_dpy = XOpenDisplay (NULL); - g_xid = create_window (g_dpy, 0, 0, 500, 500); - g_gc = XCreateGC (g_dpy, g_xid, 0, 0); - } - g_print("create x window dpy(%p), gc(%x), xid(%d)\n", g_dpy, (unsigned int)g_gc, (int)g_xid); - XImage *xim = make_transparent_image (g_dpy, 500, 500); - XPutImage (g_dpy, g_xid, g_gc, xim, 0, 0, 0, 0, 500, 500); - XSync (g_dpy, False); -#else - g_xid = g_eo_win; -#endif - 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[0], mode) != PLAYER_ERROR_NONE ) + if ( player_set_display_mode(g_player, mode) != PLAYER_ERROR_NONE ) { g_print("failed to player_set_display_mode\n"); } @@ -937,13 +473,13 @@ static void set_display_mode(int mode) static void get_display_mode() { player_display_mode_e mode; - player_get_display_mode(g_player[0], &mode); + player_get_display_mode(g_player, &mode); g_print(" ==> [Player_Test] Display mode: [%d ] \n",mode); } static void set_display_rotation(int rotation) { - if ( player_set_display_rotation(g_player[0], rotation) != PLAYER_ERROR_NONE ) + if ( player_set_x11_display_rotation(g_player, rotation) != PLAYER_ERROR_NONE ) { g_print("failed to set_display_rotation\n"); } @@ -952,14 +488,14 @@ static void set_display_rotation(int rotation) static void get_display_rotation() { player_display_rotation_e rotation = 0; - player_get_display_rotation(g_player[0], &rotation); + player_get_x11_display_rotation(g_player, &rotation); g_print(" ==> [Player_Test] X11 Display rotation: [%d ] \n",rotation); } static void set_display_visible(bool visible) { - if ( player_set_display_visible(g_player[0], visible) != PLAYER_ERROR_NONE ) + if ( player_set_x11_display_visible(g_player, visible) != PLAYER_ERROR_NONE ) { g_print("failed to player_set_x11_display_visible\n"); } @@ -967,91 +503,32 @@ static void set_display_visible(bool visible) static void get_display_visible(bool *visible) { - player_is_display_visible(g_player[0], visible); + player_is_x11_display_visible(g_player, visible); g_print(" ==> [Player_Test] X11 Display Visible = %d\n", *visible); } -static void set_display_dst_roi(int x, int y, int w, int h) +static void set_display_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 ) + if ( player_set_x11_display_roi(g_player, x, y, w, h) != PLAYER_ERROR_NONE ) { - g_print("failed to player_set_x11_display_dst_roi\n"); + g_print("failed to player_set_x11_display_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); + g_print(" ==> [Player_Test] set X11 Display ROI (x:%d, y:%d, w:%d, h:%d)\n", x, y, w, h); } -#endif } -static void get_display_dst_roi() +static void get_display_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 ) + if ( player_get_x11_display_roi(g_player, &x, &y, &w, &h) != PLAYER_ERROR_NONE ) { - g_print("failed to player_get_x11_display_dst_roi\n"); + g_print("failed to player_get_x11_display_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); + g_print(" ==> [Player_Test] got X11 Display 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 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_get_x11_display_roi_mode\n"); - } else { - g_print(" ==> [Player_Test] got X11 Display ROI mode (%d)\n", mode); - } -#endif -} - -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_src_crop(g_player[0], &x, &y, &w, &h) != PLAYER_ERROR_NONE ) - { - g_print("failed to player_get_x11_display_src_crop\n"); - } else { - 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) @@ -1063,12 +540,11 @@ 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[0],video_captured_cb,NULL)!=PLAYER_ERROR_NONE) + if( player_capture_video(g_player,video_captured_cb,NULL)!=PLAYER_ERROR_NONE) { g_print("failed to player_capture_video\n"); } @@ -1076,47 +552,29 @@ static void capture_video() static void decoding_audio() { -#if 0 int ret; - 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]); + ret =player_set_audio_frame_decoded_cb(g_player, 0,0,audio_frame_decoded_cb, (void*)g_player); if ( ret != PLAYER_ERROR_NONE ) { g_print("player_set_audio_frame_decoded_cb is failed (errno = %d) \n", ret); } -#endif } -void quit_program() +static void decoding_video() { - int i = 0; - - if(g_pcm_fd) + int ret; + ret =player_set_video_frame_decoded_cb(g_player, video_frame_decoded_cb, (void*)g_player); + if ( ret != PLAYER_ERROR_NONE ) { - fclose(g_pcm_fd); + g_print("player_set_video_frame_decoded_cb is failed (errno = %d) \n", ret); } +} - 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; - } - } +void quit_program() +{ + player_unprepare(g_player); + player_destroy(g_player); + g_player = 0; elm_exit(); } @@ -1193,7 +651,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) { @@ -1201,13 +659,9 @@ 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 ) { @@ -1216,19 +670,23 @@ void _interpret_main_menu(char *cmd) } else if (strncmp(cmd, "j", 1) == 0 ) { - g_menu_state = CURRENT_STATUS_POSITION_TIME; + g_menu_state = CURRENT_STATUS_REAL_POSITION_TIME; + } + else if (strncmp(cmd, "k", 1) == 0 ) + { + g_menu_state = CURRENT_STATUS_POSITION_PERCENT; } 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 ) { @@ -1236,8 +694,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 ) { @@ -1266,33 +724,17 @@ void _interpret_main_menu(char *cmd) } else if (strncmp(cmd, "x", 1) == 0 ) { - g_menu_state = CURRENT_STATUS_DISPLAY_DST_ROI; + g_menu_state = CURRENT_STATUS_DISPLAY_ROI; } else if (strncmp(cmd, "y", 1) == 0 ) { - 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(); + get_display_roi(); } 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(); } @@ -1300,14 +742,18 @@ void _interpret_main_menu(char *cmd) { decoding_audio(); } + else if (strncmp(cmd, "E", 1) == 0 ) + { + decoding_video(); + } else if (strncmp(cmd, "q", 1) == 0) { - quit_pushing = TRUE; - quit_program(); + quit_pushing = TRUE; + quit_program(); } else { - g_print("unknown menu \n"); + g_print("unknown menu \n"); } } else if(len == 2) @@ -1316,7 +762,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 } @@ -1324,28 +770,20 @@ 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, "ds", 2) == 0 ) - { - g_menu_state = CURRENT_STATUS_DISPLAY_SURFACE_CHANGE; - } - else if (strncmp(cmd, "nb", 2) == 0 ) + else if (strncmp(cmd, "jj", 2) == 0 ) { - g_menu_state = CURRENT_STATUS_HANDLE_NUM; + g_menu_state = CURRENT_STATUS_KEY_FRAME_POSITION_TIME; } - else + else { - g_print("unknown menu \n"); + g_print("unknown menu \n"); } } - else + else { g_print("unknown menu \n"); } @@ -1358,8 +796,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] \t", MMTS_SAMPLELIST_INI_DEFAULT_PATH); - g_print("nb. num. of handles \n"); + g_print("*. Sample List in [%s]\n", MMTS_SAMPLELIST_INI_DEFAULT_PATH); + for( idx = 1; idx <= INI_SAMPLE_LIST_MAX ; idx++ ) { if (strlen (g_file_list[idx-1]) > 0) @@ -1373,29 +811,31 @@ void display_sub_basic() g_print("c. Stop \t"); g_print("d. Resume\t"); g_print("e. Pause \t"); - g_print("un. Unprepare \t"); - g_print("dt. Destroy \n"); - g_print("[State] S. Player State \n"); + g_print("un. Unprepare \n"); + g_print("[State] S. Player State \n"); g_print("[ volume ] f. Set Volume\t"); - g_print("g. Get Volume\t"); - g_print("z. Set Sound type\t"); + g_print("g. Get Volume\n"); g_print("[ mute ] h. Set Mute\t"); g_print("i. Get Mute\n"); - g_print("[position] j. Set Position \t"); + 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("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\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("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("[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("\n"); g_print("=========================================================================================\n"); @@ -1407,10 +847,6 @@ 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"); @@ -1419,30 +855,28 @@ 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_POSITION_TIME) + else if (g_menu_state == CURRENT_STATUS_REAL_POSITION_TIME + || g_menu_state == CURRENT_STATUS_KEY_FRAME_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, 4: ORIGIN_OR_LETTER, 5: ROI) \n"); + g_print("*** input display mode value.(0: LETTER BOX, 1: ORIGIN SIZE, 2: FULL_SCREEN, 3: CROPPED_FULL) \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"); } @@ -1450,23 +884,15 @@ static void displaymenu() { g_print("*** input display visible value.(0: HIDE, 1: SHOW) \n"); } - else if (g_menu_state == CURRENT_STATUS_DISPLAY_ROI_MODE) + else if (g_menu_state == CURRENT_STATUS_DISPLAY_ROI) { - g_print("*** input display roi mode.(0: FULL_SCREEN, 1: LETTER BOX)\n"); + g_print("*** input display roi value sequencially.(x, y, w, h)\n"); } - else if (g_menu_state == CURRENT_STATUS_DISPLAY_DST_ROI) - { - g_print("*** input display roi value sequentially.(x, y, w, h)\n"); - } - 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) + else if (g_menu_state == CURRENT_STATUS_SUBTITLE_FILENAME) { g_print(" *** input subtitle file path.\n"); } - else + else { g_print("*** unknown status.\n"); quit_program(); @@ -1500,20 +926,6 @@ 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); @@ -1527,38 +939,38 @@ static void interpret (char *cmd) reset_menu_state(); } break; - case CURRENT_STATUS_SOUND_TYPE: + case CURRENT_STATUS_MUTE: { - int type = atoi(cmd); - set_sound_type(type); + int mute = atoi(cmd); + set_mute(mute); reset_menu_state(); } break; - case CURRENT_STATUS_MUTE: + case CURRENT_STATUS_REAL_POSITION_TIME: { - int mute = atoi(cmd); - set_mute(mute); + long position = atol(cmd); + set_position(position, 1); reset_menu_state(); } break; - case CURRENT_STATUS_POSITION_TIME: + case CURRENT_STATUS_KEY_FRAME_POSITION_TIME: { long position = atol(cmd); - set_position(position); + set_position(position, 0); reset_menu_state(); } break; - case CURRENT_STATUS_LOOPING: + case CURRENT_STATUS_POSITION_PERCENT: { - int looping = atoi(cmd); - set_looping(looping); + long percent = atol(cmd); + set_position_ratio(percent); reset_menu_state(); } break; - case CURRENT_STATUS_DISPLAY_SURFACE_CHANGE: + case CURRENT_STATUS_LOOPING: { - int type = atoi(cmd); - change_surface(type); + int looping = atoi(cmd); + set_looping(looping); reset_menu_state(); } break; @@ -1569,7 +981,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); @@ -1583,7 +995,7 @@ static void interpret (char *cmd) reset_menu_state(); } break; - case CURRENT_STATUS_DISPLAY_DST_ROI: + case CURRENT_STATUS_DISPLAY_ROI: { int value = atoi(cmd); static int roi_x = 0; @@ -1607,7 +1019,7 @@ static void interpret (char *cmd) case 3: cnt = 0; roi_h = value; - set_display_dst_roi(roi_x, roi_y, roi_w, roi_h); + set_display_roi(roi_x, roi_y, roi_w, roi_h); roi_x = roi_y = roi_w = roi_h = 0; reset_menu_state(); break; @@ -1616,53 +1028,13 @@ static void interpret (char *cmd) } } break; - 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: + case CURRENT_STATUS_SUBTITLE_FILENAME: { input_subtitle_filename(cmd); reset_menu_state(); } break; - } + } g_timeout_add(100, timeout_menu_display, 0); } @@ -1693,3 +1065,4 @@ int main(int argc, char *argv[]) return appcore_efl_main(PACKAGE, &argc, &argv, &ops); } + -- 2.7.4