extern "C" {
#endif /* __cplusplus */
-#ifndef TIZEN_ERROR_MEDIA_WEBRTC
-#define TIZEN_ERROR_MEDIA_WEBRTC -0x03000000
-#endif
-
/**
* @file webrtc.h
* @brief This file contains the WebRTC API.
* #WEBRTC_ERROR_RESOURCE_FAILED\n
* #WEBRTC_ERROR_RESOURCE_CONFLICT
* @since_tizen 6.5
- * @remarks The @a webrtc is the same object for which the callback was set.\nThe @a webrtc should not be released.
+ * @remarks The @a webrtc is the same object for which the callback was set.\n
+ * The @a webrtc should not be released.
* @param[in] webrtc WebRTC handle
* @param[in] error The error code
* @param[in] state The current state of the WebRTC handle
/**
* @brief Called when the WebRTC state is changed.
* @since_tizen 6.5
- * @remarks The @a webrtc is the same object for which the callback was set.\nThe @a webrtc should not be released.
+ * @remarks The @a webrtc is the same object for which the callback was set.\n
+ * The @a webrtc should not be released.
* @param[in] webrtc WebRTC handle
* @param[in] previous The previous state of the WebRTC handle
* @param[in] current The current state of the WebRTC handle
/**
* @brief Called when the WebRTC peer connection state is changed.
* @since_tizen 6.5
- * @remarks The @a webrtc is the same object for which the callback was set.\nThe @a webrtc should not be released.
+ * @remarks The @a webrtc is the same object for which the callback was set.\n
+ * The @a webrtc should not be released.
* @param[in] webrtc WebRTC handle
* @param[in] state The peer connection state
* @param[in] user_data The user data passed from the callback registration function
/**
* @brief Called when the WebRTC signaling state is changed.
* @since_tizen 6.5
- * @remarks The @a webrtc is the same object for which the callback was set.\nThe @a webrtc should not be released.
+ * @remarks The @a webrtc is the same object for which the callback was set.\n
+ * The @a webrtc should not be released.
* @param[in] webrtc WebRTC handle
* @param[in] state The signaling state
* @param[in] user_data The user data passed from the callback registration function
/**
* @brief Called when the WebRTC ICE gathering state is changed.
* @since_tizen 6.5
- * @remarks The @a webrtc is the same object for which the callback was set.\nThe @a webrtc should not be released.
+ * @remarks The @a webrtc is the same object for which the callback was set.\n
+ * The @a webrtc should not be released.
* @param[in] webrtc WebRTC handle
* @param[in] state The ICE gathering state
* @param[in] user_data The user data passed from the callback registration function
/**
* @brief Called when the WebRTC ICE connection state is changed.
* @since_tizen 6.5
- * @remarks The @a webrtc is the same object for which the callback was set.\nThe @a webrtc should not be released.
+ * @remarks The @a webrtc is the same object for which the callback was set.\n
+ * The @a webrtc should not be released.
* @param[in] webrtc WebRTC handle
* @param[in] state The ICE connection state
* @param[in] user_data The user data passed from the callback registration function
/**
* @brief Called when the WebRTC needs session negotiation.
* @since_tizen 6.5
- * @remarks The @a webrtc is the same object for which the callback was set.\nThe @a webrtc should not be released.
+ * @remarks The @a webrtc is the same object for which the callback was set.\n
+ * The @a webrtc should not be released.
* @param[in] webrtc WebRTC handle
* @param[in] user_data The user data passed from the callback registration function
* @see webrtc_set_negotiation_needed_cb()
/**
* @brief Called when the WebRTC needs to send the ICE candidate message to the remote peer through the signaling channel.
* @since_tizen 6.5
- * @remarks The @a webrtc is the same object for which the callback was set.\nThe @a webrtc should not be released.
+ * @remarks The @a webrtc is the same object for which the callback was set.\n
+ * The @a webrtc should not be released.
* @param[in] webrtc WebRTC handle
* @param[in] candidate The ICE candidate message
* @param[in] user_data The user data passed from the callback registration function
/**
* @brief Called when a new track has been added to the WebRTC pipeline after the negotiation.
* @since_tizen 6.5
- * @remarks The @a webrtc is the same object for which the callback was set.\nThe @a webrtc should not be released.
+ * @remarks The @a webrtc is the same object for which the callback was set.\n
+ * The @a webrtc should not be released.
* @param[in] webrtc WebRTC handle
* @param[in] type The media type
* @param[in] track_id The track id
/**
* @brief Called when each audio or video frame is ready to be rendered via the WebRTC pipeline after the negotiation.
* @since_tizen 6.5
- * @remarks The @a webrtc is the same object for which the callback was set.\nThe @a webrtc should not be released.\n
+ * @remarks The @a webrtc is the same object for which the callback was set.\n
+ * The @a webrtc should not be released.\n
* Use media_packet_get_buffer_data_ptr() with @a packet to get the Gstreamer buffer pointer.\n
* The @a packet should be released using media_packet_destroy().
* @param[in] webrtc WebRTC handle
/**
* @brief Called when the data channel is created to the connection by the remote peer.
* @since_tizen 6.5
- * @remarks The @a webrtc is the same object for which the callback was set.\nThe @a webrtc should not be released.\n
+ * @remarks The @a webrtc is the same object for which the callback was set.\n
+ * The @a webrtc should not be released.\n
* The @a channel should not be released.
* @param[in] webrtc WebRTC handle
* @param[in] channel WebRTC data channel handle
/**
* @brief Called when the data channel's underlying data transport is established.
* @since_tizen 6.5
- * @remarks The @a channel is the same object for which the callback was set.\nThe @a channel should not be released.
+ * @remarks The @a channel is the same object for which the callback was set.\n
+ * The @a channel should not be released.
* @param[in] channel WebRTC data channel handle
* @param[in] user_data The user data passed from the callback registration function
* @see webrtc_create_data_channel()
/**
* @brief Called when a message is received from other peer via the data channel.
* @since_tizen 6.5
- * @remarks The @a channel is the same object for which the callback was set.\nThe @a channel should not be released.\n
+ * @remarks The @a channel is the same object for which the callback was set.\n
+ * The @a channel should not be released.\n
* When @a type is #WEBRTC_DATA_CHANNEL_TYPE_STRING, @a message should be casted to char pointer.\n
* When @a type is #WEBRTC_DATA_CHANNEL_TYPE_BYTES, @a message should be casted to #webrtc_bytes_data_h.\n
- * In this case, webrtc_get_data() can be used to get the data and its size inside of this callback.
+ * In this case, webrtc_get_data() can be used to get the data and its size inside of this callback.\n
* The @a message should not be released.
* @param[in] channel WebRTC data channel handle
* @param[in] type The data type
* #WEBRTC_ERROR_STREAM_FAILED\n
* #WEBRTC_ERROR_RESOURCE_FAILED
* @since_tizen 6.5
- * @remarks The @a channel is the same object for which the callback was set.\nThe @a channel should not be released.
+ * @remarks The @a channel is the same object for which the callback was set.\n
+ * The @a channel should not be released.
* @param[in] channel WebRTC data channel handle
* @param[in] error The error code
* @param[in] user_data The user data passed from the callback registration function
/**
* @brief Called when the data channel has closed down.
* @since_tizen 6.5
- * @remarks The @a channel is the same object for which the callback was set.\nThe @a channel should not be released.
+ * @remarks The @a channel is the same object for which the callback was set.\n
+ * The @a channel should not be released.
* @param[in] channel WebRTC data channel handle
* @param[in] user_data The user data passed from the callback registration function
* @see webrtc_create_data_channel()
* @since_tizen 6.5
* @privlevel public
* @privilege %http://tizen.org/privilege/internet
- * @remarks You must release @a webrtc using webrtc_destroy().
+ * @remarks The @a webrtc should be released using webrtc_destroy().
* @param[out] webrtc WebRTC handle
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Sets a callback function to be invoked when the WebRTC state is changed.
* @since_tizen 6.5
+ * @remarks The registered callback will be invoked in the main thread.
* @param[in] webrtc WebRTC handle
* @param[in] callback Callback function pointer
* @param[in] user_data The user data to be passed to the callback function
* @see webrtc_unset_state_changed_cb()
* @see webrtc_state_changed_cb()
* @see webrtc_get_state()
+ * @see webrtc_create_offer()
*/
int webrtc_set_state_changed_cb(webrtc_h webrtc, webrtc_state_changed_cb callback, void *user_data);
* @param[in] webrtc WebRTC handle
* @param[in] source_id The media source id
* @param[in] media_type The media type
- * @param[in] muted Muted or not (@c true = muted, @c false = not muted)
+ * @param[in] mute Mute or not (@c true = mute, @c false = not mute)
* @return @c 0 on success,
* otherwise a negative error value
* @retval #WEBRTC_ERROR_NONE Successful
* @param[in] webrtc WebRTC handle
* @param[in] source_id The media source id
* @param[in] media_type The media type
- * @param[in] muted The current mute status: (@c true = mute, @c false = not muted)
+ * @param[out] muted Muted or not (@c true = muted, @c false = not muted)
* @return @c 0 on success,
* otherwise a negative error value
* @retval #WEBRTC_ERROR_NONE Successful
* @details If @a source_id is not a media source of #WEBRTC_MEDIA_SOURCE_TYPE_MIC, this function will return #WEBRTC_ERROR_INVALID_PARAMETER.
* @since_tizen 6.5
* @remarks You can set sound stream information including audio routing.\n
- * The following sound stream types can be used for the @a stream_info:\n
+ * The following sound stream types can be used for the @a stream_info :\n
* #SOUND_STREAM_TYPE_MEDIA\n
* #SOUND_STREAM_TYPE_VOICE_RECOGNITION\n
* #SOUND_STREAM_TYPE_VOIP\n
* @since_tizen 6.5
* @remarks Call this function within webrtc_track_added_cb(), otherwise #WEBRTC_ERROR_INVALID_OPERATION will be returned.\n
* If webrtc_set_encoded_audio_frame_cb() has been called, it will return #WEBRTC_ERROR_INVALID_OPERATION.\n
- * The following sound stream types can be used for the @a stream_info:\n
+ * The following sound stream types can be used for the @a stream_info :\n
* #SOUND_STREAM_TYPE_MEDIA\n
* #SOUND_STREAM_TYPE_VOIP\n
* #SOUND_STREAM_TYPE_MEDIA_EXTERNAL_ONLY
int webrtc_get_stun_server(webrtc_h webrtc, char **stun_server);
/**
- * @brief Add a TURN server URL.
+ * @brief Adds a TURN server URL.
* @since_tizen 6.5
* @param[in] webrtc WebRTC handle
* @param[in] turn_server The TURN server URL of the form turn(s)://username:password@host:port
/**
* @brief Sets a callback function to be invoked when the WebRTC peer connection state is changed.
* @since_tizen 6.5
+ * @remarks The registered callback will be invoked in an internal thread of the webrtc.
* @param[in] webrtc WebRTC handle
* @param[in] callback Callback function pointer
* @param[in] user_data The user data to be passed to the callback function
/**
* @brief Sets a callback function to be invoked when the WebRTC signaling state is changed.
* @since_tizen 6.5
+ * @remarks The registered callback will be invoked in an internal thread of the webrtc.
* @param[in] webrtc WebRTC handle
* @param[in] callback Callback function pointer
* @param[in] user_data The user data to be passed to the callback function
/**
* @brief Sets a callback function to be invoked when the WebRTC ICE gathering state is changed.
* @since_tizen 6.5
+ * @remarks The registered callback will be invoked in an internal thread of the webrtc.
* @param[in] webrtc WebRTC handle
* @param[in] callback Callback function pointer
* @param[in] user_data The user data to be passed to the callback function
/**
* @brief Sets a callback function to be invoked when the WebRTC ICE connection state is changed.
* @since_tizen 6.5
+ * @remarks The registered callback will be invoked in an internal thread of the webrtc.
* @param[in] webrtc WebRTC handle
* @param[in] callback Callback function pointer
* @param[in] user_data The user data to be passed to the callback function
/**
* @brief Sets a negotiation needed callback function to be invoked when a change has occurred which requires session negotiation.
* @since_tizen 6.5
+ * @remarks The registered callback will be invoked in an internal thread of the webrtc.
* @param[in] webrtc WebRTC handle
* @param[in] callback Callback function pointer
* @param[in] user_data The user data to be passed to the callback function
/**
* @brief Sets an ICE candidate callback function to be invoked when the WebRTC needs to send the ICE candidate message to the remote peer.
* @since_tizen 6.5
- * @remarks If all the ICE candidates have been gathered, ICE gathering state will be changed to #WEBRTC_ICE_GATHERING_STATE_COMPLETE.
+ * @remarks If all the ICE candidates have been gathered, ICE gathering state will be changed to #WEBRTC_ICE_GATHERING_STATE_COMPLETE.\n
+ * The registered callback will be invoked in an internal thread of the webrtc.
* @param[in] webrtc WebRTC handle
* @param[in] callback Callback function pointer
* @param[in] user_data The user data to be passed to the callback function
/**
* @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().
+ * @remarks The @a answer should be released using free().\n
* The @a options currently has no effect.
* @param[in] webrtc WebRTC handle
* @param[in] options Configuration options for the answer (optional, this can be NULL)
* @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.
+ * @see webrtc_state_changed_cb()
* @see webrtc_set_signaling_state_change_cb()
* @see webrtc_get_signaling_state()
*/
/**
* @brief Sets a track added callback function to be invoked when a new track has been added to the WebRTC.
* @since_tizen 6.5
+ * @remarks The registered callback will be invoked in an internal thread of the webrtc.
* @param[in] webrtc WebRTC handle
* @param[in] callback Callback function pointer
* @param[in] user_data The user data to be passed to the callback function
/**
* @brief Sets a data channel callback function to be invoked when the data channel is created to the connection by the remote peer.
* @since_tizen 6.5
+ * @remarks The registered callback will be invoked in an internal thread of the webrtc.
* @param[in] webrtc WebRTC handle
* @param[in] callback Callback function pointer
* @param[in] user_data The user data to be passed to the callback function
/**
* @brief Creates a new data channel which is linked with the remote peer.
* @since_tizen 6.5
- * @remarks The @a options dictionary is similar format as the RTCDataChannelInit members outlined https://www.w3.org/TR/webrtc/#dom-rtcdatachannelinit.\n
+ * @remarks The @a channel should be released using webrtc_destroy().\n
+ * The @a options dictionary is similar format as the RTCDataChannelInit members outlined https://www.w3.org/TR/webrtc/#dom-rtcdatachannelinit.\n
* The following attributes can be set to @a options by using #bundle API:\n
* 'ordered' of type bool : Whether the channel will send data with guaranteed ordering. The default value is true.\n
* 'max-packet-lifetime' of type int : The time in milliseconds to attempt transmitting unacknowledged data. -1 for unset. The default value is -1.\n
/**
* @brief Sets a data channel open callback function to be invoked when the data channel's underlying data transport is established.
* @since_tizen 6.5
+ * @remarks The registered callback will be invoked in an internal thread of the webrtc.
* @param[in] channel Data channel handle
* @param[in] callback Callback function pointer
* @param[in] user_data The user data to be passed to the callback function
/**
* @brief Sets a data channel message callback function to be invoked when a message is received from the remote peer.
* @since_tizen 6.5
+ * @remarks The registered callback will be invoked in an internal thread of the webrtc.
* @param[in] channel Data channel handle
* @param[in] callback Callback function pointer
* @param[in] user_data The user data to be passed to the callback function
/**
* @brief Sets a data channel error callback function to be invoked when an error occurs on the data channel.
* @since_tizen 6.5
+ * @remarks The registered callback will be invoked in an internal thread of the webrtc.
* @param[in] channel Data channel handle
* @param[in] callback Callback function pointer
* @param[in] user_data The user data to be passed to the callback function
/**
* @brief Sets a data channel close callback function to be invoked when the data channel has closed down.
* @since_tizen 6.5
+ * @remarks The registered callback will be invoked in an internal thread of the webrtc.
* @param[in] channel Data channel handle
* @param[in] callback Callback function pointer
* @param[in] user_data The user data to be passed to the callback function