From e3b4eff9dcb45f75dcc548329442f3a61776df56 Mon Sep 17 00:00:00 2001 From: gb Date: Wed, 10 Mar 2010 13:02:45 +0000 Subject: [PATCH] Fix GstVaapiSurface initialization, override constructed() method, not constructor(). GObject C is awful... --- gst-libs/gst/vaapi/gstvaapisurface.c | 31 +++++++++------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapisurface.c b/gst-libs/gst/vaapi/gstvaapisurface.c index d0ee6a24cb..e45963ec6a 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface.c +++ b/gst-libs/gst/vaapi/gstvaapisurface.c @@ -159,28 +159,17 @@ gst_vaapi_surface_get_property(GObject *object, } } -static GObject * -gst_vaapi_surface_constructor(GType type, - guint n_params, - GObjectConstructParam *params) +static void +gst_vaapi_surface_constructed(GObject *object) { - GstVaapiSurface *surface; + GstVaapiSurface * const surface = GST_VAAPI_SURFACE(object); GObjectClass *parent_class; - GObject *object; - D(bug("gst_vaapi_surface_constructor()\n")); + gst_vaapi_surface_create(surface); parent_class = G_OBJECT_CLASS(gst_vaapi_surface_parent_class); - object = parent_class->constructor (type, n_params, params); - - if (object) { - surface = GST_VAAPI_SURFACE(object); - if (!gst_vaapi_surface_create(surface)) { - gst_vaapi_surface_destroy(surface); - object = NULL; - } - } - return object; + if (parent_class->constructed) + parent_class->constructed(object); } static void @@ -193,7 +182,7 @@ gst_vaapi_surface_class_init(GstVaapiSurfaceClass *klass) object_class->finalize = gst_vaapi_surface_finalize; object_class->set_property = gst_vaapi_surface_set_property; object_class->get_property = gst_vaapi_surface_get_property; - object_class->constructor = gst_vaapi_surface_constructor; + object_class->constructed = gst_vaapi_surface_constructed; g_object_class_install_property (object_class, @@ -267,9 +256,9 @@ gst_vaapi_surface_new(GstVaapiDisplay *display, return g_object_new(GST_VAAPI_TYPE_SURFACE, "display", display, - "width", width, - "height", height, - "format", format, + "width", width, + "height", height, + "format", format, NULL); }