From 0adab16fa430b693d6f7a65834bec9d75513067f Mon Sep 17 00:00:00 2001 From: Eunhye Choi Date: Thu, 11 Apr 2019 20:51:48 +0900 Subject: [PATCH] [0.2.108] apply pcm extraction option - this is first patch to expose pcm extraction api to public : apply pcm extraction option - renaming about audio/video decoded cb - remove grouping comment Change-Id: I9b80d3d3121aa8de1d5c079f519c7bd26e519120 --- legacy/include/legacy_player.h | 96 +------------------------------------ legacy/src/legacy_player.c | 2 +- legacy/src/legacy_player_internal.c | 6 ++- muse/src/muse_player.c | 5 +- packaging/mmsvc-player.spec | 2 +- 5 files changed, 11 insertions(+), 100 deletions(-) diff --git a/legacy/include/legacy_player.h b/legacy/include/legacy_player.h index 6d726ac..ff30979 100644 --- a/legacy/include/legacy_player.h +++ b/legacy/include/legacy_player.h @@ -36,11 +36,6 @@ extern "C" { */ /** - * @addtogroup CAPI_MEDIA_PLAYER_MODULE - * @{ - */ - -/** * @brief The media player's type handle. * @since_tizen 2.3 */ @@ -145,15 +140,6 @@ typedef void *player_display_h; #endif /** - * @} - */ - -/** - * @addtogroup CAPI_MEDIA_PLAYER_DISPLAY_MODULE - * @{ - */ - -/** * @brief Enumeration for display rotation type. * @since_tizen 2.3 */ @@ -179,15 +165,6 @@ typedef enum { } player_display_mode_e; /** - * @} - */ - -/** - * @addtogroup CAPI_MEDIA_PLAYER_STREAM_INFO_MODULE - * @{ - */ - -/** * @brief Enumeration for media stream content information. * @since_tizen 2.3 */ @@ -201,16 +178,6 @@ typedef enum { } player_content_info_e; /** - * @} - */ - - -/** - * @addtogroup CAPI_MEDIA_PLAYER_SUBTITLE_MODULE - * @{ - */ - -/** * @brief Called when the subtitle is updated. * @since_tizen 2.3 * @param[in] duration The duration of the updated subtitle @@ -222,15 +189,6 @@ typedef enum { typedef void (*player_subtitle_updated_cb)(unsigned long duration, char *text, 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. @@ -315,7 +273,7 @@ typedef void (*player_video_captured_cb)(unsigned char *data, int width, int hei /** * @brief Called to register for notifications about delivering video data when every video frame is decoded. - * @param[in] video_data video stream data + * @param[in] video_data video decoded data * @param[in] user_data The user data passed from the callback registration function */ typedef bool (*legacy_player_media_packet_video_decoded_cb)(void *video_data, void *user_data); @@ -1036,15 +994,6 @@ int legacy_player_set_media_stream_buffer_min_threshold(legacy_player_h player, int legacy_player_get_media_stream_buffer_min_threshold(legacy_player_h player, player_stream_type_e type, unsigned int *percent); /** - * @} - */ - -/** - * @addtogroup CAPI_MEDIA_PLAYER_DISPLAY_MODULE - * @{ - */ - -/** * @brief Sets the video display mode. * @since_tizen 2.3 * @remarks If no display is set, no operation is performed. @@ -1131,16 +1080,6 @@ int legacy_player_set_display_rotation(legacy_player_h player, player_display_ro */ int legacy_player_get_display_rotation(legacy_player_h player, player_display_rotation_e *rotation); -/** - * @} - */ - - -/** - * @addtogroup CAPI_MEDIA_PLAYER_STREAM_INFO_MODULE - * @{ - */ - /** * @brief Gets the media content information. * @since_tizen 2.3 @@ -1277,16 +1216,6 @@ int legacy_player_get_album_art(legacy_player_h player, void **album_art, int *s int legacy_player_get_duration(legacy_player_h player, int64_t *duration); /** - * @} - */ - - -/** - * @addtogroup CAPI_MEDIA_PLAYER_AUDIO_EFFECT_MODULE - * @{ - */ - -/** * @brief Gets the number of equalizer bands. * @since_tizen 2.3 * @param[in] player The handle to the media player @@ -1434,16 +1363,6 @@ int legacy_player_audio_effect_equalizer_clear(legacy_player_h player); int legacy_player_audio_effect_equalizer_is_available(legacy_player_h player, bool *available); /** - * @} - */ - - -/** - * @addtogroup CAPI_MEDIA_PLAYER_MODULE - * @{ - */ - -/** * @brief Captures the video frame, asynchronously. * @since_tizen 2.3 * @param[in] player The handle to the media player @@ -1653,15 +1572,6 @@ int legacy_player_unset_buffering_cb(legacy_player_h player); int legacy_player_set_playback_rate(legacy_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. @@ -2122,10 +2032,6 @@ int legacy_player_pitch_is_enabled(legacy_player_h player, bool *enabled); int legacy_player_pitch_set_value(legacy_player_h player, float pitch); int legacy_player_pitch_get_value(legacy_player_h player, float *pitch); -/** - * @} - */ - #ifdef __cplusplus } #endif diff --git a/legacy/src/legacy_player.c b/legacy/src/legacy_player.c index 39d9803..034ddaf 100644 --- a/legacy/src/legacy_player.c +++ b/legacy/src/legacy_player.c @@ -1963,7 +1963,7 @@ int legacy_player_set_media_packet_video_frame_decoded_cb(legacy_player_h player PLAYER_NULL_ARG_CHECK(callback); PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE); - ret = mm_player_set_video_stream_callback(handle->mm_handle, (mm_player_video_stream_callback)callback, user_data); + ret = mm_player_set_video_decoded_callback(handle->mm_handle, (mm_player_video_decoded_callback)callback, user_data); if (ret != MM_ERROR_NONE) return __player_convert_error_code(ret, (char *)__FUNCTION__); diff --git a/legacy/src/legacy_player_internal.c b/legacy/src/legacy_player_internal.c index 0efe098..83ec9d2 100644 --- a/legacy/src/legacy_player_internal.c +++ b/legacy/src/legacy_player_internal.c @@ -61,10 +61,14 @@ int legacy_player_set_pcm_extraction_mode(legacy_player_h player, bool sync, pla int ret = MM_ERROR_NONE; PLAYER_INSTANCE_CHECK(player); PLAYER_NULL_ARG_CHECK(callback); + mmplayer_audio_extract_opt_e opt = MM_PLAYER_AUDIO_EXTRACT_DEINTERLEAVE; /* sync is true */ PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE); - ret = mm_player_set_audio_stream_callback(handle->mm_handle, sync, __audio_stream_callback, (void *)handle); + if (!sync) + opt = MM_PLAYER_AUDIO_EXTRACT_NO_SYNC_WITH_CLOCK | MM_PLAYER_AUDIO_EXTRACT_DEINTERLEAVE; + + ret = mm_player_set_audio_decoded_callback(handle->mm_handle, opt, __audio_stream_callback, (void *)handle); if (ret != MM_ERROR_NONE) return __player_convert_error_code(ret, (char *)__FUNCTION__); diff --git a/muse/src/muse_player.c b/muse/src/muse_player.c index 9c79aa1..3b0c4c2 100644 --- a/muse/src/muse_player.c +++ b/muse/src/muse_player.c @@ -1188,7 +1188,7 @@ static int _push_media_stream(muse_player_handle_t *muse_player, player_push_med return ret; } -static void _audio_frame_decoded_cb(player_audio_raw_data_s *audio_frame, void *user_data) +static void _audio_decoded_cb(player_audio_raw_data_s *audio_frame, void *user_data) { muse_player_cb_e api = MUSE_PLAYER_CB_EVENT; muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME; @@ -2696,6 +2696,7 @@ int player_disp_set_callback(muse_module_h module) set_callback_func[type] (muse_player->player_handle, module, set); } else { ret = PLAYER_ERROR_INVALID_OPERATION; + PLAYER_RETURN_MSG(MUSE_PLAYER_API_SET_CALLBACK, ret, module); } return ret; @@ -2945,7 +2946,7 @@ int player_disp_set_pcm_extraction_mode(muse_module_h module) muse_player = (muse_player_handle_t *)muse_server_ipc_get_handle(module); player_msg_get(sync, muse_server_module_get_msg(module)); - ret = legacy_player_set_pcm_extraction_mode(muse_player->player_handle, sync, _audio_frame_decoded_cb, module); + ret = legacy_player_set_pcm_extraction_mode(muse_player->player_handle, sync, _audio_decoded_cb, module); PLAYER_RETURN_MSG(api, ret, module); diff --git a/packaging/mmsvc-player.spec b/packaging/mmsvc-player.spec index 4c979f1..f52f0c0 100644 --- a/packaging/mmsvc-player.spec +++ b/packaging/mmsvc-player.spec @@ -1,6 +1,6 @@ Name: mmsvc-player Summary: A Media Player module for muse server -Version: 0.2.107 +Version: 0.2.108 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 -- 2.7.4