vah265enc: Use helper to update properties.
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Sun, 19 Feb 2023 11:01:59 +0000 (12:01 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 20 Feb 2023 23:41:44 +0000 (23:41 +0000)
This is a continuation of the original patch by
 Mengkejiergeli Ba <mengkejiergeli.ba@intel.com>

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4009>

subprojects/gst-plugins-bad/sys/va/gstvah265enc.c

index f542158..796ec21 100644 (file)
@@ -3382,8 +3382,7 @@ _h265_ensure_rate_control (GstVaH265Enc * self)
 
     GST_INFO_OBJECT (self, "target bitrate computed to %u kbps", bitrate);
 
-    self->prop.bitrate = bitrate;
-    g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_BITRATE]);
+    update_property_uint (base, &self->prop.bitrate, bitrate, PROP_BITRATE);
   }
 
   /* Adjust the setting based on RC mode. */
@@ -4284,10 +4283,8 @@ print_options:
     self->features.use_trellis = FALSE;
   }
 
-  if (self->prop.use_trellis != self->features.use_trellis) {
-    self->prop.use_trellis = self->features.use_trellis;
-    g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_TRELLIS]);
-  }
+  update_property_bool (base, &self->prop.use_trellis,
+      self->features.use_trellis, PROP_TRELLIS);
 }
 
 /* We need to decide the profile and entrypoint before call this.