gst/elements/gstmultifilesrc.c: Use G_TYPE_STRING in signal prototype instead of G_TYPE_POINTER.

Original commit message from CVS:
* gst/elements/gstmultifilesrc.c: (gst_multifilesrc_class_init):
Use G_TYPE_STRING in signal prototype instead of G_TYPE_POINTER.
* gst/elements/gsttypefind.c: (gst_type_find_element_class_init):
Use GST_TYPE_CAPS in signal prototype.
* gst/gstcaps.c: (_gst_caps_initialize), (gst_caps_copy_conditional):
Convert GST_TYPE_CAPS to boxed.
* gst/gstelement.c: (gst_element_class_init):
Use GST_TYPE_TAG_LIST in signal prototype.
* gst/gstindex.c: (gst_index_class_init):
* gst/gstindex.h:
Add GST_TYPE_INDEX_ENTRY type.
* gst/gstmarshal.list:
Add necessary marshal types.
* gst/gstpad.c: (gst_real_pad_class_init),
(_gst_real_pad_fixate_accumulator), (gst_pad_link_fixate),
(gst_pad_recover_caps_error):
Use GST_TYPE_CAPS in signal prototypes.  Fix some debugging strings.
* gst/gststructure.c: (_gst_structure_initialize),
(gst_structure_copy), (_gst_structure_copy_conditional):
* gst/gststructure.h:
Convert GST_TYPE_STRUCTURE to boxed.
* gst/gsttag.c: (gst_tag_list_get_type):
* gst/gsttag.h:
Add GST_TYPE_TAG_LIST type.
This commit is contained in:
David Schleef 2004-02-18 05:26:59 +00:00
parent 6aeaab9643
commit 67455089a4
17 changed files with 108 additions and 204 deletions

View file

@ -1,3 +1,30 @@
2004-02-17 David Schleef <ds@schleef.org>
* gst/elements/gstmultifilesrc.c: (gst_multifilesrc_class_init):
Use G_TYPE_STRING in signal prototype instead of G_TYPE_POINTER.
* gst/elements/gsttypefind.c: (gst_type_find_element_class_init):
Use GST_TYPE_CAPS in signal prototype.
* gst/gstcaps.c: (_gst_caps_initialize), (gst_caps_copy_conditional):
Convert GST_TYPE_CAPS to boxed.
* gst/gstelement.c: (gst_element_class_init):
Use GST_TYPE_TAG_LIST in signal prototype.
* gst/gstindex.c: (gst_index_class_init):
* gst/gstindex.h:
Add GST_TYPE_INDEX_ENTRY type.
* gst/gstmarshal.list:
Add necessary marshal types.
* gst/gstpad.c: (gst_real_pad_class_init),
(_gst_real_pad_fixate_accumulator), (gst_pad_link_fixate),
(gst_pad_recover_caps_error):
Use GST_TYPE_CAPS in signal prototypes. Fix some debugging strings.
* gst/gststructure.c: (_gst_structure_initialize),
(gst_structure_copy), (_gst_structure_copy_conditional):
* gst/gststructure.h:
Convert GST_TYPE_STRUCTURE to boxed.
* gst/gsttag.c: (gst_tag_list_get_type):
* gst/gsttag.h:
Add GST_TYPE_TAG_LIST type.
2004-02-17 Julien MOUTTE <julien@moutte.net> 2004-02-17 Julien MOUTTE <julien@moutte.net>
* gst/gstpad.c: (gst_pad_try_set_caps): Reverting my change according * gst/gstpad.c: (gst_pad_try_set_caps): Reverting my change according

View file

@ -96,8 +96,8 @@ gst_multifilesrc_class_init (GstMultiFileSrcClass *klass)
gst_multifilesrc_signals[NEW_FILE] = gst_multifilesrc_signals[NEW_FILE] =
g_signal_new ("new_file", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, g_signal_new ("new_file", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstMultiFileSrcClass, new_file), NULL, NULL, G_STRUCT_OFFSET (GstMultiFileSrcClass, new_file), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1,
G_TYPE_POINTER); G_TYPE_STRING);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOCATIONS, g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOCATIONS,
g_param_spec_pointer("locations","locations","locations", g_param_spec_pointer("locations","locations","locations",

View file

@ -158,8 +158,8 @@ gst_type_find_element_class_init (GstTypeFindElementClass *typefind_class)
gst_type_find_element_signals[HAVE_TYPE] = g_signal_new ("have_type", gst_type_find_element_signals[HAVE_TYPE] = g_signal_new ("have_type",
G_TYPE_FROM_CLASS (typefind_class), G_SIGNAL_RUN_LAST, G_TYPE_FROM_CLASS (typefind_class), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstTypeFindElementClass, have_type), NULL, NULL, G_STRUCT_OFFSET (GstTypeFindElementClass, have_type), NULL, NULL,
gst_marshal_VOID__UINT_POINTER, G_TYPE_NONE, 2, gst_marshal_VOID__UINT_BOXED, G_TYPE_NONE, 2,
G_TYPE_UINT, G_TYPE_POINTER); G_TYPE_UINT, GST_TYPE_CAPS | G_SIGNAL_TYPE_STATIC_SCOPE);
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_type_find_element_change_state); gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_type_find_element_change_state);
} }

View file

@ -43,51 +43,18 @@
static void _gst_caps_transform_to_string (const GValue *src_value, static void _gst_caps_transform_to_string (const GValue *src_value,
GValue *dest_value); GValue *dest_value);
static void _gst_caps_value_init (GValue *value);
static void _gst_caps_value_free (GValue *value);
static void _gst_caps_value_copy (const GValue *src, GValue *dest);
static gpointer _gst_caps_value_peek_pointer (const GValue *value);
static gchar* _gst_caps_collect_value (GValue *value,
guint n_collect_values,
GTypeCValue *collect_values,
guint collect_flags);
static gchar* _gst_caps_lcopy_value (const GValue *value,
guint n_collect_values,
GTypeCValue *collect_values,
guint collect_flags);
static gboolean _gst_caps_from_string_inplace (GstCaps *caps, static gboolean _gst_caps_from_string_inplace (GstCaps *caps,
const gchar *string); const gchar *string);
static GstCaps * gst_caps_copy_conditional (const GstCaps *src);
GType _gst_caps_type; GType _gst_caps_type;
void _gst_caps_initialize (void) void _gst_caps_initialize (void)
{ {
static const GTypeValueTable type_value_table = { _gst_caps_type = g_boxed_type_register_static ("GstCaps",
_gst_caps_value_init, (GBoxedCopyFunc)gst_caps_copy_conditional,
_gst_caps_value_free, (GBoxedFreeFunc)gst_caps_free);
_gst_caps_value_copy,
_gst_caps_value_peek_pointer,
"p",
_gst_caps_collect_value,
"p",
_gst_caps_lcopy_value,
};
static const GTypeInfo caps2_info = {
0,
NULL,
NULL,
NULL,
NULL,
NULL,
0,
0,
NULL,
&type_value_table,
};
_gst_caps_type = g_type_register_static (G_TYPE_BOXED, "GstCaps",
&caps2_info, 0);
g_value_register_transform_func (_gst_caps_type, G_TYPE_STRING, g_value_register_transform_func (_gst_caps_type, G_TYPE_STRING,
_gst_caps_transform_to_string); _gst_caps_transform_to_string);
@ -1141,76 +1108,15 @@ static void _gst_caps_transform_to_string (const GValue *src_value,
gst_caps_to_string (src_value->data[0].v_pointer); gst_caps_to_string (src_value->data[0].v_pointer);
} }
static void _gst_caps_value_init (GValue *value) static GstCaps * gst_caps_copy_conditional (const GstCaps *src)
{ {
value->data[0].v_pointer = NULL; if (src) {
} return gst_caps_copy (src);
static void _gst_caps_value_free (GValue *value)
{
if (value->data[0].v_pointer) gst_caps_free (value->data[0].v_pointer);
}
static void _gst_caps_value_copy (const GValue *src, GValue *dest)
{
if (dest->data[0].v_pointer) {
gst_caps_free (dest->data[0].v_pointer);
}
if (src->data[0].v_pointer) {
dest->data[0].v_pointer = gst_caps_copy (src->data[0].v_pointer);
} else { } else {
dest->data[0].v_pointer = NULL; return NULL;
} }
} }
static gpointer _gst_caps_value_peek_pointer (const GValue *value)
{
return value->data[0].v_pointer;
}
/* adapted from gboxed.c */
static gchar*
_gst_caps_collect_value (GValue *value,
guint n_collect_values,
GTypeCValue *collect_values,
guint collect_flags)
{
if (!collect_values[0].v_pointer)
value->data[0].v_pointer = NULL;
else
if (collect_flags & G_VALUE_NOCOPY_CONTENTS)
{
value->data[0].v_pointer = collect_values[0].v_pointer;
value->data[1].v_uint = G_VALUE_NOCOPY_CONTENTS;
}
else
value->data[0].v_pointer = gst_caps_copy (collect_values[0].v_pointer);
return NULL;
}
static gchar*
_gst_caps_lcopy_value (const GValue *value,
guint n_collect_values,
GTypeCValue *collect_values,
guint collect_flags)
{
GstCaps **boxed_p = collect_values[0].v_pointer;
if (!boxed_p)
return g_strdup_printf ("value location for `%s' passed as NULL",
G_VALUE_TYPE_NAME (value));
if (!value->data[0].v_pointer)
*boxed_p = NULL;
else if (collect_flags & G_VALUE_NOCOPY_CONTENTS)
*boxed_p = value->data[0].v_pointer;
else
*boxed_p = gst_caps_copy (value->data[0].v_pointer);
return NULL;
}
/* fixate utility functions */ /* fixate utility functions */
gboolean gst_caps_structure_fixate_field_nearest_int (GstStructure *structure, gboolean gst_caps_structure_fixate_field_nearest_int (GstStructure *structure,

View file

@ -133,7 +133,8 @@ gst_element_class_init (GstElementClass *klass)
g_signal_new ("error", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, g_signal_new ("error", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstElementClass, error), NULL, NULL, G_STRUCT_OFFSET (GstElementClass, error), NULL, NULL,
gst_marshal_VOID__OBJECT_POINTER_STRING, G_TYPE_NONE, 3, gst_marshal_VOID__OBJECT_POINTER_STRING, G_TYPE_NONE, 3,
GST_TYPE_ELEMENT, G_TYPE_POINTER, G_TYPE_STRING); GST_TYPE_ELEMENT, G_TYPE_POINTER,
G_TYPE_STRING);
gst_element_signals[EOS] = gst_element_signals[EOS] =
g_signal_new ("eos", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, g_signal_new ("eos", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstElementClass, eos), NULL, NULL, G_STRUCT_OFFSET (GstElementClass, eos), NULL, NULL,
@ -141,8 +142,8 @@ gst_element_class_init (GstElementClass *klass)
gst_element_signals[FOUND_TAG] = gst_element_signals[FOUND_TAG] =
g_signal_new ("found-tag", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, g_signal_new ("found-tag", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstElementClass, found_tag), NULL, NULL, G_STRUCT_OFFSET (GstElementClass, found_tag), NULL, NULL,
gst_marshal_VOID__OBJECT_POINTER, G_TYPE_NONE, 2, gst_marshal_VOID__OBJECT_BOXED, G_TYPE_NONE, 2,
GST_TYPE_ELEMENT, G_TYPE_POINTER); GST_TYPE_ELEMENT, GST_TYPE_TAG_LIST);
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_element_real_set_property); gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_element_real_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_element_real_get_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_element_real_get_property);

View file

@ -140,8 +140,8 @@ gst_index_class_init (GstIndexClass *klass)
gst_index_signals[ENTRY_ADDED] = gst_index_signals[ENTRY_ADDED] =
g_signal_new ("entry_added", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, g_signal_new ("entry_added", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstIndexClass, entry_added), NULL, NULL, G_STRUCT_OFFSET (GstIndexClass, entry_added), NULL, NULL,
gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, gst_marshal_VOID__BOXED, G_TYPE_NONE, 1,
G_TYPE_POINTER); GST_TYPE_INDEX_ENTRY);
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_index_set_property); gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_index_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_index_get_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_index_get_property);

View file

@ -37,6 +37,8 @@ G_BEGIN_DECLS
#define GST_IS_INDEX_CLASS(klass) (GST_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_INDEX)) #define GST_IS_INDEX_CLASS(klass) (GST_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_INDEX))
#define GST_INDEX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_INDEX, GstIndexClass)) #define GST_INDEX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_INDEX, GstIndexClass))
#define GST_TYPE_INDEX_ENTRY (gst_index_entry_get_type())
typedef struct _GstIndexEntry GstIndexEntry; typedef struct _GstIndexEntry GstIndexEntry;
typedef struct _GstIndexGroup GstIndexGroup; typedef struct _GstIndexGroup GstIndexGroup;
typedef struct _GstIndex GstIndex; typedef struct _GstIndex GstIndex;
@ -229,6 +231,7 @@ GstIndexEntry* gst_index_get_assoc_entry_full (GstIndex *index, gint id,
gpointer user_data); gpointer user_data);
/* working with index entries */ /* working with index entries */
GType gst_index_entry_get_type (void);
GstIndexEntry * gst_index_entry_copy (GstIndexEntry *entry); GstIndexEntry * gst_index_entry_copy (GstIndexEntry *entry);
void gst_index_entry_free (GstIndexEntry *entry); void gst_index_entry_free (GstIndexEntry *entry);
gboolean gst_index_entry_assoc_map (GstIndexEntry *entry, gboolean gst_index_entry_assoc_map (GstIndexEntry *entry,

View file

@ -2,11 +2,13 @@ VOID:VOID
VOID:BOOLEAN VOID:BOOLEAN
VOID:INT VOID:INT
VOID:STRING VOID:STRING
VOID:BOXED
VOID:POINTER VOID:POINTER
VOID:POINTER,OBJECT VOID:POINTER,OBJECT
VOID:OBJECT VOID:OBJECT
VOID:OBJECT,PARAM VOID:OBJECT,PARAM
VOID:OBJECT,POINTER VOID:OBJECT,POINTER
VOID:OBJECT,BOXED
VOID:OBJECT,POINTER,STRING VOID:OBJECT,POINTER,STRING
VOID:OBJECT,STRING VOID:OBJECT,STRING
VOID:INT,INT VOID:INT,INT
@ -16,3 +18,4 @@ VOID:UINT,POINTER
BOOLEAN:VOID BOOLEAN:VOID
BOOLEAN:POINTER BOOLEAN:POINTER
POINTER:POINTER POINTER:POINTER
BOXED:BOXED

View file

@ -113,7 +113,6 @@ gst_pad_dispose (GObject *object)
/***** Then do the Real Pad *****/ /***** Then do the Real Pad *****/
/* Pad signals and args */ /* Pad signals and args */
enum { enum {
REAL_CAPS_NEGO_FAILED,
REAL_LINKED, REAL_LINKED,
REAL_UNLINKED, REAL_UNLINKED,
REAL_FIXATE, REAL_FIXATE,
@ -177,11 +176,6 @@ gst_real_pad_class_init (GstRealPadClass *klass)
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_real_pad_set_property); gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_real_pad_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_real_pad_get_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_real_pad_get_property);
gst_real_pad_signals[REAL_CAPS_NEGO_FAILED] =
g_signal_new ("caps_nego_failed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstRealPadClass, caps_nego_failed), NULL, NULL,
gst_marshal_VOID__POINTER, G_TYPE_NONE, 1,
G_TYPE_POINTER);
gst_real_pad_signals[REAL_LINKED] = gst_real_pad_signals[REAL_LINKED] =
g_signal_new ("linked", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, g_signal_new ("linked", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstRealPadClass, linked), NULL, NULL, G_STRUCT_OFFSET (GstRealPadClass, linked), NULL, NULL,
@ -196,8 +190,8 @@ gst_real_pad_class_init (GstRealPadClass *klass)
g_signal_new ("fixate", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, g_signal_new ("fixate", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstRealPadClass, appfixatefunc), G_STRUCT_OFFSET (GstRealPadClass, appfixatefunc),
_gst_real_pad_fixate_accumulator, NULL, _gst_real_pad_fixate_accumulator, NULL,
gst_marshal_POINTER__POINTER, G_TYPE_POINTER, 1, gst_marshal_BOXED__BOXED, GST_TYPE_CAPS, 1,
G_TYPE_POINTER); GST_TYPE_CAPS | G_SIGNAL_TYPE_STATIC_SCOPE);
/* gtk_object_add_arg_type ("GstRealPad::active", G_TYPE_BOOLEAN, */ /* gtk_object_add_arg_type ("GstRealPad::active", G_TYPE_BOOLEAN, */
/* GTK_ARG_READWRITE, REAL_ARG_ACTIVE); */ /* GTK_ARG_READWRITE, REAL_ARG_ACTIVE); */
@ -218,7 +212,7 @@ static gboolean
_gst_real_pad_fixate_accumulator (GSignalInvocationHint *ihint, _gst_real_pad_fixate_accumulator (GSignalInvocationHint *ihint,
GValue *return_accu, const GValue *handler_return, gpointer dummy) GValue *return_accu, const GValue *handler_return, gpointer dummy)
{ {
if (g_value_get_pointer (handler_return)) { if (gst_value_get_caps (handler_return)) {
g_value_copy (handler_return, return_accu); g_value_copy (handler_return, return_accu);
/* stop emission if something was returned */ /* stop emission if something was returned */
return FALSE; return FALSE;
@ -1178,7 +1172,7 @@ gst_pad_link_fixate (GstPadLink *link)
case 4: case 4:
newcaps = _gst_pad_default_fixate_func ( newcaps = _gst_pad_default_fixate_func (
GST_PAD(link->srcpad), caps); GST_PAD(link->srcpad), caps);
GST_DEBUG ("core fixated to % "GST_PTR_FORMAT, newcaps); GST_DEBUG ("core fixated to %"GST_PTR_FORMAT, newcaps);
break; break;
} }
if (newcaps) { if (newcaps) {
@ -2723,32 +2717,6 @@ gst_pad_caps_change_notify (GstPad *pad)
gboolean gboolean
gst_pad_recover_caps_error (GstPad *pad, const GstCaps *allowed) gst_pad_recover_caps_error (GstPad *pad, const GstCaps *allowed)
{ {
#if 0
/* FIXME */
GstElement *parent;
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
/* see if someone can resolve this */
if (g_signal_has_handler_pending (G_OBJECT (pad),
gst_real_pad_signals[REAL_CAPS_NEGO_FAILED], 0, FALSE))
{
/* clear pad caps first */
gst_caps_replace (&GST_PAD_CAPS (pad), NULL);
/* lets hope some signal manages to set the caps again */
g_signal_emit (G_OBJECT (pad), gst_real_pad_signals[REAL_CAPS_NEGO_FAILED], 0, allowed);
/* if the pad has caps now or is disabled, it's ok */
if (GST_PAD_CAPS (pad) != NULL || !GST_PAD_IS_ACTIVE (pad))
return TRUE;
}
/* report error */
parent = gst_pad_get_parent (pad);
GST_ELEMENT_ERROR (parent, CORE, PAD, (NULL),
("negotiation failed on pad %s:%s", GST_DEBUG_PAD_NAME (pad)));
#endif
return FALSE; return FALSE;
} }

View file

@ -49,10 +49,7 @@ static GstStructureField *gst_structure_id_get_field(const GstStructure *structu
static void _gst_structure_transform_to_string(const GValue *src_value, static void _gst_structure_transform_to_string(const GValue *src_value,
GValue *dest_value); GValue *dest_value);
static void _gst_structure_value_init (GValue *value); static GstStructure *_gst_structure_copy_conditional (const GstStructure *structure);
static void _gst_structure_value_free (GValue *value);
static void _gst_structure_value_copy (const GValue *src, GValue *dest);
static gpointer _gst_structure_value_peek_pointer (const GValue *value);
GType gst_structure_get_type(void) GType gst_structure_get_type(void)
@ -62,36 +59,9 @@ GType gst_structure_get_type(void)
void _gst_structure_initialize(void) void _gst_structure_initialize(void)
{ {
static const GTypeValueTable type_value_table = {
_gst_structure_value_init,
_gst_structure_value_free,
_gst_structure_value_copy,
_gst_structure_value_peek_pointer,
NULL,
NULL,
NULL,
NULL,
};
static const GTypeInfo structure_info = {
0,
NULL,
NULL,
NULL,
NULL,
NULL,
0, /* sizeof(GstStructure), */
0,
NULL, /* _gst_structure_init, */
&type_value_table,
};
_gst_structure_type = g_type_register_static(G_TYPE_BOXED, "GstStructure",
&structure_info, 0);
#if 0
_gst_structure_type = g_boxed_type_register_static("GstStructure", _gst_structure_type = g_boxed_type_register_static("GstStructure",
(GBoxedCopyFunc) gst_structure_copy, (GBoxedCopyFunc) _gst_structure_copy_conditional,
(GBoxedFreeFunc) gst_structure_free); (GBoxedFreeFunc) gst_structure_free);
#endif
g_value_register_transform_func(_gst_structure_type, G_TYPE_STRING, g_value_register_transform_func(_gst_structure_type, G_TYPE_STRING,
_gst_structure_transform_to_string); _gst_structure_transform_to_string);
@ -202,7 +172,7 @@ GstStructure *gst_structure_new_valist(const gchar *name,
* *
* Returns: a new #GstStructure. * Returns: a new #GstStructure.
*/ */
GstStructure *gst_structure_copy(GstStructure *structure) GstStructure *gst_structure_copy(const GstStructure *structure)
{ {
GstStructure *new_structure; GstStructure *new_structure;
GstStructureField *field; GstStructureField *field;
@ -1390,25 +1360,9 @@ _gst_structure_transform_to_string(const GValue *src_value, GValue *dest_value)
gst_structure_to_string (src_value->data[0].v_pointer); gst_structure_to_string (src_value->data[0].v_pointer);
} }
static GstStructure *_gst_structure_copy_conditional (const GstStructure *structure)
static void _gst_structure_value_init (GValue *value)
{ {
value->data[0].v_pointer = gst_structure_empty_new(""); if (structure) return gst_structure_copy (structure);
} return NULL;
static void _gst_structure_value_free (GValue *value)
{
gst_structure_free(value->data[0].v_pointer);
}
static void _gst_structure_value_copy (const GValue *src, GValue *dest)
{
dest->data[0].v_pointer = gst_structure_copy(src->data[0].v_pointer);
}
static gpointer _gst_structure_value_peek_pointer (const GValue *value)
{
return value->data[0].v_pointer;
} }

View file

@ -49,7 +49,7 @@ GstStructure *gst_structure_new(const gchar *name,
const gchar *firstfield, ...); const gchar *firstfield, ...);
GstStructure *gst_structure_new_valist(const gchar *name, GstStructure *gst_structure_new_valist(const gchar *name,
const gchar *firstfield, va_list varargs); const gchar *firstfield, va_list varargs);
GstStructure *gst_structure_copy(GstStructure *structure); GstStructure *gst_structure_copy(const GstStructure *structure);
void gst_structure_free(GstStructure *structure); void gst_structure_free(GstStructure *structure);
G_CONST_RETURN gchar *gst_structure_get_name(const GstStructure *structure); G_CONST_RETURN gchar *gst_structure_get_name(const GstStructure *structure);

View file

@ -51,6 +51,25 @@ static GHashTable *__tags;
#define TAG_LOCK g_mutex_lock (__tag_mutex) #define TAG_LOCK g_mutex_lock (__tag_mutex)
#define TAG_UNLOCK g_mutex_unlock (__tag_mutex) #define TAG_UNLOCK g_mutex_unlock (__tag_mutex)
GType
gst_tag_list_get_type (void)
{
static GType _gst_tag_list_type;
if (_gst_tag_list_type == 0) {
_gst_tag_list_type = g_boxed_type_register_static ("GstTagList",
(GBoxedCopyFunc) gst_tag_list_copy,
(GBoxedFreeFunc) gst_tag_list_free);
#if 0
g_value_register_transform_func(_gst_tag_list_type, G_TYPE_STRING,
_gst_structure_transform_to_string);
#endif
}
return _gst_tag_list_type;
}
void void
_gst_tag_initialize (void) _gst_tag_initialize (void)
{ {

View file

@ -53,12 +53,14 @@ typedef enum {
typedef GstStructure GstTagList; typedef GstStructure GstTagList;
#define GST_TAG_LIST(x) ((GstTagList *) (x)) #define GST_TAG_LIST(x) ((GstTagList *) (x))
#define GST_IS_TAG_LIST(x) (gst_is_tag_list (GST_TAG_LIST (x))) #define GST_IS_TAG_LIST(x) (gst_is_tag_list (GST_TAG_LIST (x)))
#define GST_TYPE_TAG_LIST (gst_tag_list_get_type ())
typedef void (* GstTagForeachFunc) (const GstTagList *list, const gchar *tag, gpointer user_data); typedef void (* GstTagForeachFunc) (const GstTagList *list, const gchar *tag, gpointer user_data);
typedef void (* GstTagMergeFunc) (GValue *dest, const GValue *src); typedef void (* GstTagMergeFunc) (GValue *dest, const GValue *src);
/* initialize tagging system */ /* initialize tagging system */
void _gst_tag_initialize (void); void _gst_tag_initialize (void);
GType gst_tag_list_get_type (void);
void gst_tag_register (gchar * name, void gst_tag_register (gchar * name,
GstTagFlag flag, GstTagFlag flag,

View file

@ -51,6 +51,25 @@ static GHashTable *__tags;
#define TAG_LOCK g_mutex_lock (__tag_mutex) #define TAG_LOCK g_mutex_lock (__tag_mutex)
#define TAG_UNLOCK g_mutex_unlock (__tag_mutex) #define TAG_UNLOCK g_mutex_unlock (__tag_mutex)
GType
gst_tag_list_get_type (void)
{
static GType _gst_tag_list_type;
if (_gst_tag_list_type == 0) {
_gst_tag_list_type = g_boxed_type_register_static ("GstTagList",
(GBoxedCopyFunc) gst_tag_list_copy,
(GBoxedFreeFunc) gst_tag_list_free);
#if 0
g_value_register_transform_func(_gst_tag_list_type, G_TYPE_STRING,
_gst_structure_transform_to_string);
#endif
}
return _gst_tag_list_type;
}
void void
_gst_tag_initialize (void) _gst_tag_initialize (void)
{ {

View file

@ -53,12 +53,14 @@ typedef enum {
typedef GstStructure GstTagList; typedef GstStructure GstTagList;
#define GST_TAG_LIST(x) ((GstTagList *) (x)) #define GST_TAG_LIST(x) ((GstTagList *) (x))
#define GST_IS_TAG_LIST(x) (gst_is_tag_list (GST_TAG_LIST (x))) #define GST_IS_TAG_LIST(x) (gst_is_tag_list (GST_TAG_LIST (x)))
#define GST_TYPE_TAG_LIST (gst_tag_list_get_type ())
typedef void (* GstTagForeachFunc) (const GstTagList *list, const gchar *tag, gpointer user_data); typedef void (* GstTagForeachFunc) (const GstTagList *list, const gchar *tag, gpointer user_data);
typedef void (* GstTagMergeFunc) (GValue *dest, const GValue *src); typedef void (* GstTagMergeFunc) (GValue *dest, const GValue *src);
/* initialize tagging system */ /* initialize tagging system */
void _gst_tag_initialize (void); void _gst_tag_initialize (void);
GType gst_tag_list_get_type (void);
void gst_tag_register (gchar * name, void gst_tag_register (gchar * name,
GstTagFlag flag, GstTagFlag flag,

View file

@ -96,8 +96,8 @@ gst_multifilesrc_class_init (GstMultiFileSrcClass *klass)
gst_multifilesrc_signals[NEW_FILE] = gst_multifilesrc_signals[NEW_FILE] =
g_signal_new ("new_file", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, g_signal_new ("new_file", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstMultiFileSrcClass, new_file), NULL, NULL, G_STRUCT_OFFSET (GstMultiFileSrcClass, new_file), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1,
G_TYPE_POINTER); G_TYPE_STRING);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOCATIONS, g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOCATIONS,
g_param_spec_pointer("locations","locations","locations", g_param_spec_pointer("locations","locations","locations",

View file

@ -158,8 +158,8 @@ gst_type_find_element_class_init (GstTypeFindElementClass *typefind_class)
gst_type_find_element_signals[HAVE_TYPE] = g_signal_new ("have_type", gst_type_find_element_signals[HAVE_TYPE] = g_signal_new ("have_type",
G_TYPE_FROM_CLASS (typefind_class), G_SIGNAL_RUN_LAST, G_TYPE_FROM_CLASS (typefind_class), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstTypeFindElementClass, have_type), NULL, NULL, G_STRUCT_OFFSET (GstTypeFindElementClass, have_type), NULL, NULL,
gst_marshal_VOID__UINT_POINTER, G_TYPE_NONE, 2, gst_marshal_VOID__UINT_BOXED, G_TYPE_NONE, 2,
G_TYPE_UINT, G_TYPE_POINTER); G_TYPE_UINT, GST_TYPE_CAPS | G_SIGNAL_TYPE_STATIC_SCOPE);
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_type_find_element_change_state); gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_type_find_element_change_state);
} }