* @brief Creates SDP offer to start a new WebRTC connection to a remote peer.
* @since_tizen 6.5
* @remarks The @a offer should be released using free().\n
- * The @a options currently has no effect.
+ * The @a options currently has no effect.\n
+ * This function can be called in the state of #WEBRTC_STATE_PLAYING. (Since 9.0)
* @param[in] webrtc WebRTC handle
* @param[in] options Configuration options for the offer (optional, this can be NULL)
* @param[out] offer SDP offer
* @retval #WEBRTC_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WEBRTC_ERROR_INVALID_OPERATION Invalid operation
* @retval #WEBRTC_ERROR_INVALID_STATE Invalid state
- * @pre @a webrtc state must be set to #WEBRTC_STATE_NEGOTIATING.
+ * @pre @a webrtc state must be set to #WEBRTC_STATE_NEGOTIATING or WEBRTC_STATE_PLAYING.
* @post @a offer must be set as a local description by calling webrtc_set_local_description()
* @post @a offer must be sent to the remote peer via the signaling channel.
* @see webrtc_state_changed_cb()
* @brief Creates SDP answer to an offer received from a remote peer during the negotiation of a WebRTC connection.
* @since_tizen 6.5
* @remarks The @a answer should be released using free().\n
- * The @a options currently has no effect.
+ * The @a options currently has no effect.\n
+ * This function can be called in the state of #WEBRTC_STATE_PLAYING. (Since 9.0)
* @param[in] webrtc WebRTC handle
* @param[in] options Configuration options for the answer (optional, this can be NULL)
* @param[out] answer SDP answer
* @retval #WEBRTC_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WEBRTC_ERROR_INVALID_OPERATION Invalid operation
* @retval #WEBRTC_ERROR_INVALID_STATE Invalid state
- * @pre @a webrtc state must be set to #WEBRTC_STATE_NEGOTIATING.
+ * @pre @a webrtc state must be set to #WEBRTC_STATE_NEGOTIATING or WEBRTC_STATE_PLAYING.
* @pre The remote SDP offer must be set by calling webrtc_set_remote_description().
* @pre The signaling state must be set to #WEBRTC_SIGNALING_STATE_HAVE_REMOTE_OFFER.
* @post @a answer must be set as a local description by calling webrtc_set_local_description()
* @brief Creates SDP offer asynchronously to start a new WebRTC connection to a remote peer.
* @since_tizen 6.5
* @remarks The registered callback will be invoked in the main thread.\n
- * The @a options currently has no effect.
+ * The @a options currently has no effect.\n
+ * This function can be called in the state of #WEBRTC_STATE_PLAYING. (Since 9.0)
* @param[in] webrtc WebRTC handle
* @param[in] options Configuration options for the offer (optional, this can be NULL)
* @param[in] callback Callback function pointer
* @retval #WEBRTC_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WEBRTC_ERROR_INVALID_OPERATION Invalid operation
* @retval #WEBRTC_ERROR_INVALID_STATE Invalid state
- * @pre @a webrtc state must be set to #WEBRTC_STATE_NEGOTIATING.
+ * @pre @a webrtc state must be set to #WEBRTC_STATE_NEGOTIATING or WEBRTC_STATE_PLAYING.
* @post webrtc_session_description_created_cb() will be invoked.
* @see webrtc_state_changed_cb()
* @see webrtc_negotiation_needed_cb()
* @brief Creates SDP answer asynchronously to an offer received from a remote peer during the negotiation of a WebRTC connection.
* @since_tizen 6.5
* @remarks The registered callback will be invoked in the main thread.\n
- * The @a options currently has no effect.
+ * The @a options currently has no effect.\n
+ * This function can be called in the state of #WEBRTC_STATE_PLAYING. (Since 9.0)
* @param[in] webrtc WebRTC handle
* @param[in] options Configuration options for the answer (optional, this can be NULL)
* @param[in] callback Callback function pointer
* @retval #WEBRTC_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WEBRTC_ERROR_INVALID_OPERATION Invalid operation
* @retval #WEBRTC_ERROR_INVALID_STATE Invalid state
- * @pre @a webrtc state must be set to #WEBRTC_STATE_NEGOTIATING.
+ * @pre @a webrtc state must be set to #WEBRTC_STATE_NEGOTIATING or WEBRTC_STATE_PLAYING.
* @pre The remote SDP offer must be set by calling webrtc_set_remote_description().
* @pre The signaling state must be set to #WEBRTC_SIGNALING_STATE_HAVE_REMOTE_OFFER.
* @post webrtc_session_description_created_cb() will be invoked.
* @brief Sets the session description for a local peer associated with a WebRTC connection.
* @since_tizen 6.5
* @remarks @a description is a JSON string.\n
- * It will be {"sdp":{"type":"offer or answer","sdp":"..."}}.
+ * It will be {"sdp":{"type":"offer or answer","sdp":"..."}}.\n
+ * This function can be called in the state of #WEBRTC_STATE_PLAYING. (Since 9.0)
* @param[in] webrtc WebRTC handle
* @param[in] description The local session description
* @return @c 0 on success,
* @retval #WEBRTC_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WEBRTC_ERROR_INVALID_OPERATION Invalid operation
* @retval #WEBRTC_ERROR_INVALID_STATE Invalid state
- * @pre @a webrtc state must be set to #WEBRTC_STATE_NEGOTIATING.
+ * @pre @a webrtc state must be set to #WEBRTC_STATE_NEGOTIATING or WEBRTC_STATE_PLAYING.
* @see webrtc_create_offer()
* @see webrtc_create_offer_async()
* @see webrtc_create_answer()
* @since_tizen 6.5
* @remarks @a description is a JSON string.\n
* It should be {"sdp":{"type":"offer or answer","sdp":"..."}}.
+ * This function can be called in the state of #WEBRTC_STATE_PLAYING. (Since 9.0)
* @param[in] webrtc WebRTC handle
* @param[in] description The remote session description
* @return @c 0 on success,
* @retval #WEBRTC_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WEBRTC_ERROR_INVALID_OPERATION Invalid operation
* @retval #WEBRTC_ERROR_INVALID_STATE Invalid state
- * @pre @a webrtc state must be set to #WEBRTC_STATE_NEGOTIATING.
+ * @pre @a webrtc state must be set to #WEBRTC_STATE_NEGOTIATING or WEBRTC_STATE_PLAYING.
* @see webrtc_state_changed_cb()
* @see webrtc_set_signaling_state_change_cb()
* @see webrtc_get_signaling_state()
locker = g_mutex_locker_new(&_webrtc->mutex);
- RET_VAL_IF(_webrtc->state != WEBRTC_STATE_NEGOTIATING, WEBRTC_ERROR_INVALID_STATE, "the state should be NEGOTIATING");
+ RET_VAL_IF(_webrtc->state == WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, "the state should not be IDLE");
LOG_INFO("webrtc[%p] offer[%p]", webrtc, offer);
locker = g_mutex_locker_new(&_webrtc->mutex);
- RET_VAL_IF(_webrtc->state != WEBRTC_STATE_NEGOTIATING, WEBRTC_ERROR_INVALID_STATE, "the state should be NEGOTIATING");
+ RET_VAL_IF(_webrtc->state == WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, "the state should not be IDLE");
RET_VAL_IF(!_webrtcbin_have_remote_offer(_webrtc), WEBRTC_ERROR_INVALID_STATE, "remote offer should be set");
LOG_INFO("webrtc[%p] answer[%p]", webrtc, answer);
locker = g_mutex_locker_new(&_webrtc->mutex);
- RET_VAL_IF(_webrtc->state != WEBRTC_STATE_NEGOTIATING, WEBRTC_ERROR_INVALID_STATE, "the state should be NEGOTIATING");
+ RET_VAL_IF(_webrtc->state == WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, "the state should not be IDLE");
LOG_INFO("webrtc[%p] options[%p] callback[%p] user_data[%p]", webrtc, options, callback, user_data);
locker = g_mutex_locker_new(&_webrtc->mutex);
- RET_VAL_IF(_webrtc->state != WEBRTC_STATE_NEGOTIATING, WEBRTC_ERROR_INVALID_STATE, "the state should be NEGOTIATING");
+ RET_VAL_IF(_webrtc->state == WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, "the state should not be IDLE");
RET_VAL_IF(!_webrtcbin_have_remote_offer(_webrtc), WEBRTC_ERROR_INVALID_STATE, "remote offer should be set");
LOG_INFO("webrtc[%p] options[%p] callback[%p] user_data[%p]", webrtc, options, callback, user_data);
locker = g_mutex_locker_new(&_webrtc->mutex);
- RET_VAL_IF(_webrtc->state != WEBRTC_STATE_NEGOTIATING, WEBRTC_ERROR_INVALID_STATE, "the state should be NEGOTIATING");
+ RET_VAL_IF(_webrtc->state == WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, "the state should not be IDLE");
LOG_INFO("webrtc[%p] description: %s", webrtc, description);
locker = g_mutex_locker_new(&_webrtc->mutex);
- RET_VAL_IF(_webrtc->state != WEBRTC_STATE_NEGOTIATING, WEBRTC_ERROR_INVALID_STATE, "the state should be NEGOTIATING");
+ RET_VAL_IF(_webrtc->state == WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, "the state should not be IDLE");
LOG_INFO("webrtc[%p] description: %s", webrtc, description);