[0.2.108] apply pcm extraction option 17/203317/1 accepted/tizen/unified/20190416.071458 submit/tizen/20190415.073034
authorEunhye Choi <eunhae1.choi@samsung.com>
Thu, 11 Apr 2019 11:51:48 +0000 (20:51 +0900)
committerEunhye Choi <eunhae1.choi@samsung.com>
Thu, 11 Apr 2019 11:52:44 +0000 (20:52 +0900)
- 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
legacy/src/legacy_player.c
legacy/src/legacy_player_internal.c
muse/src/muse_player.c
packaging/mmsvc-player.spec

index 6d726acccf97b69fad3778d9a3e126646da9e3a9..ff30979709f236c5a82807e3be7701e9b55fb0d6 100644 (file)
@@ -35,11 +35,6 @@ extern "C" {
  * @brief This file contains the media player API.
  */
 
-/**
- * @addtogroup CAPI_MEDIA_PLAYER_MODULE
- * @{
- */
-
 /**
  * @brief The media player's type handle.
  * @since_tizen 2.3
@@ -144,15 +139,6 @@ typedef void *player_display_h;
 #define GET_DISPLAY(x) (void *)(x)
 #endif
 
-/**
- * @}
- */
-
-/**
- * @addtogroup CAPI_MEDIA_PLAYER_DISPLAY_MODULE
- * @{
- */
-
 /**
  * @brief Enumeration for display rotation type.
  * @since_tizen 2.3
@@ -178,15 +164,6 @@ typedef enum {
        PLAYER_DISPLAY_MODE_NUM
 } player_display_mode_e;
 
-/**
- * @}
- */
-
-/**
- * @addtogroup CAPI_MEDIA_PLAYER_STREAM_INFO_MODULE
- * @{
- */
-
 /**
  * @brief Enumeration for media stream content information.
  * @since_tizen 2.3
@@ -200,16 +177,6 @@ typedef enum {
        PLAYER_CONTENT_INFO_YEAR,       /**< Year */
 } player_content_info_e;
 
-/**
- * @}
- */
-
-
-/**
- * @addtogroup CAPI_MEDIA_PLAYER_SUBTITLE_MODULE
- * @{
- */
-
 /**
  * @brief  Called when the subtitle is updated.
  * @since_tizen 2.3
@@ -221,15 +188,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
@@ -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);
@@ -1035,15 +993,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
@@ -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
@@ -1276,16 +1215,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
@@ -1433,16 +1362,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
@@ -1652,15 +1571,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
@@ -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
index 39d98037fdbde06534e4013d954d3489fd315774..034ddafc6fb2aa85da4903e31d8f0914995fde99 100644 (file)
@@ -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__);
 
index 0efe0989a3e30600f4c7d961b20b280c6c1e4197..83ec9d26cc8ef436cc4666eae00e90d83c7193b0 100644 (file)
@@ -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__);
 
index 9c79aa1bd15d91b36a944ccdb0cb387a20b16c30..3b0c4c257560d7e1dfd29289c01de23d78b33f78 100644 (file)
@@ -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);
 
index 4c979f1151beda9cf2e8e3ad7957167f6afde63c..f52f0c07a8378d0f1c109622956cfd03d406bfa5 100644 (file)
@@ -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