From ce6f035fe10e10da775db51ec87f43c6cc7ff2e0 Mon Sep 17 00:00:00 2001 From: Jaechul Lee Date: Mon, 24 Jul 2023 14:37:35 +0900 Subject: [PATCH] Remove unused internal AEC/NS API [Version] 0.7.10 [Issue Type] Update Change-Id: Icef5f87b24f3f2c043942d240bccb52bb1e4d801 Signed-off-by: Jaechul Lee --- include/sound_manager_internal.h | 104 ------------------------ include/sound_manager_private.h | 12 --- packaging/capi-media-sound-manager.spec | 2 +- src/sound_manager_internal.c | 20 ----- src/sound_manager_private.c | 78 ------------------ 5 files changed, 1 insertion(+), 215 deletions(-) diff --git a/include/sound_manager_internal.h b/include/sound_manager_internal.h index d20e124..c44fcba 100644 --- a/include/sound_manager_internal.h +++ b/include/sound_manager_internal.h @@ -135,34 +135,6 @@ typedef enum { SOUND_RPI_PLAYBACK_HDMI2, /**< HDMI2 (only for RPI4) */ } sound_rpi_playback_route_type; -/** - * @internal - * @brief Definition for the value indicating that the reference device for the stream information was not set. - * @since_tizen 7.0 - * @see sound_manager_get_echo_cancel_reference_device() - */ -#define SOUND_MANAGER_STREAM_NO_REFERENCE_DEVICE 0 - -/** - * @internal - * @brief Enumeration for noise-suppression scenarios - * @since_tizen 8.0 - */ -typedef enum { - SOUND_ACOUSTIC_ECHO_CANCEL_VOICE_CALL, - SOUND_ACOUSTIC_ECHO_CANCEL_REFERENCE_COPY, -} sound_acoustic_echo_cancel_type_e; - -/** - * @internal - * @brief Enumeration for noise-suppression scenarios - * @since_tizen 8.0 - */ -typedef enum { - SOUND_NOISE_SUPPRESSION_VOICE_CALL, - SOUND_NOISE_SUPPRESSION_VOICE_RECOGNITION, -} sound_noise_suppression_type_e; - /** * @brief Enumeration for sound effects. * @since_tizen 8.0 @@ -1228,82 +1200,6 @@ int sound_manager_start_discover_remote_device(void); */ int sound_manager_stop_discover_remote_device(void); -/** - * @internal - * @brief Sets acoustic echo cancellation reference device - * @since_tizen 7.0 - * @remark You can get a device handle by using sound_manager_get_device_list() and sound_manager_get_next_device()\n - * If @a device is not supported by @a stream_info, #SOUND_MANAGER_ERROR_POLICY will be returned. - * @param[in] stream_info The handle of stream information - * @param[in] device The reference device of echo-cancellation - * @param[in] type The types of acoustic echo cancellation - * @return @c 0 on success, - * otherwise a negative error value - * @retval #SOUND_MANAGER_ERROR_NONE Success - * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #SOUND_MANAGER_ERROR_POLICY Noncompliance with the sound system policy - * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system - * @see sound_manager_create_stream_information() - * @see sound_manager_get_device_list() - * @see sound_manager_get_next_device() - * @see sound_manager_free_device_list() - */ -int sound_manager_set_echo_cancel_reference_device(sound_stream_info_h stream_info, sound_device_h device, sound_acoustic_echo_cancel_type_e type); - -/** - * @internal - * @brief Gets acoustic echo cancellation reference device - * @since_tizen 7.0 - * @remarks If there is no reference device that has been set, the output value will be set to - * #SOUND_MANAGER_STREAM_NO_REFERENCE_DEVICE.\n - * You can get a device handle of the id value by using sound_manager_get_device_list(), - * sound_manager_get_next_device() and sound_manager_get_device_id(). - * @param[in] stream_info The handle of stream information - * @param[out] device_id The reference device id of echo-cancellation - * @param[in] type The types of acoustic echo cancellation - * @return @c 0 on success, - * otherwise a negative error value - * @retval #SOUND_MANAGER_ERROR_NONE Success - * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @see sound_manager_create_stream_information() - * @see sound_manager_get_device_list() - * @see sound_manager_get_next_device() - * @see sound_manager_free_device_list() - */ -int sound_manager_get_echo_cancel_reference_device(sound_stream_info_h stream_info, int *device_id, sound_acoustic_echo_cancel_type_e *type); - -/** - * @internal - * @brief Sets noise suppression status - * @since_tizen 7.5 - * @param[in] stream_info The handle of stream information - * @param[in] type The type of noise suppression - * @param[in] enable The 'noise_suppression' property value to set: (@c true = enable, @c false = disable) - * @return @c 0 on success, - * otherwise a negative error value - * @retval #SOUND_MANAGER_ERROR_NONE Success - * @retval #SOUND_MANAGER_ERROR_POLICY Noncompliance with the sound system policy - * @see sound_manager_create_stream_information() - * @see sound_manager_get_noise_suppression() - */ -int sound_manager_set_noise_suppression(sound_stream_info_h stream_info, bool enable, sound_noise_suppression_type_e type); - -/** - * @internal - * @brief Gets noise suppression status - * @since_tizen 7.5 - * @param[in] stream_info The handle of stream information - * @param[out] enabled The 'noise_suppression' property value : (@c true = enable, @c false = disable) - * @param[out] type The type of the noise_suppression scenario - * @return @c 0 on success, - * otherwise a negative error value - * @retval #SOUND_MANAGER_ERROR_NONE Success - * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @see sound_manager_create_stream_information() - * @see sound_manager_set_noise_suppression() - */ -int sound_manager_get_noise_suppression(sound_stream_info_h stream_info, bool *enabled, sound_noise_suppression_type_e *type); - /** * @internal * @brief Set force hdmi route diff --git a/include/sound_manager_private.h b/include/sound_manager_private.h index 88bb0e1..8abe53c 100644 --- a/include/sound_manager_private.h +++ b/include/sound_manager_private.h @@ -217,10 +217,6 @@ typedef struct _sound_stream_info_s { void *user_data; manual_route_info_s manual_route_info; preferred_device_info_s preferred_device_info; - int echo_cancel_reference_device; - sound_acoustic_echo_cancel_type_e echo_cancel_type; - bool noise_suppression_enable; - sound_noise_suppression_type_e noise_suppression_type; sound_effect_s sound_effect; pthread_mutex_t focus_state_mutex; pthread_mutex_t focus_cb_mutex; @@ -409,14 +405,6 @@ int _get_preemptive_device(sound_stream_type_e stream_type, int *in_device_id, i int _get_latest_stream_pid(int stream_type, unsigned int *pid); -int _set_echo_cancel_reference_device(sound_stream_info_s *stream_info, sound_device_h device, sound_acoustic_echo_cancel_type_e type); - -int _get_echo_cancel_reference_device(sound_stream_info_s *stream_info, int *device_id, sound_acoustic_echo_cancel_type_e *type); - -int _set_noise_suppression(sound_stream_info_s *stream_info, bool enable, sound_noise_suppression_type_e type); - -int _get_noise_suppression(sound_stream_info_s *stream_info, bool *enable, sound_noise_suppression_type_e *type); - int _set_rpi_playback_route(sound_rpi_playback_route_type type); int _get_rpi_playback_route(sound_rpi_playback_route_type *type); diff --git a/packaging/capi-media-sound-manager.spec b/packaging/capi-media-sound-manager.spec index 21d930d..a7556d8 100644 --- a/packaging/capi-media-sound-manager.spec +++ b/packaging/capi-media-sound-manager.spec @@ -1,6 +1,6 @@ Name: capi-media-sound-manager Summary: Sound Manager library -Version: 0.7.9 +Version: 0.7.10 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/sound_manager_internal.c b/src/sound_manager_internal.c index b341d3f..6cd49ad 100644 --- a/src/sound_manager_internal.c +++ b/src/sound_manager_internal.c @@ -927,26 +927,6 @@ int sound_manager_set_remote_permission(int id, bool allowed) return _set_remote_permission(id, allowed); } -int sound_manager_set_echo_cancel_reference_device(sound_stream_info_h stream_info, sound_device_h device, sound_acoustic_echo_cancel_type_e type) -{ - return _set_echo_cancel_reference_device((sound_stream_info_s*)stream_info, device, type); -} - -int sound_manager_get_echo_cancel_reference_device(sound_stream_info_h stream_info, int *device_id, sound_acoustic_echo_cancel_type_e *type) -{ - return _get_echo_cancel_reference_device((sound_stream_info_s*)stream_info, device_id, type); -} - -int sound_manager_set_noise_suppression(sound_stream_info_h stream_info, bool enable, sound_noise_suppression_type_e type) -{ - return _set_noise_suppression((sound_stream_info_s*)stream_info, enable, type); -} - -int sound_manager_get_noise_suppression(sound_stream_info_h stream_info, bool *enabled, sound_noise_suppression_type_e *type) -{ - return _get_noise_suppression((sound_stream_info_s*)stream_info, enabled, type); -} - int sound_manager_set_rpi_playback_route(sound_rpi_playback_route_type type) { return _set_rpi_playback_route(type); diff --git a/src/sound_manager_private.c b/src/sound_manager_private.c index ea252c6..6aedc65 100644 --- a/src/sound_manager_private.c +++ b/src/sound_manager_private.c @@ -2485,84 +2485,6 @@ int _set_remote_permission(int id, bool allowed) return ret; } -int _set_echo_cancel_reference_device(sound_stream_info_s *stream_info, sound_device_h device, sound_acoustic_echo_cancel_type_e type) -{ - int ret; - int device_id; - char *device_name; - - SM_ARG_CHECK(stream_info); - SM_ARG_CHECK(device); - - if (!stream_info->stream_conf_info.avail_in_devices[0]) { - LOGE("stream_info[%p, %s] does not support any input devices", stream_info, stream_info->stream_type); - return SOUND_MANAGER_ERROR_POLICY; - } - - /* FIXME: check if the PA sink supports to pump the reference data to AEC module */ - if ((ret = mm_sound_get_device_id(device, &device_id)) != MM_ERROR_NONE) - return _convert_sound_manager_error_code(__func__, ret); - - if ((ret = mm_sound_get_device_name(device, &device_name)) != MM_ERROR_NONE) - return _convert_sound_manager_error_code(__func__, ret); - - stream_info->echo_cancel_reference_device = device_id; - stream_info->echo_cancel_type = type; - - LOGI("stream_info[%p, %s] EC reference device[id:%d, name:%s type:%d]", - stream_info, stream_info->stream_type, device_id, device_name, stream_info->echo_cancel_type); - - return SOUND_MANAGER_ERROR_NONE; -} - -int _get_echo_cancel_reference_device(sound_stream_info_s *stream_info, int *device_id, sound_acoustic_echo_cancel_type_e *type) -{ - SM_ARG_CHECK(stream_info); - SM_ARG_CHECK(device_id); - SM_ARG_CHECK(type); - - *device_id = stream_info->echo_cancel_reference_device; - *type = stream_info->echo_cancel_type; - - LOGI("stream_info[%p, %s] reference device_id[%d], type[%d]", - stream_info, stream_info->stream_type, *device_id, *type); - - return SOUND_MANAGER_ERROR_NONE; -} - -int _set_noise_suppression(sound_stream_info_s *stream_info, bool enable, sound_noise_suppression_type_e type) -{ - SM_ARG_CHECK(stream_info); - - if (!stream_info->stream_conf_info.avail_in_devices[0]) { - LOGE("stream_info[%p, %s] does not support any input devices", stream_info, stream_info->stream_type); - return SOUND_MANAGER_ERROR_POLICY; - } - - stream_info->noise_suppression_enable = enable; - stream_info->noise_suppression_type = type; - - LOGI("stream_info[%p, %s] noise_suppression[%d], type[%d]", - stream_info, stream_info->stream_type, stream_info->noise_suppression_enable, stream_info->noise_suppression_type); - - return SOUND_MANAGER_ERROR_NONE; -} - -int _get_noise_suppression(sound_stream_info_s *stream_info, bool *enabled, sound_noise_suppression_type_e *type) -{ - SM_ARG_CHECK(stream_info); - SM_ARG_CHECK(enabled); - SM_ARG_CHECK(type); - - *enabled = stream_info->noise_suppression_enable; - *type = stream_info->noise_suppression_type; - - LOGI("stream_info[%p, %s] noise_suppression[%d], type[%d]", - stream_info, stream_info->stream_type, *enabled, *type); - - return SOUND_MANAGER_ERROR_NONE; -} - int _set_rpi_playback_route(sound_rpi_playback_route_type type) { int ret; -- 2.34.1