From dfb244fb507163c71bd99a78ad6b9e05a0f5030c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 14 Mar 2012 14:51:22 +0000 Subject: [PATCH] pbutils: make encoding profile classes opaque Don't typedef them to GObjectClass directly, but hide behind private structs. Fixes issues with gobject-introspection and GstEncodingProfileClass. https://bugzilla.gnome.org/show_bug.cgi?id=668542 --- gst-libs/gst/pbutils/encoding-profile.c | 36 +++++++++++++++++++++++++++------ gst-libs/gst/pbutils/encoding-profile.h | 8 ++++---- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/gst-libs/gst/pbutils/encoding-profile.c b/gst-libs/gst/pbutils/encoding-profile.c index 93cc58d..41a8b34 100644 --- a/gst-libs/gst/pbutils/encoding-profile.c +++ b/gst-libs/gst/pbutils/encoding-profile.c @@ -144,6 +144,11 @@ struct _GstEncodingProfile GstCaps *restriction; }; +struct _GstEncodingProfileClass +{ + GObjectClass parent_class; +}; + static void string_to_profile_transform (const GValue * src_value, GValue * dest_value); static gboolean gst_encoding_profile_deserialize_valfunc (GValue * value, @@ -209,9 +214,11 @@ gst_encoding_profile_finalize (GObject * object) } static void -gst_encoding_profile_class_init (GObjectClass * klass) +gst_encoding_profile_class_init (GstEncodingProfileClass * klass) { - klass->finalize = gst_encoding_profile_finalize; + GObjectClass *gobject_class = (GObjectClass *) klass; + + gobject_class->finalize = gst_encoding_profile_finalize; } /** @@ -422,6 +429,11 @@ struct _GstEncodingContainerProfile GList *encodingprofiles; }; +struct _GstEncodingContainerProfileClass +{ + GstEncodingProfileClass parent; +}; + G_DEFINE_TYPE (GstEncodingContainerProfile, gst_encoding_container_profile, GST_TYPE_ENCODING_PROFILE); @@ -444,9 +456,11 @@ gst_encoding_container_profile_finalize (GObject * object) } static void -gst_encoding_container_profile_class_init (GObjectClass * klass) +gst_encoding_container_profile_class_init (GstEncodingContainerProfileClass * k) { - klass->finalize = gst_encoding_container_profile_finalize; + GObjectClass *gobject_class = (GObjectClass *) k; + + gobject_class->finalize = gst_encoding_container_profile_finalize; } /** @@ -473,6 +487,11 @@ struct _GstEncodingVideoProfile gboolean variableframerate; }; +struct _GstEncodingVideoProfileClass +{ + GstEncodingProfileClass parent; +}; + G_DEFINE_TYPE (GstEncodingVideoProfile, gst_encoding_video_profile, GST_TYPE_ENCODING_PROFILE); @@ -483,7 +502,7 @@ gst_encoding_video_profile_init (GstEncodingVideoProfile * prof) } static void -gst_encoding_video_profile_class_init (GObjectClass * klass) +gst_encoding_video_profile_class_init (GstEncodingVideoProfileClass * klass) { } @@ -562,6 +581,11 @@ struct _GstEncodingAudioProfile GstEncodingProfile parent; }; +struct _GstEncodingAudioProfileClass +{ + GstEncodingProfileClass parent; +}; + G_DEFINE_TYPE (GstEncodingAudioProfile, gst_encoding_audio_profile, GST_TYPE_ENCODING_PROFILE); @@ -572,7 +596,7 @@ gst_encoding_audio_profile_init (GstEncodingAudioProfile * prof) } static void -gst_encoding_audio_profile_class_init (GObjectClass * klass) +gst_encoding_audio_profile_class_init (GstEncodingAudioProfileClass * klass) { } diff --git a/gst-libs/gst/pbutils/encoding-profile.h b/gst-libs/gst/pbutils/encoding-profile.h index f227ffc..e8c5c92 100644 --- a/gst-libs/gst/pbutils/encoding-profile.h +++ b/gst-libs/gst/pbutils/encoding-profile.h @@ -44,7 +44,7 @@ G_BEGIN_DECLS #define GST_IS_ENCODING_PROFILE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_PROFILE)) typedef struct _GstEncodingProfile GstEncodingProfile; -typedef GObjectClass GstEncodingProfileClass; +typedef struct _GstEncodingProfileClass GstEncodingProfileClass; GType gst_encoding_profile_get_type (void); @@ -63,7 +63,7 @@ GType gst_encoding_profile_get_type (void); #define GST_IS_ENCODING_CONTAINER_PROFILE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_CONTAINER_PROFILE)) typedef struct _GstEncodingContainerProfile GstEncodingContainerProfile; -typedef GstEncodingProfileClass GstEncodingContainerProfileClass; +typedef struct _GstEncodingContainerProfileClass GstEncodingContainerProfileClass; GType gst_encoding_container_profile_get_type (void); @@ -82,7 +82,7 @@ GType gst_encoding_container_profile_get_type (void); #define GST_IS_ENCODING_VIDEO_PROFILE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_VIDEO_PROFILE)) typedef struct _GstEncodingVideoProfile GstEncodingVideoProfile; -typedef GstEncodingProfileClass GstEncodingVideoProfileClass; +typedef struct _GstEncodingVideoProfileClass GstEncodingVideoProfileClass; GType gst_encoding_video_profile_get_type (void); @@ -101,7 +101,7 @@ GType gst_encoding_video_profile_get_type (void); #define GST_IS_ENCODING_AUDIO_PROFILE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_AUDIO_PROFILE)) typedef struct _GstEncodingAudioProfile GstEncodingAudioProfile; -typedef GstEncodingProfileClass GstEncodingAudioProfileClass; +typedef struct _GstEncodingAudioProfileClass GstEncodingAudioProfileClass; GType gst_encoding_audio_profile_get_type (void); -- 2.7.4