From f054eab77e24051fd9ff733c873e62f236a1dc11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 15 Jul 2011 20:57:47 +0100 Subject: [PATCH] tagmux: const-ify GstTagList argument of render vfuncs --- gst/id3tag/gstid3mux.c | 12 +++++----- gst/id3tag/gsttagmux.h | 52 +++++++++++++++++++----------------------- gst/id3tag/id3tag.c | 4 ++-- gst/id3tag/id3tag.h | 10 ++++---- 4 files changed, 38 insertions(+), 40 deletions(-) diff --git a/gst/id3tag/gstid3mux.c b/gst/id3tag/gstid3mux.c index 43ab1a08b4..d203fb3c6d 100644 --- a/gst/id3tag/gstid3mux.c +++ b/gst/id3tag/gstid3mux.c @@ -79,9 +79,9 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_BOILERPLATE (GstId3Mux, gst_id3_mux, GstTagMux, GST_TYPE_TAG_MUX); static GstBuffer *gst_id3_mux_render_v2_tag (GstTagMux * mux, - GstTagList * taglist); + const GstTagList * taglist); static GstBuffer *gst_id3_mux_render_v1_tag (GstTagMux * mux, - GstTagList * taglist); + const GstTagList * taglist); static void gst_id3_mux_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); @@ -129,8 +129,8 @@ gst_id3_mux_class_init (GstId3MuxClass * klass) GST_TAG_MUX_CLASS (klass)->render_start_tag = GST_DEBUG_FUNCPTR (gst_id3_mux_render_v2_tag); - - GST_TAG_MUX_CLASS (klass)->render_end_tag = gst_id3_mux_render_v1_tag; + GST_TAG_MUX_CLASS (klass)->render_end_tag = + GST_DEBUG_FUNCPTR (gst_id3_mux_render_v1_tag); } static void @@ -187,7 +187,7 @@ gst_id3_mux_get_property (GObject * object, guint prop_id, } static GstBuffer * -gst_id3_mux_render_v2_tag (GstTagMux * mux, GstTagList * taglist) +gst_id3_mux_render_v2_tag (GstTagMux * mux, const GstTagList * taglist) { GstId3Mux *id3mux = GST_ID3_MUX (mux); @@ -198,7 +198,7 @@ gst_id3_mux_render_v2_tag (GstTagMux * mux, GstTagList * taglist) } static GstBuffer * -gst_id3_mux_render_v1_tag (GstTagMux * mux, GstTagList * taglist) +gst_id3_mux_render_v1_tag (GstTagMux * mux, const GstTagList * taglist) { GstId3Mux *id3mux = GST_ID3_MUX (mux); diff --git a/gst/id3tag/gsttagmux.h b/gst/id3tag/gsttagmux.h index 49a0ab912d..4677c32f75 100644 --- a/gst/id3tag/gsttagmux.h +++ b/gst/id3tag/gsttagmux.h @@ -27,33 +27,6 @@ G_BEGIN_DECLS -typedef struct _GstTagMux GstTagMux; -typedef struct _GstTagMuxClass GstTagMuxClass; -typedef struct _GstTagMuxPrivate GstTagMuxPrivate; - -/* Definition of structure storing data for this element. */ -struct _GstTagMux { - GstElement element; - - /*< private >*/ - GstTagMuxPrivate *priv; - - gpointer _gst_reserved[GST_PADDING]; -}; - -/* Standard definition defining a class for this element. */ -struct _GstTagMuxClass { - GstElementClass parent_class; - - /* vfuncs */ - GstBuffer * (*render_start_tag) (GstTagMux * mux, GstTagList * tag_list); - GstBuffer * (*render_end_tag) (GstTagMux * mux, GstTagList * tag_list); - - /*< private >*/ - gpointer _gst_reserved[GST_PADDING]; -}; - -/* Standard macros for defining types for this element. */ #define GST_TYPE_TAG_MUX \ (gst_tag_mux_get_type()) #define GST_TAG_MUX(obj) \ @@ -65,7 +38,30 @@ struct _GstTagMuxClass { #define GST_IS_TAG_MUX_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TAG_MUX)) -/* Standard function returning type information. */ +typedef struct _GstTagMux GstTagMux; +typedef struct _GstTagMuxClass GstTagMuxClass; +typedef struct _GstTagMuxPrivate GstTagMuxPrivate; + +struct _GstTagMux { + GstElement element; + + /*< private >*/ + GstTagMuxPrivate *priv; + + gpointer _gst_reserved[GST_PADDING]; +}; + +struct _GstTagMuxClass { + GstElementClass parent_class; + + /* vfuncs */ + GstBuffer * (*render_start_tag) (GstTagMux * mux, const GstTagList * tag_list); + GstBuffer * (*render_end_tag) (GstTagMux * mux, const GstTagList * tag_list); + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING]; +}; + GType gst_tag_mux_get_type (void); G_END_DECLS diff --git a/gst/id3tag/id3tag.c b/gst/id3tag/id3tag.c index ef1948be2e..3a0e4d48dd 100644 --- a/gst/id3tag/id3tag.c +++ b/gst/id3tag/id3tag.c @@ -1132,7 +1132,7 @@ foreach_add_tag (const GstTagList * list, const gchar * tag, gpointer userdata) } GstBuffer * -id3_mux_render_v2_tag (GstTagMux * mux, GstTagList * taglist, int version) +id3_mux_render_v2_tag (GstTagMux * mux, const GstTagList * taglist, int version) { GstId3v2Tag tag; GstBuffer *buf; @@ -1284,7 +1284,7 @@ static const struct }; GstBuffer * -id3_mux_render_v1_tag (GstTagMux * mux, GstTagList * taglist) +id3_mux_render_v1_tag (GstTagMux * mux, const GstTagList * taglist) { GstBuffer *buf = gst_buffer_new_and_alloc (ID3_V1_TAG_SIZE); guint8 *data = GST_BUFFER_DATA (buf); diff --git a/gst/id3tag/id3tag.h b/gst/id3tag/id3tag.h index d55049691f..eeb1995d5b 100644 --- a/gst/id3tag/id3tag.h +++ b/gst/id3tag/id3tag.h @@ -24,9 +24,11 @@ G_BEGIN_DECLS #define ID3_VERSION_2_3 3 #define ID3_VERSION_2_4 4 -GstBuffer * id3_mux_render_v2_tag (GstTagMux * mux, GstTagList * taglist, - int version); -GstBuffer * id3_mux_render_v1_tag (GstTagMux * mux, GstTagList * taglist); +GstBuffer * id3_mux_render_v2_tag (GstTagMux * mux, + const GstTagList * taglist, + int version); + +GstBuffer * id3_mux_render_v1_tag (GstTagMux * mux, + const GstTagList * taglist); G_END_DECLS -