* @param[in] user_data The user data to be passed to the callback function
* @param[out] stream_info The handle of stream information
*
+ * @remarks Do not call this API within sound_stream_focus_state_changed_cb() and sound_stream_focus_state_watch_cb(),\n
+ * otherwise SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
+ *
* @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_NOT_SUPPORTED Not supported
* @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
* @see sound_manager_destroy_stream_information()
* @since_tizen 3.0
* @param[in] stream_info The handle of stream information
*
+ * @remarks Do not call this API within sound_stream_focus_state_changed_cb() and sound_stream_focus_state_watch_cb(),\n
+ * otherwise SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
+ *
* @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_create_stream_information()
* @see sound_manager_add_device_for_stream_routing()
* @param[in] stream_info The handle of stream information
* @param[in] device The device item from sound_device_list_h
*
- * @remarks @a Use sound_manager_get_current_device_list() and sound_manager_get_next_device() to get the device.\n
+ * @remarks Use sound_manager_get_current_device_list() and sound_manager_get_next_device() to get the device.\n
* SOUND_MANAGER_ERROR_POLICY could be returned according to the stream type of the stream_info.\n
* The available type of the stream_info for this API is SOUND_STREAM_TYPE_VOIP.
*
* @param[in] stream_info The handle of stream information
* @param[in] device The device item from sound_device_list_h
*
- * @remarks @a Use sound_manager_get_current_device_list() and sound_manager_get_next_device() to get the device.\n
+ * @remarks Use sound_manager_get_current_device_list() and sound_manager_get_next_device() to get the device.\n
*
* @return @c 0 on success,
* otherwise a negative error value
* @since_tizen 3.0
* @param[in] stream_info The handle of stream information
*
- * @remarks @a If the stream has not been made yet, this setting will be applied when the stream starts to play.\n
+ * @remarks If the stream has not been made yet, this setting will be applied when the stream starts to play.\n
*
* @return @c 0 on success,
* otherwise a negative error value
* @param[in] focus_mask The focus mask that user wants to acquire
* @param[in] additional_info Additional information for this request (optional, this can be null)
*
+ * @remarks Do not call this API within sound_stream_focus_state_changed_cb() and sound_stream_focus_state_watch_cb(),\n
+ * otherwise SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
+ *
* @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_INVALID_STATE Invalid state
* @retval #SOUND_MANAGER_ERROR_POLICY Noncompliance with the sound system policy
* @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
* @param[in] focus_mask The focus mask that user wants to release
* @param[in] additional_info Additional information for this request (optional, this can be null)
*
+ * @remarks Do not call this API within sound_stream_focus_state_changed_cb() and sound_stream_focus_state_watch_cb(),\n
+ * otherwise SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
+ *
* @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_INVALID_STATE Invalid state
* @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
* @pre Call sound_manager_create_stream_information()/sound_manager_acquire_focus() before calling this function.
* @param[in] callback The focus state change watch callback function
* @param[in] user_data The user data to be passed to the callback function
*
- * @remarks @a You can set this callback only once per process.
+ * @remarks You can set this callback only once per process.
+ * Do not call this API within sound_stream_focus_state_changed_cb() and sound_stream_focus_state_watch_cb(),\n
+ * otherwise SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
*
* @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_unset_focus_state_watch_cb()
*/
* @brief Unregisters the focus state watch callback.
* @since_tizen 3.0
*
+ * @remarks Do not call this API within sound_stream_focus_state_changed_cb() and sound_stream_focus_state_watch_cb(),\n
+ * otherwise SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
+ *
* @return @c 0 on success,
* otherwise a negative error value
* @retval #SOUND_MANAGER_ERROR_NONE Success
+ * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
* @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
* @see sound_manager_set_focus_state_watch_cb()
*/
* @param[in] device_mask The mask value
* @param[out] device_list The list of connected devices
*
- * @remarks @a Use sound_manager_get_next_device() to get the first node of the list.
+ * @remarks Use sound_manager_get_next_device() to get the first node of the list.
*
* @return @c 0 on success,
* otherwise a negative error value
* @param[in] callback The interrupted callback function
* @param[in] user_data The user data to be passed to the callback function
*
- * @remarks @a The initial state of sound devices connected is deactivated.
+ * @remarks The initial state of sound devices connected is deactivated.
*
* @return @c 0 on success,
* otherwise a negative error value
switch (code) {
case MM_ERROR_FILE_WRITE:
case MM_ERROR_INVALID_HANDLE:
+ case MM_ERROR_SOUND_INVALID_OPERATION:
ret = SOUND_MANAGER_ERROR_INVALID_OPERATION;
errorstr = "INVALID_OPERATION";
break;
errorstr = "NO_PLAYING_SOUND";
break;
case MM_ERROR_NOT_SUPPORT_API:
- case MM_ERROR_SOUND_NOT_SUPPORTED_OPERATION:
ret = SOUND_MANAGER_ERROR_NOT_SUPPORTED;
errorstr = "NOT_SUPPORTED";
break;
int ret = MM_ERROR_NONE;
int pa_ret = PA_OK;
int i = 0;
+ bool is_focus_cb_thread = false;
+
+ ret = mm_sound_focus_is_cb_thread(&is_focus_cb_thread);
+ if (ret)
+ return ret;
+ else {
+ if (is_focus_cb_thread)
+ return MM_ERROR_SOUND_INVALID_OPERATION;
+ }
if (!(stream_h->pa_mainloop = pa_threaded_mainloop_new()))
goto PA_ERROR;
pa_threaded_mainloop_free(stream_h->pa_mainloop);
stream_h->pa_mainloop = NULL;
}
- free(stream_h);
ret = MM_ERROR_SOUND_INTERNAL;
LOGE("pa_ret(%d), ret(%p)", pa_ret, ret);
{
int i = 0;
int ret = MM_ERROR_NONE;
+ bool is_focus_cb_thread = false;
+
+ ret = mm_sound_focus_is_cb_thread(&is_focus_cb_thread);
+ if (ret)
+ return ret;
+ else {
+ if (is_focus_cb_thread)
+ return MM_ERROR_SOUND_INVALID_OPERATION;
+ }
if (stream_h->pa_context) {
pa_context_disconnect(stream_h->pa_context);
(*virtual_stream)->stream_info = stream_info;
}
} else
- ret = MM_ERROR_SOUND_NOT_SUPPORTED_OPERATION;
+ ret = MM_ERROR_NOT_SUPPORT_API;
return ret;
}