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_*() as they can only be called once during construction.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8978>
This commit is contained in:
Doug Nazar 2025-05-13 19:15:21 -04:00
parent 4d87ffb8f3
commit 5867c7900a
21 changed files with 23 additions and 0 deletions

View File

@ -85,6 +85,7 @@ gst_player_g_main_context_signal_dispatcher_set_property (GObject * object,
switch (prop_id) {
case G_MAIN_CONTEXT_SIGNAL_DISPATCHER_PROP_APPLICATION_CONTEXT:
/* G_PARAM_CONSTRUCT_ONLY */
self->application_context = g_value_dup_boxed (value);
if (!self->application_context)
self->application_context = g_main_context_ref_thread_default ();

View File

@ -361,9 +361,11 @@ gst_player_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_SIGNAL_DISPATCHER:
/* G_PARAM_CONSTRUCT_ONLY */
self->signal_dispatcher = g_value_dup_object (value);
break;
case PROP_VIDEO_RENDERER:
/* G_PARAM_CONSTRUCT_ONLY */
self->video_renderer = g_value_dup_object (value);
break;
default:

View File

@ -323,6 +323,7 @@ gst_transcoder_set_property (GObject * object, guint prop_id,
gst_transcoder_set_position_update_interval_internal (self);
break;
case PROP_PROFILE:
/* G_PARAM_CONSTRUCT_ONLY */
GST_OBJECT_LOCK (self);
self->profile = g_value_dup_object (value);
GST_OBJECT_UNLOCK (self);

View File

@ -137,6 +137,7 @@ gst_vulkan_device_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_PHYSICAL_DEVICE:
/* G_PARAM_CONSTRUCT_ONLY */
device->physical_device = g_value_dup_object (value);
break;
default:

View File

@ -123,6 +123,7 @@ gst_vulkan_operation_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_COMMAND_POOL:
/* G_PARAM_CONSTRUCT_ONLY */
g_assert (!priv->cmd_pool);
priv->cmd_pool = g_value_dup_object (value);
break;

View File

@ -129,6 +129,7 @@ gst_vulkan_physical_device_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_INSTANCE:
/* G_PARAM_CONSTRUCT_ONLY */
device->instance = g_value_dup_object (value);
break;
case PROP_DEVICE_ID:{

View File

@ -76,9 +76,11 @@ gst_webrtc_rtp_transceiver_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_SENDER:
/* G_PARAM_CONSTRUCT_ONLY */
webrtc->sender = g_value_dup_object (value);
break;
case PROP_RECEIVER:
/* G_PARAM_CONSTRUCT_ONLY */
webrtc->receiver = g_value_dup_object (value);
break;
case PROP_MLINE:

View File

@ -101,6 +101,7 @@ gst_video_texture_cache_gl_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_CONTEXT:
/* G_PARAM_CONSTRUCT_ONLY */
cache_gl->ctx = g_value_dup_object (value);
break;
default:

View File

@ -109,6 +109,7 @@ gst_video_texture_cache_vulkan_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_DEVICE:
/* G_PARAM_CONSTRUCT_ONLY */
cache_vulkan->device = (GstVulkanDevice *) g_value_dup_object (value);
break;
default:

View File

@ -1627,6 +1627,7 @@ gst_d3d11_dxgi_capture_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_D3D11_DEVICE:
/* G_PARAM_CONSTRUCT_ONLY */
self->device = (GstD3D11Device *) g_value_dup_object (value);
break;
case PROP_MONITOR_HANDLE:

View File

@ -221,6 +221,7 @@ gst_d3d11_window_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_D3D11_DEVICE:
/* G_PARAM_CONSTRUCT_ONLY */
self->device = (GstD3D11Device *) g_value_dup_object (value);
break;
case PROP_FORCE_ASPECT_RATIO:

View File

@ -380,6 +380,7 @@ gst_d3d11_winrt_capture_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_D3D11_DEVICE:
/* G_PARAM_CONSTRUCT_ONLY */
self->device = (GstD3D11Device *) g_value_dup_object (value);
break;
case PROP_MONITOR_HANDLE:

View File

@ -77,6 +77,7 @@ gst_va_decoder_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_DISPLAY:{
/* G_PARAM_CONSTRUCT_ONLY */
g_assert (!self->display);
self->display = g_value_dup_object (value);
break;

View File

@ -123,6 +123,7 @@ gst_va_encoder_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_DISPLAY:{
/* G_PARAM_CONSTRUCT_ONLY */
g_assert (!self->display);
self->display = g_value_dup_object (value);
break;

View File

@ -99,6 +99,7 @@ gst_va_filter_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_DISPLAY:{
/* G_PARAM_CONSTRUCT_ONLY */
g_assert (!self->display);
self->display = g_value_dup_object (value);
break;

View File

@ -815,6 +815,7 @@ gst_webview2_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_DEVICE:
/* G_PARAM_CONSTRUCT_ONLY */
priv->device = (GstD3D11Device *) g_value_dup_object (value);
break;
case PROP_USER_DATA_FOLDER:

View File

@ -494,6 +494,7 @@ gst_vaapi_decoder_set_property (GObject * object, guint property_id,
switch (property_id) {
case PROP_DISPLAY:
/* G_PARAM_CONSTRUCT_ONLY */
g_assert (decoder->display == NULL);
decoder->display = g_value_dup_object (value);
g_assert (decoder->display != NULL);

View File

@ -1218,6 +1218,7 @@ gst_vaapi_encoder_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case ENCODER_PROP_DISPLAY:
/* G_PARAM_CONSTRUCT_ONLY */
g_assert (encoder->display == NULL);
encoder->display = g_value_dup_object (value);
g_assert (encoder->display != NULL);

View File

@ -171,6 +171,7 @@ gst_vaapi_window_set_property (GObject * object, guint property_id,
switch (property_id) {
case PROP_DISPLAY:
/* G_PARAM_CONSTRUCT_ONLY */
g_assert (window->display == NULL);
window->display = g_value_dup_object (value);
g_assert (window->display != NULL);

View File

@ -77,6 +77,7 @@ gst_vaapi_video_buffer_pool_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_DISPLAY:
/* G_PARAM_CONSTRUCT_ONLY */
priv->display = g_value_dup_object (value);
break;
default:

View File

@ -558,6 +558,7 @@ gst_pad_template_set_property (GObject * object, guint prop_id,
(GstPadPresence) g_value_get_enum (value);
break;
case PROP_CAPS:
/* G_PARAM_CONSTRUCT_ONLY */
GST_PAD_TEMPLATE_CAPS (object) = g_value_dup_boxed (value);
if (GST_PAD_TEMPLATE_CAPS (object) != NULL) {
/* GstPadTemplate are usually leaked so are their caps */