diff --git a/gst-libs/gst/vaapi/gstvaapiimage.c b/gst-libs/gst/vaapi/gstvaapiimage.c index 2c6c8d88ff..eae7708f3d 100644 --- a/gst-libs/gst/vaapi/gstvaapiimage.c +++ b/gst-libs/gst/vaapi/gstvaapiimage.c @@ -173,30 +173,19 @@ gst_vaapi_image_get_property( } } -static GObject * -gst_vaapi_image_constructor( - GType type, - guint n_params, - GObjectConstructParam *params -) +static void +gst_vaapi_image_constructed(GObject *object) { - GstVaapiImage *image; + GstVaapiImage * const image = GST_VAAPI_IMAGE(object); GObjectClass *parent_class; - GObject *object; - D(bug("gst_vaapi_image_constructor()\n")); + D(bug("gst_vaapi_image_constructed()\n")); + + gst_vaapi_image_create(image); parent_class = G_OBJECT_CLASS(gst_vaapi_image_parent_class); - object = parent_class->constructor (type, n_params, params); - - if (object) { - image = GST_VAAPI_IMAGE(object); - if (!gst_vaapi_image_create(image)) { - gst_vaapi_image_destroy(image); - object = NULL; - } - } - return object; + if (parent_class->constructed) + parent_class->constructed(object); } static void @@ -209,7 +198,7 @@ gst_vaapi_image_class_init(GstVaapiImageClass *klass) object_class->finalize = gst_vaapi_image_finalize; object_class->set_property = gst_vaapi_image_set_property; object_class->get_property = gst_vaapi_image_get_property; - object_class->constructor = gst_vaapi_image_constructor; + object_class->constructed = gst_vaapi_image_constructed; g_object_class_install_property (object_class, diff --git a/gst-libs/gst/vaapi/gstvaapisubpicture.c b/gst-libs/gst/vaapi/gstvaapisubpicture.c index e8efeddc76..27fb91612e 100644 --- a/gst-libs/gst/vaapi/gstvaapisubpicture.c +++ b/gst-libs/gst/vaapi/gstvaapisubpicture.c @@ -122,7 +122,7 @@ gst_vaapi_subpicture_set_property( switch (prop_id) { case PROP_IMAGE: - subpicture->priv->image = g_object_ref(g_value_get_object(value)); + gst_vaapi_subpicture_set_image(subpicture, g_value_get_object(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); @@ -153,32 +153,6 @@ gst_vaapi_subpicture_get_property( } } -static GObject * -gst_vaapi_subpicture_constructor( - GType type, - guint n_params, - GObjectConstructParam *params -) -{ - GstVaapiSubpicture *subpicture; - GObjectClass *parent_class; - GObject *object; - - D(bug("gst_vaapi_subpicture_constructor()\n")); - - parent_class = G_OBJECT_CLASS(gst_vaapi_subpicture_parent_class); - object = parent_class->constructor (type, n_params, params); - - if (object) { - subpicture = GST_VAAPI_SUBPICTURE(object); - if (!gst_vaapi_subpicture_create(subpicture)) { - gst_vaapi_subpicture_destroy(subpicture); - object = NULL; - } - } - return object; -} - static void gst_vaapi_subpicture_class_init(GstVaapiSubpictureClass *klass) { @@ -189,7 +163,6 @@ gst_vaapi_subpicture_class_init(GstVaapiSubpictureClass *klass) object_class->finalize = gst_vaapi_subpicture_finalize; object_class->set_property = gst_vaapi_subpicture_set_property; object_class->get_property = gst_vaapi_subpicture_get_property; - object_class->constructor = gst_vaapi_subpicture_constructor; g_object_class_install_property (object_class,