From: Sangchul Lee Date: Mon, 3 Sep 2018 08:28:47 +0000 (+0900) Subject: Add internal APIs for USB devices X-Git-Tag: submit/tizen/20180903.232522^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F41%2F188241%2F2;p=platform%2Fcore%2Fapi%2Fsound-manager.git Add internal APIs for USB devices These will be used to CSharp API. [Version] 0.5.13 [Issue Type] New internal API Change-Id: I09cc7a5049455240e0780dc14c7b8dc985b54827 Signed-off-by: Sangchul Lee --- diff --git a/include/sound_manager_internal.h b/include/sound_manager_internal.h index ba7b295..a4de502 100644 --- a/include/sound_manager_internal.h +++ b/include/sound_manager_internal.h @@ -341,6 +341,234 @@ int sound_manager_get_device_state_by_id(int device_id, sound_device_state_e *st */ int sound_manager_is_device_running_by_id(int device_id, bool *is_running); +/** + * @internal + * @brief Gets the device's supported sample formats. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n + * The @a formats should be released using free(). + * + * @param[in] device_id The device id + * @param[out] formats The supported sample format list + * @param[out] num_of_elems The number of elements in the sample format list + * @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_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_set_sample_format_by_id() + * @see sound_manager_get_sample_format_by_id() + */ +int sound_manager_get_supported_sample_formats_by_id(int device_id, sound_sample_format_e **formats, unsigned int *num_of_elems); + +/** + * @internal + * @brief Sets the device's sample format. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device.\n + * @a format should be one of the values received from sound_manager_get_supported_sample_formats_by_id(),\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not. + * + * @param[in] device_id The device id + * @param[in] format The sample format + * @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_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_get_supported_sample_formats_by_id() + * @see sound_manager_get_sample_format_by_id() + */ +int sound_manager_set_sample_format_by_id(int device_id, sound_sample_format_e format); + +/** + * @internal + * @brief Gets the device's sample format. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not. + * + * @param[in] device_id The device id + * @param[out] format The sample format + * @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_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_get_supported_sample_formats_by_id() + * @see sound_manager_set_sample_format_by_id() + */ +int sound_manager_get_sample_format_by_id(int device_id, sound_sample_format_e *format); + +/** + * @internal + * @brief Gets the device's supported sample rates. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n + * The @a rates should be released using free(). + * + * @param[in] device_id The device id + * @param[out] rates The supported sample rate list + * @param[out] num_of_elems The number of elements in the sample rate list + * @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_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_set_sample_rate_by_id() + * @see sound_manager_get_sample_rate_by_id() + */ +int sound_manager_get_supported_sample_rates_by_id(int device_id, sound_sample_rate_e **rates, unsigned int *num_of_elems); + +/** + * @internal + * @brief Sets the device's sample rate. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device.\n + * @a rate should be one of the values received from sound_manager_get_supported_sample_rates(),\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not. + * + * @param[in] device_id The device id + * @param[in] rate The sample rate + * @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_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_get_supported_sample_rates_by_id() + * @see sound_manager_get_sample_rate_by_id() + */ +int sound_manager_set_sample_rate_by_id(int device_id, sound_sample_rate_e rate); + +/** + * @internal + * @brief Gets the device's sample rate. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not. + * + * @param[in] device_id The device id + * @param[out] rate The sample rate + * @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_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_get_supported_sample_rates_by_id() + * @see sound_manager_set_sample_rate_by_id() + */ +int sound_manager_get_sample_rate_by_id(int device_id, sound_sample_rate_e *rate); + +/** + * @internal + * @brief Sets the device's 'avoid resampling' property. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n + * The 'avoid resampling' property is not enabled as default. With this enabled, the device will\n + * use the first stream's original sample format and rate without resampling if supported. + * + * @param[in] device_id The device id + * @param[in] enable The 'avoid resampling' 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_INVALID_PARAMETER Invalid parameter + * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_get_avoid_resampling_by_id() + */ +int sound_manager_set_avoid_resampling_by_id(int device_id, bool enable); + +/** + * @internal + * @brief Gets the device's 'avoid resampling' property. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n + * The default value of 'avoid resampling' is false. + * + * @param[in] device_id The device id + * @param[in] enabled The value of 'avoid resampling' property: (@c true = enabled, @c false = disabled) + * @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_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_set_avoid_resampling_by_id() + */ +int sound_manager_get_avoid_resampling_by_id(int device_id, bool *enabled); + +/** + * @internal + * @brief Sets the restriction of stream type only for media. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n + * This property is not enabled as default. With this enabled, no other stream types\n + * except #SOUND_STREAM_TYPE_MEDIA is not allowed to @a device. + * + * @param[in] device_id The device id + * @param[in] enable The 'media stream only' 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_INVALID_PARAMETER Invalid parameter + * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_get_media_stream_only_by_id() + */ +int sound_manager_set_media_stream_only_by_id(int device_id, bool enable); + +/** + * @internal + * @brief Gets the restriction of stream type only for media. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n + * The property is not enabled as default. + * + * @param[in] device_id The device id + * @param[out] enabled The value of 'media stream only' property: (@c true = enabled, @c false = disabled) + * @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_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_set_media_stream_only_by_id() + */ +int sound_manager_get_media_stream_only_by_id(int device_id, bool *enabled); + /** * @internal * @brief Creates a virtual stream handle. diff --git a/include/sound_manager_internal_tv.h b/include/sound_manager_internal_tv.h index ea39daf..ca5f344 100644 --- a/include/sound_manager_internal_tv.h +++ b/include/sound_manager_internal_tv.h @@ -296,6 +296,234 @@ int sound_manager_get_device_state_by_id(int device_id, sound_device_state_e *st */ int sound_manager_is_device_running_by_id(int device_id, bool *is_running); +/** + * @internal + * @brief Gets the device's supported sample formats. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n + * The @a formats should be released using free(). + * + * @param[in] device_id The device id + * @param[out] formats The supported sample format list + * @param[out] num_of_elems The number of elements in the sample format list + * @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_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_set_sample_format_by_id() + * @see sound_manager_get_sample_format_by_id() + */ +int sound_manager_get_supported_sample_formats_by_id(int device_id, sound_sample_format_e **formats, unsigned int *num_of_elems); + +/** + * @internal + * @brief Sets the device's sample format. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device.\n + * @a format should be one of the values received from sound_manager_get_supported_sample_formats_by_id(),\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not. + * + * @param[in] device_id The device id + * @param[in] format The sample format + * @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_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_get_supported_sample_formats_by_id() + * @see sound_manager_get_sample_format_by_id() + */ +int sound_manager_set_sample_format_by_id(int device_id, sound_sample_format_e format); + +/** + * @internal + * @brief Gets the device's sample format. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not. + * + * @param[in] device_id The device id + * @param[out] format The sample format + * @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_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_get_supported_sample_formats_by_id() + * @see sound_manager_set_sample_format_by_id() + */ +int sound_manager_get_sample_format_by_id(int device_id, sound_sample_format_e *format); + +/** + * @internal + * @brief Gets the device's supported sample rates. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n + * The @a rates should be released using free(). + * + * @param[in] device_id The device id + * @param[out] rates The supported sample rate list + * @param[out] num_of_elems The number of elements in the sample rate list + * @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_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_set_sample_rate_by_id() + * @see sound_manager_get_sample_rate_by_id() + */ +int sound_manager_get_supported_sample_rates_by_id(int device_id, sound_sample_rate_e **rates, unsigned int *num_of_elems); + +/** + * @internal + * @brief Sets the device's sample rate. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device.\n + * @a rate should be one of the values received from sound_manager_get_supported_sample_rates(),\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not. + * + * @param[in] device_id The device id + * @param[in] rate The sample rate + * @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_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_get_supported_sample_rates_by_id() + * @see sound_manager_get_sample_rate_by_id() + */ +int sound_manager_set_sample_rate_by_id(int device_id, sound_sample_rate_e rate); + +/** + * @internal + * @brief Gets the device's sample rate. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not. + * + * @param[in] device_id The device id + * @param[out] rate The sample rate + * @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_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_get_supported_sample_rates_by_id() + * @see sound_manager_set_sample_rate_by_id() + */ +int sound_manager_get_sample_rate_by_id(int device_id, sound_sample_rate_e *rate); + +/** + * @internal + * @brief Sets the device's 'avoid resampling' property. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n + * The 'avoid resampling' property is not enabled as default. With this enabled, the device will\n + * use the first stream's original sample format and rate without resampling if supported. + * + * @param[in] device_id The device id + * @param[in] enable The 'avoid resampling' 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_INVALID_PARAMETER Invalid parameter + * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_get_avoid_resampling_by_id() + */ +int sound_manager_set_avoid_resampling_by_id(int device_id, bool enable); + +/** + * @internal + * @brief Gets the device's 'avoid resampling' property. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n + * The default value of 'avoid resampling' is false. + * + * @param[in] device_id The device id + * @param[in] enabled The value of 'avoid resampling' property: (@c true = enabled, @c false = disabled) + * @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_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_set_avoid_resampling_by_id() + */ +int sound_manager_get_avoid_resampling_by_id(int device_id, bool *enabled); + +/** + * @internal + * @brief Sets the restriction of stream type only for media. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n + * This property is not enabled as default. With this enabled, no other stream types\n + * except #SOUND_STREAM_TYPE_MEDIA is not allowed to @a device. + * + * @param[in] device_id The device id + * @param[in] enable The 'media stream only' 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_INVALID_PARAMETER Invalid parameter + * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_get_media_stream_only_by_id() + */ +int sound_manager_set_media_stream_only_by_id(int device_id, bool enable); + +/** + * @internal + * @brief Gets the restriction of stream type only for media. + * @since_tizen 5.0 + * + * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n + * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n + * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n + * The property is not enabled as default. + * + * @param[in] device_id The device id + * @param[out] enabled The value of 'media stream only' property: (@c true = enabled, @c false = disabled) + * @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_INVALID_OPERATION Invalid operation + * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system + * @see sound_manager_set_media_stream_only_by_id() + */ +int sound_manager_get_media_stream_only_by_id(int device_id, bool *enabled); + /** * @internal * @brief Creates a virtual stream handle. diff --git a/packaging/capi-media-sound-manager.spec b/packaging/capi-media-sound-manager.spec index eb4bc37..9430f4c 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.5.12 +Version: 0.5.13 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/sound_manager_internal.c b/src/sound_manager_internal.c index 2e9c4e6..c1f5600 100644 --- a/src/sound_manager_internal.c +++ b/src/sound_manager_internal.c @@ -215,6 +215,130 @@ int sound_manager_is_device_running_by_id(int device_id, bool *is_running) return _convert_sound_manager_error_code(__func__, ret); } +int sound_manager_get_supported_sample_formats_by_id(int device_id, sound_sample_format_e **formats, unsigned int *num_of_elems) +{ + int ret = MM_ERROR_NONE; + + LOGI(">> enter"); + + SM_NULL_ARG_CHECK(formats); + SM_NULL_ARG_CHECK(num_of_elems); + + ret = _get_supported_sample_formats(device_id, formats, num_of_elems); + + return _convert_sound_manager_error_code(__func__, ret); +} + +int sound_manager_set_sample_format_by_id(int device_id, sound_sample_format_e format) +{ + int ret = MM_ERROR_NONE; + + LOGI(">> enter"); + + ret = _set_sample_format(device_id, format); + + return _convert_sound_manager_error_code(__func__, ret); +} + +int sound_manager_get_sample_format_by_id(int device_id, sound_sample_format_e *format) +{ + int ret = MM_ERROR_NONE; + + LOGI(">> enter"); + + SM_NULL_ARG_CHECK(format); + + ret = _get_sample_format(device_id, format); + + return _convert_sound_manager_error_code(__func__, ret); +} + +int sound_manager_get_supported_sample_rates_by_id(int device_id, sound_sample_rate_e **rates, unsigned int *num_of_elems) +{ + int ret = MM_ERROR_NONE; + + LOGI(">> enter"); + + SM_NULL_ARG_CHECK(rates); + SM_NULL_ARG_CHECK(num_of_elems); + + ret = _get_supported_sample_rates(device_id, rates, num_of_elems); + + return _convert_sound_manager_error_code(__func__, ret); +} + +int sound_manager_set_sample_rate_by_id(int device_id, sound_sample_rate_e rate) +{ + int ret = MM_ERROR_NONE; + + LOGI(">> enter"); + + ret = _set_sample_rate(device_id, rate); + + return _convert_sound_manager_error_code(__func__, ret); +} + +int sound_manager_get_sample_rate_by_id(int device_id, sound_sample_rate_e *rate) +{ + int ret = MM_ERROR_NONE; + + LOGI(">> enter"); + + SM_NULL_ARG_CHECK(rate); + + ret = _get_sample_rate(device_id, rate); + + return _convert_sound_manager_error_code(__func__, ret); +} + +int sound_manager_set_avoid_resampling_by_id(int device_id, bool enable) +{ + int ret = MM_ERROR_NONE; + + LOGI(">> enter"); + + ret = _set_avoid_resampling(device_id, enable); + + return _convert_sound_manager_error_code(__func__, ret); +} + +int sound_manager_get_avoid_resampling_by_id(int device_id, bool *enabled) +{ + int ret = MM_ERROR_NONE; + + LOGI(">> enter"); + + SM_NULL_ARG_CHECK(enabled); + + ret = _get_avoid_resampling(device_id, enabled); + + return _convert_sound_manager_error_code(__func__, ret); +} + +int sound_manager_set_media_stream_only_by_id(int device_id, bool enable) +{ + int ret = MM_ERROR_NONE; + + LOGI(">> enter"); + + ret = _set_media_stream_only(device_id, enable); + + return _convert_sound_manager_error_code(__func__, ret); +} + +int sound_manager_get_media_stream_only_by_id(int device_id, bool *enabled) +{ + int ret = MM_ERROR_NONE; + + LOGI(">> enter"); + + SM_NULL_ARG_CHECK(enabled); + + ret = _get_media_stream_only(device_id, enabled); + + return _convert_sound_manager_error_code(__func__, ret); +} + int sound_manager_create_virtual_stream(sound_stream_info_h stream_info, virtual_sound_stream_h *virtual_stream) { int ret = MM_ERROR_NONE;