From dc2b00adb86930de40f5af11c1aab14ba8c3659e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 29 Aug 2011 11:38:01 +0200 Subject: [PATCH] pbutils: port to new API --- gst-libs/gst/pbutils/gstdiscoverer-types.c | 24 +++++++++++++++--------- gst-libs/gst/pbutils/gstdiscoverer.c | 4 +++- gst-libs/gst/pbutils/gstdiscoverer.h | 2 +- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/gst-libs/gst/pbutils/gstdiscoverer-types.c b/gst-libs/gst/pbutils/gstdiscoverer-types.c index 94ba475..f96b633 100644 --- a/gst-libs/gst/pbutils/gstdiscoverer-types.c +++ b/gst-libs/gst/pbutils/gstdiscoverer-types.c @@ -201,16 +201,19 @@ G_DEFINE_TYPE (GstDiscovererAudioInfo, gst_discoverer_audio_info, GST_TYPE_DISCOVERER_STREAM_INFO); static void -gst_discoverer_audio_info_finalize (GstDiscovererAudioInfo * info) +gst_discoverer_audio_info_finalize (GObject * object) { + GstDiscovererAudioInfo *info = (GstDiscovererAudioInfo *) object; + g_free (info->language); + + G_OBJECT_CLASS (gst_discoverer_audio_info_parent_class)->finalize (object); } static void -gst_discoverer_audio_info_class_init (GstDiscovererAudioInfoClass * klass) +gst_discoverer_audio_info_class_init (GObjectClass * klass) { - klass->finalize = - (GstMiniObjectFinalizeFunction) gst_discoverer_audio_info_finalize; + klass->finalize = gst_discoverer_audio_info_finalize; } static void @@ -254,23 +257,26 @@ gst_discoverer_subtitle_info_init (GstDiscovererSubtitleInfo * info) } static void -gst_discoverer_subtitle_info_finalize (GstDiscovererSubtitleInfo * info) +gst_discoverer_subtitle_info_finalize (GObject * object) { + GstDiscovererSubtitleInfo *info = (GstDiscovererSubtitleInfo *) object; + g_free (info->language); + + G_OBJECT_CLASS (gst_discoverer_subtitle_info_parent_class)->finalize (object); } static void -gst_discoverer_subtitle_info_class_init (GstMiniObjectClass * klass) +gst_discoverer_subtitle_info_class_init (GObjectClass * klass) { - klass->finalize = - (GstMiniObjectFinalizeFunction) gst_discoverer_subtitle_info_finalize; + klass->finalize = gst_discoverer_subtitle_info_finalize; } static GstDiscovererSubtitleInfo * gst_discoverer_subtitle_info_new (void) { return (GstDiscovererSubtitleInfo *) - gst_mini_object_new (GST_TYPE_DISCOVERER_SUBTITLE_INFO); + g_object_new (GST_TYPE_DISCOVERER_SUBTITLE_INFO, NULL); } static GstDiscovererSubtitleInfo * diff --git a/gst-libs/gst/pbutils/gstdiscoverer.c b/gst-libs/gst/pbutils/gstdiscoverer.c index 05bd86e..6a1dbc8 100644 --- a/gst-libs/gst/pbutils/gstdiscoverer.c +++ b/gst-libs/gst/pbutils/gstdiscoverer.c @@ -44,6 +44,8 @@ #include "config.h" #endif +#include + #include "pbutils.h" #include "pbutils-marshal.h" #include "pbutils-private.h" @@ -730,7 +732,7 @@ collect_information (GstDiscoverer * dc, const GstStructure * st, info = (GstDiscovererSubtitleInfo *) parent; else { info = (GstDiscovererSubtitleInfo *) - gst_mini_object_new (GST_TYPE_DISCOVERER_SUBTITLE_INFO); + g_object_new (GST_TYPE_DISCOVERER_SUBTITLE_INFO, NULL); info->parent.caps = caps; } diff --git a/gst-libs/gst/pbutils/gstdiscoverer.h b/gst-libs/gst/pbutils/gstdiscoverer.h index 2b833aa..a005577 100644 --- a/gst-libs/gst/pbutils/gstdiscoverer.h +++ b/gst-libs/gst/pbutils/gstdiscoverer.h @@ -156,7 +156,7 @@ gboolean gst_discoverer_video_info_is_image(const GstDiscovererVideoInfo* #define GST_IS_DISCOVERER_SUBTITLE_INFO(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DISCOVERER_SUBTITLE_INFO)) typedef struct _GstDiscovererSubtitleInfo GstDiscovererSubtitleInfo; -typedef GstMiniObjectClass GstDiscovererSubtitleInfoClass; +typedef GObjectClass GstDiscovererSubtitleInfoClass; GType gst_discoverer_subtitle_info_get_type (void); const gchar * gst_discoverer_subtitle_info_get_language(const GstDiscovererSubtitleInfo* info); -- 2.7.4