Add internal APIs for USB devices 41/188241/2 accepted/tizen/5.0/unified/20181102.013627 accepted/tizen/unified/20180905.060757 submit/tizen/20180903.232522 submit/tizen_5.0/20181101.000002
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 3 Sep 2018 08:28:47 +0000 (17:28 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 3 Sep 2018 23:10:31 +0000 (08:10 +0900)
These will be used to CSharp API.

[Version] 0.5.13
[Issue Type] New internal API

Change-Id: I09cc7a5049455240e0780dc14c7b8dc985b54827
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
include/sound_manager_internal.h
include/sound_manager_internal_tv.h
packaging/capi-media-sound-manager.spec
src/sound_manager_internal.c

index ba7b29532dea2027eb8e0f9f59515dd64ec00a38..a4de5023a7a5c19999e5e1acb437a6795ba962cd 100644 (file)
@@ -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.
index ea39daf3a5e07ddf251a198ee4eeeb8a882460f1..ca5f344e9b2c205c405a171a74fa71044f1ae7b8 100644 (file)
@@ -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.
index eb4bc371e59854973d1af48583153519c40d6d35..9430f4c786b4014bc82761473a0343ac66ac7606 100644 (file)
@@ -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
index 2e9c4e622684bd48f5865527b82ac6379d9855dc..c1f5600823b249c5395a8bb181534719a6bee075 100644 (file)
@@ -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;