pidgin/pidgin

4577958c4c6a
Parents 6986f5428d30
Children 5ad29b5bf1c7
Add missing documentation for all of the media API

I had to guess on some of this, and I even noted it sometimes, but this makes
the doc check happy for now until we come back around and refactor this API.

Testing Done:
Ran the unit tests with the doc check. That's not include in this as this is already a lot of changes.

Reviewed at https://reviews.imfreedom.org/r/3044/
--- a/libpurple/media-gst.h Thu Mar 21 00:19:08 2024 -0500
+++ b/libpurple/media-gst.h Thu Mar 21 22:18:04 2024 -0500
@@ -47,6 +47,19 @@
PURPLE_AVAILABLE_TYPE_IN_2_6
typedef struct _PurpleMediaElementInfo PurpleMediaElementInfo;
+/**
+ * PurpleMediaElementCreateCallback:
+ * @info: The element.
+ * @media: The media.
+ * @session_id: The session id.
+ * @participant: The participant.
+ *
+ * A callback that creates a GstElement for the given parameters.
+ *
+ * Returns: (transfer full): The new element.
+ *
+ * Since: 2.6
+ */
PURPLE_AVAILABLE_TYPE_IN_2_6
typedef GstElement *(*PurpleMediaElementCreateCallback)(
PurpleMediaElementInfo *info, PurpleMedia *media,
@@ -73,6 +86,8 @@
* @PURPLE_MEDIA_ELEMENT_SINK: can be set as an active sink
* @PURPLE_MEDIA_ELEMENT_APPLICATION: supports application data
*
+ * The possible types of media elements.
+ *
* Since: 2.6
*/
PURPLE_AVAILABLE_TYPE_IN_2_6
@@ -157,6 +172,8 @@
* @session_id: The id of the session this element is requested for or NULL.
* @participant: The remote user this element is requested for or NULL.
*
+ * Gets the media element for the given session.
+ *
* Returns: (transfer full): A GStreamer source or sink for audio or video.
*
* Since: 2.6
@@ -171,6 +188,8 @@
* @manager: The media manager to use to obtain the element infos.
* @type: The type of element infos to get.
*
+ * Enumerates the elements in @manager filtered by @type.
+ *
* Returns: (transfer container) (element-type PurpleMediaElementInfo): A #GList of registered #PurpleMediaElementInfo instances that match
* @type.
*
@@ -184,6 +203,8 @@
* @manager: The #PurpleMediaManager instance
* @name: The name of the element to get.
*
+ * Gets the element info for the element named @name in @manager.
+ *
* Returns: (transfer full): The #PurpleMediaElementInfo for @name or NULL.
*
* Since: 2.6
@@ -192,14 +213,47 @@
PurpleMediaElementInfo *purple_media_manager_get_element_info(
PurpleMediaManager *manager, const gchar *name);
+/**
+ * purple_media_manager_register_element:
+ * @manager: The instance.
+ * @info: THe new element to register.
+ *
+ * Registers @info with @manager.
+ *
+ * Returns: %TRUE if successful, otherwise %FALSE.
+ *
+ * Since: 2.6
+ */
PURPLE_AVAILABLE_IN_2_6
gboolean purple_media_manager_register_element(PurpleMediaManager *manager,
PurpleMediaElementInfo *info);
+/**
+ * purple_media_manager_unregister_element:
+ * @manager: The instance.
+ * @name: The name of the element to unregister.
+ *
+ * Unregisters the elemented named @name from @manager.
+ *
+ * Returns: %TRUE if the element was found and removed, otherwise %FALSE.
+ *
+ * Since: 2.6
+ */
PURPLE_AVAILABLE_IN_2_6
gboolean purple_media_manager_unregister_element(PurpleMediaManager *manager,
const gchar *name);
+/**
+ * purple_media_manager_set_active_element:
+ * @manager: The instance.
+ * @info: The new element to activate.
+ *
+ * Attempts to activate @info as the active element.
+ *
+ * Returns: %TRUE if successful, otherwise %FALSE.
+ *
+ * Since: 2.6
+ */
PURPLE_AVAILABLE_IN_2_6
gboolean purple_media_manager_set_active_element(PurpleMediaManager *manager,
PurpleMediaElementInfo *info);
@@ -209,6 +263,8 @@
* @manager: The #PurpleMediaManager instance
* @type: The #PurpleMediaElementType who's info to get
*
+ * Gets the element that is currently active.
+ *
* Returns: (transfer none): The #PurpleMediaElementInfo for @type.
*
* Since: 2.6
@@ -246,12 +302,42 @@
PURPLE_AVAILABLE_IN_2_8
GstCaps *purple_media_manager_get_video_caps(PurpleMediaManager *manager);
+/**
+ * purple_media_element_info_get_id:
+ * @info: The instance.
+ *
+ * Gets the identifier from @info.
+ *
+ * Returns: The identifier.
+ *
+ * Since: 2.6
+ */
PURPLE_AVAILABLE_IN_2_6
gchar *purple_media_element_info_get_id(PurpleMediaElementInfo *info);
+/**
+ * purple_media_element_info_get_name:
+ * @info: The instance.
+ *
+ * Gets the name of @info.
+ *
+ * Returns: The name of @info.
+ *
+ * Since: 2.6
+ */
PURPLE_AVAILABLE_IN_2_6
gchar *purple_media_element_info_get_name(PurpleMediaElementInfo *info);
+/**
+ * purple_media_element_info_get_element_type:
+ * @info: The instance.
+ *
+ * Gets the element type of @info.
+ *
+ * Returns: The element type.
+ *
+ * Since: 2.6
+ */
PURPLE_AVAILABLE_IN_2_6
PurpleMediaElementType purple_media_element_info_get_element_type(
PurpleMediaElementInfo *info);
@@ -259,9 +345,11 @@
/**
* purple_media_element_info_call_create:
* @info: The #PurpleMediaElementInfo to create the element from
- * @media:
- * @session_id:
- * @participant:
+ * @media: The media instance.
+ * @session_id: The session id.
+ * @participant: The participant.
+ *
+ * Creates a new call.
*
* Returns: (transfer full): The new GstElement.
*
--- a/libpurple/media.c Thu Mar 21 00:19:08 2024 -0500
+++ b/libpurple/media.c Thu Mar 21 22:18:04 2024 -0500
@@ -128,6 +128,11 @@
gobject_class->set_property = purple_media_set_property;
gobject_class->get_property = purple_media_get_property;
+ /**
+ * PurpleMedia:manager:
+ *
+ * The manager that this media is tied to.
+ */
g_object_class_install_property(gobject_class, PROP_MANAGER,
g_param_spec_object("manager",
"Purple Media Manager",
@@ -136,6 +141,11 @@
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMedia:backend:
+ *
+ * The backend for this media.
+ */
/*
* This one should be PURPLE_TYPE_MEDIA_BACKEND, but it doesn't
* like interfaces because they "aren't GObjects"
@@ -147,6 +157,11 @@
G_TYPE_OBJECT,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMedia:account:
+ *
+ * The [class@Account] that this media belongs to.
+ */
g_object_class_install_property(gobject_class, PROP_ACCOUNT,
g_param_spec_object("account", "PurpleAccount",
"The account this media session is on.",
@@ -154,6 +169,11 @@
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMedia:conference-type:
+ *
+ * The conference type of this media.
+ */
g_object_class_install_property(gobject_class, PROP_CONFERENCE_TYPE,
g_param_spec_string("conference-type",
"Conference Type",
@@ -163,6 +183,11 @@
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMedia:initiator:
+ *
+ * Whether or not the local user initiated the conference.
+ */
g_object_class_install_property(gobject_class, PROP_INITIATOR,
g_param_spec_boolean("initiator",
"initiator",
@@ -171,44 +196,126 @@
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMedia:protocol-data:
+ *
+ * Protocol specific data for the media.
+ */
g_object_class_install_property(gobject_class, PROP_PROTOCOL_DATA,
g_param_spec_pointer("protocol-data",
"gpointer",
"Data the protocol set on the media session.",
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMedia::error:
+ * @media: The instance.
+ * @message: The error message.
+ *
+ * Emitted by [method@Media.error].
+ */
signals[SIG_ERROR] = g_signal_new("error", G_TYPE_FROM_CLASS(klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 1, G_TYPE_STRING);
+
+ /**
+ * PurpleMedia::candidates-prepared:
+ * @media: The instance.
+ * @session_id: The session id.
+ * @name: The candidate element name.
+ *
+ * Emitted when a candidate element has been determined.
+ */
signals[SIG_CANDIDATES_PREPARED] = g_signal_new("candidates-prepared",
G_TYPE_FROM_CLASS(klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 2, G_TYPE_STRING,
G_TYPE_STRING);
+
+ /**
+ * PurpleMedia::codecs-changed:
+ * @media: The instance.
+ * @session_id: The session id.
+ *
+ * Emitted when the codecs have changed.
+ */
signals[SIG_CODECS_CHANGED] = g_signal_new("codecs-changed",
G_TYPE_FROM_CLASS(klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 1, G_TYPE_STRING);
+
+ /**
+ * PurpleMedia::level:
+ * @media: The instance.
+ * @session_id: The session.
+ * @participant: The participant.
+ * @level: The new level.
+ *
+ * Emitted when the volume of a participant has changed. I think?
+ */
signals[SIG_LEVEL] = g_signal_new("level",
G_TYPE_FROM_CLASS(klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 3, G_TYPE_STRING,
G_TYPE_STRING, G_TYPE_DOUBLE);
+
+
+ /**
+ * PurpleMedia::new-candidate:
+ * @media: The instance.
+ * @session_id: The session id.
+ * @participant: The participant.
+ * @candidate: The new candidate.
+ *
+ * Emitted when a new media candidate is available.
+ */
signals[SIG_NEW_CANDIDATE] = g_signal_new("new-candidate",
G_TYPE_FROM_CLASS(klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 3, G_TYPE_POINTER,
G_TYPE_POINTER, PURPLE_MEDIA_TYPE_CANDIDATE);
+
+ /**
+ * PurpleMedia::state-changed:
+ * @media: The instance.
+ * @newstate: The new state.
+ * @session_id: The session id.
+ * @participant: The participant.
+ *
+ * Emitted when the media's state has changed.
+ */
signals[SIG_STATE_CHANGED] = g_signal_new("state-changed",
G_TYPE_FROM_CLASS(klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 3, PURPLE_MEDIA_TYPE_STATE,
G_TYPE_STRING, G_TYPE_STRING);
+
+ /**
+ * PurpleMedia::stream-info:
+ * @media: The instance.
+ * @type: The type of the media.
+ * @session_id: The session id.
+ * @participant: The participant.
+ * @local: Whether this request originated from the libpurple user.
+ *
+ * Emitted when information about the stream is available.
+ */
signals[SIG_STREAM_INFO] = g_signal_new("stream-info",
G_TYPE_FROM_CLASS(klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 4, PURPLE_MEDIA_TYPE_INFO_TYPE,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
+
+ /**
+ * PurpleMedia::candidate-pair-established:
+ * @media: The instance.
+ * @session_id: The session id.
+ * @name: The element name.
+ * @local_candidate: The local candidate.
+ * @remote_candidate: The remote candidate.
+ *
+ * Emitted when candidates have been established for a session.
+ */
signals[SIG_CANDIDATE_PAIR_ESTABLISHED] = g_signal_new("candidate-pair-established",
G_TYPE_FROM_CLASS(klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,
--- a/libpurple/media.h Thu Mar 21 00:19:08 2024 -0500
+++ b/libpurple/media.h Thu Mar 21 22:18:04 2024 -0500
@@ -441,6 +441,8 @@
*
* Sets the encryption parameters of our media in the session.
*
+ * Returns: %TRUE if the encryption parameters were set successfully.
+ *
* Since: 2.11
*/
PURPLE_AVAILABLE_IN_2_11
@@ -462,6 +464,8 @@
*
* Sets the decryption parameters for a session participant's media.
*
+ * Returns: %TRUE if the decryption parameters were set successfully.
+ *
* Since: 2.11
*/
PURPLE_AVAILABLE_IN_2_11
@@ -479,6 +483,8 @@
*
* Sets whether a session participant's media requires encryption.
*
+ * Returns: %TRUE if the encryption requirement was set successfully.
+ *
* Since: 2.14
*/
PURPLE_AVAILABLE_IN_2_14
--- a/libpurple/media/backend-iface.c Thu Mar 21 00:19:08 2024 -0500
+++ b/libpurple/media/backend-iface.c Thu Mar 21 22:18:04 2024 -0500
@@ -42,6 +42,11 @@
return;
}
+ /**
+ * PurpleMediaBackend:conference-type:
+ *
+ * The type of the conference.
+ */
g_object_interface_install_property(iface,
g_param_spec_string("conference-type",
"Conference Type",
@@ -50,6 +55,12 @@
NULL,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+
+ /**
+ * PurpleMediaBackend:media:
+ *
+ * The media object that this back end is bound to.
+ */
g_object_interface_install_property(iface,
g_param_spec_object(
"media", "Purple Media",
@@ -57,24 +68,70 @@
PURPLE_TYPE_MEDIA,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+
+ /**
+ * PurpleMediaBackend::error:
+ * @backend: The backend instance.
+ * @message: The error message.
+ *
+ * Emitted when the backend has encountered an error.
+ */
signals[SIG_ERROR] = g_signal_new("error",
G_TYPE_FROM_CLASS(iface),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 1, G_TYPE_STRING);
+
+ /**
+ * PurpleMediaBackend::candidates-prepared:
+ * @backend: The backend instance.
+ * @session_id: The session id.
+ * @name: The name.
+ *
+ * Emitted when the candidates have been prepared.
+ */
signals[SIG_CANDIDATES_PREPARED] = g_signal_new("candidates-prepared",
G_TYPE_FROM_CLASS(iface),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 2, G_TYPE_STRING,
G_TYPE_STRING);
+
+ /**
+ * PurpleMediaBackend::codecs-changed:
+ * @backend: The backend instance.
+ * @session_id: The session id.
+ *
+ * Emitted when the codecs have changed.
+ */
signals[SIG_CODECS_CHANGED] = g_signal_new("codecs-changed",
G_TYPE_FROM_CLASS(iface),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 1, G_TYPE_STRING);
+
+ /**
+ * PurpleMediaBackend::new-candidate:
+ * @backend: The backend instance.
+ * @session_id: The session id.
+ * @participant: The participant.
+ * @candidate: The new candidate.
+ *
+ * Emitted when a new media candidate is available.
+ */
signals[SIG_NEW_CANDIDATE] = g_signal_new("new-candidate",
G_TYPE_FROM_CLASS(iface),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 3, G_TYPE_POINTER,
G_TYPE_POINTER, PURPLE_MEDIA_TYPE_CANDIDATE);
+
+ /**
+ * PurpleMediaBackend::active-candidate-pair:
+ * @backend: The backend instance.
+ * @session_id: The session id.
+ * @participant: The participant.
+ * @candidate1: The first candidate.
+ * @candidate2: The second candidate.
+ *
+ * This is currently not emitted any, so I'd be guessing...
+ */
signals[SIG_ACTIVE_CANDIDATE_PAIR] = g_signal_new("active-candidate-pair",
G_TYPE_FROM_CLASS(iface),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,
--- a/libpurple/media/backend-iface.h Thu Mar 21 00:19:08 2024 -0500
+++ b/libpurple/media/backend-iface.h Thu Mar 21 22:18:04 2024 -0500
@@ -253,6 +253,8 @@
*
* Sets the encryption parameters of our media in the session.
*
+ * Returns: %TRUE if the settings were successfully applied, otherwise %FALSE.
+ *
* Since: 2.11
*/
PURPLE_AVAILABLE_IN_2_11
@@ -274,6 +276,8 @@
*
* Sets the decryption parameters for a session participant's media.
*
+ * Returns: %TRUE if the change was successful.
+ *
* Since: 2.11
*/
PURPLE_AVAILABLE_IN_2_11
@@ -291,6 +295,8 @@
*
* Sets whether a session participant's media requires encryption.
*
+ * Returns: %TRUE if the change was successful.
+ *
* Since: 2.14
*/
PURPLE_AVAILABLE_IN_2_14
--- a/libpurple/media/candidate.c Thu Mar 21 00:19:08 2024 -0500
+++ b/libpurple/media/candidate.c Thu Mar 21 22:18:04 2024 -0500
@@ -223,6 +223,11 @@
gobject_class->set_property = purple_media_candidate_set_property;
gobject_class->get_property = purple_media_candidate_get_property;
+ /**
+ * PurpleMediaCandidate:foundation:
+ *
+ * The foundation of the candidate.
+ */
g_object_class_install_property(gobject_class, PROP_FOUNDATION,
g_param_spec_string("foundation",
"Foundation",
@@ -230,6 +235,11 @@
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMediaCandidate:component-id:
+ *
+ * The component id of the candidate.
+ */
g_object_class_install_property(gobject_class, PROP_COMPONENT_ID,
g_param_spec_uint("component-id",
"Component ID",
@@ -237,6 +247,11 @@
0, G_MAXUINT, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMediaCandidate:ip:
+ *
+ * The IP address of the candidate.
+ */
g_object_class_install_property(gobject_class, PROP_IP,
g_param_spec_string("ip",
"IP Address",
@@ -244,6 +259,11 @@
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMediaCandidate:port:
+ *
+ * The port of the candidate.
+ */
g_object_class_install_property(gobject_class, PROP_PORT,
g_param_spec_uint("port",
"Port",
@@ -251,6 +271,11 @@
0, G_MAXUINT16, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMediaCandidate:base-ip:
+ *
+ * The internal IP address of the candidate.
+ */
g_object_class_install_property(gobject_class, PROP_BASE_IP,
g_param_spec_string("base-ip",
"Base IP",
@@ -258,6 +283,11 @@
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMediaCandidate:base-port:
+ *
+ * The internal port of the candidate.
+ */
g_object_class_install_property(gobject_class, PROP_BASE_PORT,
g_param_spec_uint("base-port",
"Base Port",
@@ -265,6 +295,11 @@
0, G_MAXUINT16, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMediaCandidate:protocol:
+ *
+ * The protocol of the candidate.
+ */
g_object_class_install_property(gobject_class, PROP_PROTOCOL,
g_param_spec_enum("protocol",
"Protocol",
@@ -273,6 +308,11 @@
PURPLE_MEDIA_NETWORK_PROTOCOL_UDP,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMediaCandidate:priority:
+ *
+ * The priority of the candidate.
+ */
g_object_class_install_property(gobject_class, PROP_PRIORITY,
g_param_spec_uint("priority",
"Priority",
@@ -280,6 +320,11 @@
0, G_MAXUINT32, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMediaCandidate:type:
+ *
+ * The type of the candidate.
+ */
g_object_class_install_property(gobject_class, PROP_TYPE,
g_param_spec_enum("type",
"Type",
@@ -288,6 +333,11 @@
PURPLE_MEDIA_CANDIDATE_TYPE_HOST,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMediaCandidate:username:
+ *
+ * The username used to connect to the candidate.
+ */
g_object_class_install_property(gobject_class, PROP_USERNAME,
g_param_spec_string("username",
"Username",
@@ -295,6 +345,11 @@
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMediaCandidate:password:
+ *
+ * The password used to connect to the candidate.
+ */
g_object_class_install_property(gobject_class, PROP_PASSWORD,
g_param_spec_string("password",
"Password",
@@ -302,6 +357,11 @@
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMediaCandidate:ttl:
+ *
+ * The TTL of the candidate.
+ */
g_object_class_install_property(gobject_class, PROP_TTL,
g_param_spec_uint("ttl",
"TTL",
--- a/libpurple/media/codec.c Thu Mar 21 00:19:08 2024 -0500
+++ b/libpurple/media/codec.c Thu Mar 21 22:18:04 2024 -0500
@@ -156,6 +156,11 @@
gobject_class->set_property = purple_media_codec_set_property;
gobject_class->get_property = purple_media_codec_get_property;
+ /**
+ * PurpleMediaCodec:id:
+ *
+ * The numeric identifier of the codec.
+ */
properties[PROP_ID] = g_param_spec_uint("id",
"ID",
"The numeric identifier of the codec.",
@@ -163,6 +168,11 @@
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
+ /**
+ * PurpleMediaCodec:encoding-name:
+ *
+ * The name of the codec.
+ */
properties[PROP_ENCODING_NAME] = g_param_spec_string("encoding-name",
"Encoding Name",
"The name of the codec.",
@@ -170,6 +180,11 @@
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
+ /**
+ * PurpleMediaCodec:media-type:
+ *
+ * Whether this is an audio, video, or application codec.
+ */
properties[PROP_MEDIA_TYPE] = g_param_spec_flags("media-type",
"Media Type",
"Whether this is an audio, video or application codec.",
@@ -178,18 +193,33 @@
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
+ /**
+ * PurpleMediaCodec:clock-rate:
+ *
+ * The clock rate for the codec.
+ */
properties[PROP_CLOCK_RATE] = g_param_spec_uint("clock-rate",
"Create Callback",
"The function called to create this element.",
0, G_MAXUINT, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ /**
+ * PurpleMediaCodec:channels:
+ *
+ * The number of channels in the codec.
+ */
properties[PROP_CHANNELS] = g_param_spec_uint("channels",
"Channels",
"The number of channels in this codec.",
0, G_MAXUINT, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ /**
+ * PurpleMediaCodec:optional-params:
+ *
+ * A list of optional parameters for the codec.
+ */
properties[PROP_OPTIONAL_PARAMS] = g_param_spec_pointer("optional-params",
"Optional Params",
"A list of optional parameters for the codec.",
--- a/libpurple/mediamanager.c Thu Mar 21 00:19:08 2024 -0500
+++ b/libpurple/mediamanager.c Thu Mar 21 22:18:04 2024 -0500
@@ -134,6 +134,17 @@
gobject_class->finalize = purple_media_manager_finalize;
+ /**
+ * PurpleMediaManager::init-media:
+ * @manager: The instance.
+ * @media: The media.
+ * @account: The account.
+ * @remote_user: The remote user.
+ *
+ * Emitted to initialize @media.
+ *
+ * Returns: %TRUE if @media was initialized.
+ */
signals[SIG_INIT_MEDIA] = g_signal_new("init-media",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
@@ -141,6 +152,17 @@
G_TYPE_BOOLEAN, 3, PURPLE_TYPE_MEDIA,
G_TYPE_POINTER, G_TYPE_STRING);
+ /**
+ * PurpleMediaManager::init-private-media:
+ * @manager: The instance.
+ * @media: The media.
+ * @account: The account.
+ * @remote_user: The remote user.
+ *
+ * Emitted to initialize @media but not tell the user interface about it.
+ *
+ * Returns: %TRUE if @media was initialized.
+ */
signals[SIG_INIT_PRIVATE_MEDIA] = g_signal_new("init-private-media",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
@@ -148,6 +170,14 @@
G_TYPE_BOOLEAN, 3, PURPLE_TYPE_MEDIA,
G_TYPE_POINTER, G_TYPE_STRING);
+ /**
+ * PurpleMediaManager::ui-caps-changed:
+ * @manager: The instance.
+ * @new_caps: The new capabilities.
+ * @old_caps: The old capabilities.
+ *
+ * Emitted when the user interface capabilities have changed.
+ */
signals[SIG_UI_CAPS_CHANGED] = g_signal_new("ui-caps-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
@@ -155,6 +185,12 @@
G_TYPE_NONE, 2, PURPLE_MEDIA_TYPE_CAPS,
PURPLE_MEDIA_TYPE_CAPS);
+ /**
+ * PurpleMediaManager::elements-changed:
+ * @manager: The instance.
+ *
+ * Emitted when the elements have changed in @manager.
+ */
signals[SIG_ELEMENTS_CHANGED] = g_signal_new("elements-changed",
G_TYPE_FROM_CLASS(klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
@@ -2339,6 +2375,11 @@
gobject_class->set_property = purple_media_element_info_set_property;
gobject_class->get_property = purple_media_element_info_get_property;
+ /**
+ * PurpleMediaElementInfo:id:
+ *
+ * The identifier for the element info.
+ */
g_object_class_install_property(gobject_class, PROP_ID,
g_param_spec_string("id",
"ID",
@@ -2347,6 +2388,11 @@
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMediaElementInfo:name:
+ *
+ * The name of the element info.
+ */
g_object_class_install_property(gobject_class, PROP_NAME,
g_param_spec_string("name",
"Name",
@@ -2355,6 +2401,11 @@
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMediaElementInfo:type:
+ *
+ * The type of the element.
+ */
g_object_class_install_property(gobject_class, PROP_TYPE,
g_param_spec_flags("type",
"Element Type",
@@ -2364,6 +2415,11 @@
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * PurpleMediaElementInfo:create-cb:
+ *
+ * A call back that is called when the element is created.
+ */
g_object_class_install_property(gobject_class, PROP_CREATE_CB,
g_param_spec_pointer("create-cb",
"Create Callback",
--- a/libpurple/mediamanager.h Thu Mar 21 00:19:08 2024 -0500
+++ b/libpurple/mediamanager.h Thu Mar 21 22:18:04 2024 -0500
@@ -45,16 +45,6 @@
*
* Since: 2.6
*/
-struct _PurpleMediaManagerClass
-{
- GObjectClass parent_class;
-
- /*< private >*/
- void (*purple_reserved1)(void);
- void (*purple_reserved2)(void);
- void (*purple_reserved3)(void);
- void (*purple_reserved4)(void);
-};
/**
* PurpleMediaAppDataCallbacks: