webrtc: Add/fix various annotations

And mark string parameters as const.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>
This commit is contained in:
Sebastian Dröge 2022-10-14 21:51:17 +03:00 committed by GStreamer Marge Bot
parent 0c47735c4a
commit 64c376b5b2
6 changed files with 47 additions and 21 deletions

View file

@ -36,7 +36,7 @@ customice_agent_add_candidate (GstWebRTCICE * ice,
gboolean
customice_agent_set_remote_credentials (GstWebRTCICE * ice,
GstWebRTCICEStream * stream, gchar * ufrag, gchar * pwd)
GstWebRTCICEStream * stream, const gchar * ufrag, const gchar * pwd)
{
GstWebRTCICE *c_ice = GST_WEBRTC_ICE (CUSTOMICE_AGENT (ice)->nice_agent);
return gst_webrtc_ice_set_remote_credentials (c_ice, stream, ufrag, pwd);
@ -51,7 +51,7 @@ customice_agent_add_turn_server (GstWebRTCICE * ice, const gchar * uri)
gboolean
customice_agent_set_local_credentials (GstWebRTCICE * ice,
GstWebRTCICEStream * stream, gchar * ufrag, gchar * pwd)
GstWebRTCICEStream * stream, const gchar * ufrag, const gchar * pwd)
{
GstWebRTCICE *c_ice = GST_WEBRTC_ICE (CUSTOMICE_AGENT (ice)->nice_agent);
return gst_webrtc_ice_set_local_credentials (c_ice, stream, ufrag, pwd);

View file

@ -63,6 +63,7 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstWebRTCICE, gst_webrtc_ice,
* @session_id: The session id
*
* Returns: (transfer full) (nullable): The #GstWebRTCICEStream, or %NULL
*
* Since: 1.22
*/
GstWebRTCICEStream *
@ -81,6 +82,7 @@ gst_webrtc_ice_add_stream (GstWebRTCICE * ice, guint session_id)
* @component: The #GstWebRTCICEComponent
*
* Returns: (transfer full) (nullable): The #GstWebRTCICETransport, or %NULL
*
* Since: 1.22
*/
GstWebRTCICETransport *
@ -99,6 +101,7 @@ gst_webrtc_ice_find_transport (GstWebRTCICE * ice,
* @ice: The #GstWebRTCICE
* @stream: The #GstWebRTCICEStream
* @candidate: The ICE candidate
*
* Since: 1.22
*/
void
@ -117,12 +120,14 @@ gst_webrtc_ice_add_candidate (GstWebRTCICE * ice,
* @stream: The #GstWebRTCICEStream
* @ufrag: ICE username
* @pwd: ICE password
*
* Returns: FALSE on error, TRUE otherwise
*
* Since: 1.22
*/
gboolean
gst_webrtc_ice_set_remote_credentials (GstWebRTCICE * ice,
GstWebRTCICEStream * stream, gchar * ufrag, gchar * pwd)
GstWebRTCICEStream * stream, const gchar * ufrag, const gchar * pwd)
{
g_return_val_if_fail (GST_IS_WEBRTC_ICE (ice), FALSE);
g_assert (GST_WEBRTC_ICE_GET_CLASS (ice)->set_remote_credentials);
@ -135,7 +140,9 @@ gst_webrtc_ice_set_remote_credentials (GstWebRTCICE * ice,
* gst_webrtc_ice_add_turn_server:
* @ice: The #GstWebRTCICE
* @uri: URI of the TURN server
*
* Returns: FALSE on error, TRUE otherwise
*
* Since: 1.22
*/
gboolean
@ -153,12 +160,14 @@ gst_webrtc_ice_add_turn_server (GstWebRTCICE * ice, const gchar * uri)
* @stream: The #GstWebRTCICEStream
* @ufrag: ICE username
* @pwd: ICE password
*
* Returns: FALSE on error, TRUE otherwise
*
* Since: 1.22
*/
gboolean
gst_webrtc_ice_set_local_credentials (GstWebRTCICE * ice,
GstWebRTCICEStream * stream, gchar * ufrag, gchar * pwd)
GstWebRTCICEStream * stream, const gchar * ufrag, const gchar * pwd)
{
g_return_val_if_fail (GST_IS_WEBRTC_ICE (ice), FALSE);
g_assert (GST_WEBRTC_ICE_GET_CLASS (ice)->set_local_credentials);
@ -172,6 +181,7 @@ gst_webrtc_ice_set_local_credentials (GstWebRTCICE * ice,
* @ice: The #GstWebRTCICE
* @stream: The #GstWebRTCICEStream
* Returns: FALSE on error, TRUE otherwise
*
* Since: 1.22
*/
gboolean
@ -188,6 +198,7 @@ gst_webrtc_ice_gather_candidates (GstWebRTCICE * ice,
* gst_webrtc_ice_set_is_controller:
* @ice: The #GstWebRTCICE
* @controller: TRUE to set as controller
*
* Since: 1.22
*/
void
@ -203,6 +214,7 @@ gst_webrtc_ice_set_is_controller (GstWebRTCICE * ice, gboolean controller)
* gst_webrtc_ice_get_is_controller:
* @ice: The #GstWebRTCICE
* Returns: TRUE if set as controller, FALSE otherwise
*
* Since: 1.22
*/
gboolean
@ -218,6 +230,7 @@ gst_webrtc_ice_get_is_controller (GstWebRTCICE * ice)
* gst_webrtc_ice_set_force_relay:
* @ice: The #GstWebRTCICE
* @force_relay: TRUE to enable force relay
*
* Since: 1.22
*/
void
@ -234,6 +247,7 @@ gst_webrtc_ice_set_force_relay (GstWebRTCICE * ice, gboolean force_relay)
* @ice: The #GstWebRTCICE
* @stream: The #GstWebRTCICEStream
* @tos: ToS to be set
*
* Since: 1.22
*/
void
@ -252,6 +266,7 @@ gst_webrtc_ice_set_tos (GstWebRTCICE * ice, GstWebRTCICEStream * stream,
* @ice: The #GstWebRTCICE
* @stream: The #GstWebRTCICEStream
* Returns: (transfer full)(array zero-terminated=1): List of local candidates
*
* Since: 1.22
*/
GstWebRTCICECandidateStats **
@ -270,6 +285,7 @@ gst_webrtc_ice_get_local_candidates (GstWebRTCICE * ice,
* @ice: The #GstWebRTCICE
* @stream: The #GstWebRTCICEStream
* Returns: (transfer full) (array zero-terminated=1): List of remote candidates
*
* Since: 1.22
*/
GstWebRTCICECandidateStats **
@ -290,6 +306,7 @@ gst_webrtc_ice_get_remote_candidates (GstWebRTCICE * ice,
* @remote_stats: (out) (transfer full): pointer to #GstWebRTCICECandidateStats for remote candidate
*
* Returns: FALSE on failure, otherwise @local_stats @remote_stats will be set
*
* Since: 1.22
*/
gboolean
@ -309,6 +326,7 @@ gst_webrtc_ice_get_selected_pair (GstWebRTCICE * ice,
* @stats: The #GstWebRTCICECandidateStats to be free'd
*
* Helper function to free #GstWebRTCICECandidateStats
*
* Since: 1.22
*/
void
@ -327,6 +345,7 @@ gst_webrtc_ice_candidate_stats_free (GstWebRTCICECandidateStats * stats)
* @stats: The #GstWebRTCICE
*
* Returns: (transfer full): A copy of @stats
*
* Since: 1.22
*/
GstWebRTCICECandidateStats *
@ -353,6 +372,7 @@ G_DEFINE_BOXED_TYPE (GstWebRTCICECandidateStats, gst_webrtc_ice_candidate_stats,
* @func: The #GstWebRTCICEOnCandidateFunc callback function
* @user_data: User data passed to the callback function
* @notify: a #GDestroyNotify when the candidate is no longer needed
*
* Since: 1.22
*/
void
@ -369,7 +389,8 @@ gst_webrtc_ice_set_on_ice_candidate (GstWebRTCICE * ice,
/**
* gst_webrtc_ice_set_stun_server:
* @ice: The #GstWebRTCICE
* @uri: URI of the STUN server
* @uri: (nullable): URI of the STUN server
*
* Since: 1.22
*/
void
@ -384,7 +405,9 @@ gst_webrtc_ice_set_stun_server (GstWebRTCICE * ice, const gchar * uri_s)
/**
* gst_webrtc_ice_get_stun_server:
* @ice: The #GstWebRTCICE
* Returns: URI of the STUN sever
*
* Returns: (nullable): URI of the STUN sever
*
* Since: 1.22
*/
gchar *
@ -399,7 +422,8 @@ gst_webrtc_ice_get_stun_server (GstWebRTCICE * ice)
/**
* gst_webrtc_ice_set_turn_server:
* @ice: The #GstWebRTCICE
* @uri: URI of the TURN sever
* @uri: (nullable): URI of the TURN sever
*
* Since: 1.22
*/
void
@ -414,7 +438,9 @@ gst_webrtc_ice_set_turn_server (GstWebRTCICE * ice, const gchar * uri_s)
/**
* gst_webrtc_ice_get_turn_server:
* @ice: The #GstWebRTCICE
* Returns: URI of the TURN sever
*
* Returns: (nullable): URI of the TURN sever
*
* Since: 1.22
*/
gchar *

View file

@ -71,7 +71,7 @@ struct _GstWebRTCICECandidateStats
* Callback function to be triggered on discovery of a new candidate
* Since: 1.22
*/
typedef void (*GstWebRTCICEOnCandidateFunc) (GstWebRTCICE * ice, guint stream_id, gchar * candidate, gpointer user_data);
typedef void (*GstWebRTCICEOnCandidateFunc) (GstWebRTCICE * ice, guint stream_id, const gchar * candidate, gpointer user_data);
struct _GstWebRTCICEClass {
GstObjectClass parent_class;
@ -87,12 +87,12 @@ struct _GstWebRTCICEClass {
const gchar * candidate);
gboolean (*set_local_credentials) (GstWebRTCICE * ice,
GstWebRTCICEStream * stream,
gchar * ufrag,
gchar * pwd);
const gchar * ufrag,
const gchar * pwd);
gboolean (*set_remote_credentials) (GstWebRTCICE * ice,
GstWebRTCICEStream * stream,
gchar * ufrag,
gchar * pwd);
const gchar * ufrag,
const gchar * pwd);
gboolean (*add_turn_server) (GstWebRTCICE * ice,
const gchar * uri);
void (*set_is_controller) (GstWebRTCICE * ice,
@ -147,14 +147,14 @@ void gst_webrtc_ice_add_candidate (GstWebRTCIC
GST_WEBRTC_API
gboolean gst_webrtc_ice_set_local_credentials (GstWebRTCICE * ice,
GstWebRTCICEStream * stream,
gchar * ufrag,
gchar * pwd);
const gchar * ufrag,
const gchar * pwd);
GST_WEBRTC_API
gboolean gst_webrtc_ice_set_remote_credentials (GstWebRTCICE * ice,
GstWebRTCICEStream * stream,
gchar * ufrag,
gchar * pwd);
const gchar * ufrag,
const gchar * pwd);
GST_WEBRTC_API
gboolean gst_webrtc_ice_add_turn_server (GstWebRTCICE * ice,

View file

@ -96,7 +96,7 @@ gst_webrtc_ice_transport_selected_pair_change (GstWebRTCICETransport * ice)
void
gst_webrtc_ice_transport_new_candidate (GstWebRTCICETransport * ice,
guint stream_id, GstWebRTCICEComponent component, gchar * attr)
guint stream_id, GstWebRTCICEComponent component, const gchar * attr)
{
g_signal_emit (ice, gst_webrtc_ice_transport_signals[ON_NEW_CANDIDATE_SIGNAL],
stream_id, component, attr);

View file

@ -67,7 +67,7 @@ void gst_webrtc_ice_transport_gathering_state_change (GstWebRTCIC
GST_WEBRTC_API
void gst_webrtc_ice_transport_selected_pair_change (GstWebRTCICETransport * ice);
GST_WEBRTC_API
void gst_webrtc_ice_transport_new_candidate (GstWebRTCICETransport * ice, guint stream_id, GstWebRTCICEComponent component, gchar * attr);
void gst_webrtc_ice_transport_new_candidate (GstWebRTCICETransport * ice, guint stream_id, GstWebRTCICEComponent component, const gchar * attr);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstWebRTCICETransport, gst_object_unref)

View file

@ -913,7 +913,7 @@ gst_webrtc_nice_add_candidate (GstWebRTCICE * ice, GstWebRTCICEStream * stream,
static gboolean
gst_webrtc_nice_set_remote_credentials (GstWebRTCICE * ice,
GstWebRTCICEStream * stream, gchar * ufrag, gchar * pwd)
GstWebRTCICEStream * stream, const gchar * ufrag, const gchar * pwd)
{
struct NiceStreamItem *item;
GstWebRTCNice *nice = GST_WEBRTC_NICE (ice);
@ -975,7 +975,7 @@ gst_webrtc_nice_add_local_ip_address (GstWebRTCNice * ice,
static gboolean
gst_webrtc_nice_set_local_credentials (GstWebRTCICE * ice,
GstWebRTCICEStream * stream, gchar * ufrag, gchar * pwd)
GstWebRTCICEStream * stream, const gchar * ufrag, const gchar * pwd)
{
struct NiceStreamItem *item;
GstWebRTCNice *nice = GST_WEBRTC_NICE (ice);