all: Annotate *_set_property() contructor only props without free

Properties that are marked constructor only aren't required to be freed
before g_value_dup_string() as they can only be called once during construction.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8648>
This commit is contained in:
Doug Nazar 2025-03-14 19:14:43 -04:00 committed by GStreamer Marge Bot
parent ca04a4cd44
commit 5f90a4ae67
25 changed files with 28 additions and 0 deletions

View file

@ -444,6 +444,7 @@ ges_asset_set_property (GObject * object, guint property_id,
ges_extractable_register_metas (asset->priv->extractable_type, asset);
break;
case PROP_ID:
/* G_PARAM_CONSTRUCT_ONLY */
asset->priv->id = g_value_dup_string (value);
break;
case PROP_PROXY:

View file

@ -173,9 +173,11 @@ ges_effect_clip_set_property (GObject * object,
switch (property_id) {
case PROP_VIDEO_BIN_DESCRIPTION:
/* G_PARAM_CONSTRUCT_ONLY */
self->priv->video_bin_description = g_value_dup_string (value);
break;
case PROP_AUDIO_BIN_DESCRIPTION:
/* G_PARAM_CONSTRUCT_ONLY */
self->priv->audio_bin_description = g_value_dup_string (value);
break;
default:

View file

@ -172,6 +172,7 @@ ges_effect_set_property (GObject * object,
switch (property_id) {
case PROP_BIN_DESCRIPTION:
/* G_PARAM_CONSTRUCT_ONLY */
self->priv->bin_description = g_value_dup_string (value);
break;
default:

View file

@ -78,6 +78,7 @@ ges_image_source_set_property (GObject * object, guint property_id,
switch (property_id) {
case PROP_URI:
/* G_PARAM_CONSTRUCT_ONLY */
uriclip->uri = g_value_dup_string (value);
break;
default:

View file

@ -98,6 +98,7 @@ ges_multi_file_source_set_property (GObject * object, guint property_id,
switch (property_id) {
case PROP_URI:
/* G_PARAM_CONSTRUCT_ONLY */
uriclip->uri = g_value_dup_string (value);
break;
default:

View file

@ -513,6 +513,7 @@ _set_property (GESProject * project, guint property_id,
{
switch (property_id) {
case PROP_URI:
/* G_PARAM_CONSTRUCT_ONLY */
GES_PROJECT_LOCK (project);
project->priv->uri = g_value_dup_string (value);
GES_PROJECT_UNLOCK (project);

View file

@ -110,6 +110,7 @@ ges_uri_clip_set_property (GObject * object, guint property_id,
switch (property_id) {
case PROP_URI:
/* G_PARAM_CONSTRUCT_ONLY */
ges_uri_clip_set_uri (uriclip, g_value_dup_string (value));
break;
case PROP_MUTE:

View file

@ -414,6 +414,7 @@ gst_gtk_wayland_sink_set_property (GObject * object, guint prop_id,
FALSE);
break;
case PROP_DRM_DEVICE:
/* G_PARAM_CONSTRUCT_ONLY */
GST_OBJECT_LOCK (self);
priv->drm_device = g_value_dup_string (value);
GST_OBJECT_UNLOCK (self);

View file

@ -160,6 +160,7 @@ gst_media_source_track_set_property (GObject * object, guint prop_id,
self->track_type = g_value_get_enum (value);
break;
case PROP_TRACK_ID:
/* G_PARAM_CONSTRUCT_ONLY */
self->track_id = g_value_dup_string (value);
break;
case PROP_ACTIVE:

View file

@ -94,6 +94,7 @@ gst_va_display_drm_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_PATH:
/* G_PARAM_CONSTRUCT_ONLY */
self->path = g_value_dup_string (value);
break;
default:

View file

@ -272,9 +272,11 @@ gst_dshow_device_get_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_DEVICE:
/* G_PARAM_CONSTRUCT_ONLY */
g_value_set_string (value, device->device);
break;
case PROP_DEVICE_NAME:
/* G_PARAM_CONSTRUCT_ONLY */
g_value_set_string (value, device->device_name);
break;
case PROP_DEVICE_INDEX:

View file

@ -257,6 +257,7 @@ gst_directsound_device_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_DEVICE_GUID:
/* G_PARAM_CONSTRUCT_ONLY */
device->guid = g_value_dup_string (value);
break;
default:

View file

@ -130,6 +130,7 @@ gst_mf_device_get_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_DEVICE_PATH:
/* G_PARAM_CONSTRUCT_ONLY */
g_value_set_string (value, self->device_path);
break;
default:

View file

@ -94,6 +94,7 @@ gst_uvc_h264_device_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_DEVICE_PATH:
/* G_PARAM_CONSTRUCT_ONLY */
self->device_path = g_value_dup_string (value);
break;
default:

View file

@ -353,6 +353,7 @@ gst_wasapi_device_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_DEVICE_STRID:
/* G_PARAM_CONSTRUCT_ONLY */
device->strid = g_value_dup_string (value);
break;
default:

View file

@ -129,6 +129,7 @@ gst_wasapi2_device_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_DEVICE:
/* G_PARAM_CONSTRUCT_ONLY */
self->device_id = g_value_dup_string (value);
break;
default:

View file

@ -786,6 +786,7 @@ gst_ks_device_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_PATH:
/* G_PARAM_CONSTRUCT_ONLY */
device->path = g_value_dup_string (value);
break;
default:

View file

@ -253,6 +253,7 @@ gst_alsa_device_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_INTERNAL_NAME:
/* G_PARAM_CONSTRUCT_ONLY */
device->internal_name = g_value_dup_string (value);
break;
default:

View file

@ -802,6 +802,7 @@ gst_pulse_device_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_INTERNAL_NAME:
/* G_PARAM_CONSTRUCT_ONLY */
device->internal_name = g_value_dup_string (value);
break;
default:

View file

@ -257,6 +257,7 @@ gst_directsound_device_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_DEVICE_GUID:
/* G_PARAM_CONSTRUCT_ONLY */
device->guid = g_value_dup_string (value);
break;
default:

View file

@ -223,6 +223,7 @@ gst_oss_device_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_DEVICE_PATH:
/* G_PARAM_CONSTRUCT_ONLY */
device->device_path = g_value_dup_string (value);
break;
default:

View file

@ -602,6 +602,7 @@ gst_v4l2_device_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_DEVICE_PATH:
/* G_PARAM_CONSTRUCT_ONLY */
device->device_path = g_value_dup_string (value);
break;
default:

View file

@ -207,6 +207,7 @@ gst_control_binding_set_property (GObject * object, guint prop_id,
g_weak_ref_set (&self->ABI.abi.priv->object, self->__object);
break;
case PROP_NAME:
/* G_PARAM_CONSTRUCT_ONLY */
self->name = g_value_dup_string (value);
break;
default:

View file

@ -168,12 +168,14 @@ gst_device_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_DISPLAY_NAME:
/* G_PARAM_CONSTRUCT_ONLY */
gstdevice->priv->display_name = g_value_dup_string (value);
break;
case PROP_CAPS:
gst_caps_replace (&gstdevice->priv->caps, g_value_get_boxed (value));
break;
case PROP_DEVICE_CLASS:
/* G_PARAM_CONSTRUCT_ONLY */
gstdevice->priv->device_class = g_value_dup_string (value);
break;
case PROP_PROPERTIES:

View file

@ -546,6 +546,7 @@ gst_pad_template_set_property (GObject * object, guint prop_id,
/* these properties are all construct-only */
switch (prop_id) {
case PROP_NAME_TEMPLATE:
/* G_PARAM_CONSTRUCT_ONLY */
GST_PAD_TEMPLATE_NAME_TEMPLATE (object) = g_value_dup_string (value);
break;
case PROP_DIRECTION: