From 0d3e4d08afe9e1b418bb5c3d22fd90596a04689c Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Fri, 3 Jan 2003 23:34:43 +0000 Subject: [PATCH] make GstPropsEntry a boxed type Original commit message from CVS: make GstPropsEntry a boxed type --- gst/gstprops.c | 9 +++++++-- gst/gstprops.h | 11 ++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/gst/gstprops.c b/gst/gstprops.c index 3572d32659..0dea80fd18 100644 --- a/gst/gstprops.c +++ b/gst/gstprops.c @@ -27,6 +27,7 @@ #include "gstprops.h" GType _gst_props_type; +GType _gst_props_entry_type; #define GST_PROPS_ENTRY_IS_VARIABLE(a) (((GstPropsEntry*)(a))->propstype > GST_PROPS_VAR_TYPE) @@ -133,6 +134,10 @@ _gst_props_initialize (void) g_value_register_transform_func (_gst_props_type, G_TYPE_STRING, transform_func); + + _gst_props_entry_type = g_boxed_type_register_static ("GstPropsEntry", + (GBoxedCopyFunc) gst_props_entry_copy, + (GBoxedFreeFunc) gst_props_entry_destroy); } static void @@ -304,7 +309,7 @@ gst_props_alloc_entry (void) return entry; } -static void +void gst_props_entry_destroy (GstPropsEntry *entry) { switch (entry->propstype) { @@ -794,7 +799,7 @@ gst_props_destroy (GstProps *props) /* * copy entries */ -static GstPropsEntry* +GstPropsEntry* gst_props_entry_copy (GstPropsEntry *entry) { GstPropsEntry *newentry; diff --git a/gst/gstprops.h b/gst/gstprops.h index 5c8468f83f..c03ea59dea 100644 --- a/gst/gstprops.h +++ b/gst/gstprops.h @@ -79,6 +79,9 @@ typedef enum { #define GST_PROPS_INT_ANY GST_PROPS_INT_RANGE(G_MININT,G_MAXINT) typedef struct _GstPropsEntry GstPropsEntry; +extern GType _gst_props_entry_type; + +#define GST_TYPE_PROPS_ENTRY (_gst_props_entry_type) struct _GstProps { gint refcount; @@ -94,9 +97,9 @@ GstProps* gst_props_new (const gchar *firstname, ...); GstProps* gst_props_newv (const gchar *firstname, va_list var_args); GstProps* gst_props_empty_new (void); -void gst_props_unref (GstProps *props); -void gst_props_ref (GstProps *props); -void gst_props_destroy (GstProps *props); +void gst_props_unref (GstProps *props); +void gst_props_ref (GstProps *props); +void gst_props_destroy (GstProps *props); void gst_props_debug (GstProps *props); @@ -123,6 +126,8 @@ void gst_props_add_entry (GstProps *props, GstPropsEntry *entry); /* working with props entries */ GstPropsEntry* gst_props_entry_new (const gchar *name, ...); +void gst_props_entry_destroy (GstPropsEntry *entry); +GstPropsEntry* gst_props_entry_copy (GstPropsEntry *entry); GstPropsType gst_props_entry_get_type (const GstPropsEntry *entry); const gchar* gst_props_entry_get_name (const GstPropsEntry *entry); gboolean gst_props_entry_is_fixed (const GstPropsEntry *entry);