diff --git a/ChangeLog b/ChangeLog index ae36ef4b69..f3fa29590e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2004-02-05 Thomas Vander Stichele + + * gst/gstcaps.h: + * gst/gstelement.c: (gst_element_base_class_init), + (gst_element_class_set_details), (gst_element_clear_pad_caps): + * gst/gstpad.c: (gst_pad_link_intersect), (gst_pad_link_fixate), + (gst_pad_try_set_caps), (gst_pad_can_link_filtered), + (gst_real_pad_dispose): + * gst/gststructure.c: (gst_structure_free), + (gst_structure_from_string): + revert patch that breaks applications, reapply after release + to get this fixed properly + 2004-02-05 Benjamin Otte * gst/gsttag.c: (_gst_tag_initialize): diff --git a/gst/gstcaps.h b/gst/gstcaps.h index fcf44a68e9..aac52e5c77 100644 --- a/gst/gstcaps.h +++ b/gst/gstcaps.h @@ -58,10 +58,12 @@ struct _GstStaticCaps { #define GST_TYPE_CAPS gst_caps_get_type() -#ifndef GST_DISABLE_DEPRECATED -#define GST_DEBUG_CAPS(string, caps) \ - GST_DEBUG ( string "%s: " GST_PTR_FORMAT, caps) -#endif +/* FIXME Company should decide the best way to do this */ +#define GST_DEBUG_CAPS(string, caps) do { \ + char *s = gst_caps_to_string(caps); \ + GST_DEBUG ( "%s: %s", (string), s); \ + g_free(s); \ +}while(0) void _gst_caps_initialize (void); diff --git a/gst/gstelement.c b/gst/gstelement.c index afbcc78082..f73ca65e77 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -53,7 +53,7 @@ enum { }; extern void __gst_element_details_clear (GstElementDetails *dp); -extern void __gst_element_details_copy (GstElementDetails *dest, +extern void __gst_element_details_set (GstElementDetails *dest, const GstElementDetails *src); static void gst_element_class_init (GstElementClass *klass); @@ -172,7 +172,6 @@ gst_element_base_class_init (gpointer g_class) gobject_class->set_property = GST_DEBUG_FUNCPTR(gst_element_real_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR(gst_element_real_get_property); - memset (&element_class->details, 0, sizeof (GstElementDetails)); element_class->padtemplates = NULL; } @@ -1383,7 +1382,7 @@ gst_element_class_set_details (GstElementClass *klass, const GstElementDetails * g_return_if_fail (GST_IS_ELEMENT_CLASS (klass)); g_return_if_fail (GST_IS_ELEMENT_DETAILS (details)); - __gst_element_details_copy (&klass->details, details); + __gst_element_details_set (&klass->details, details); } /** @@ -2757,9 +2756,6 @@ gst_element_clear_pad_caps (GstElement *element) GstPad *pad = GST_PAD (pads->data); gst_pad_unnegotiate (pad); - if (GST_IS_REAL_PAD (pad)){ - gst_caps_replace (&GST_RPAD_EXPLICIT_CAPS (pad), NULL); - } pads = g_list_next (pads); } diff --git a/gst/gstpad.c b/gst/gstpad.c index cfaeeaaa3d..0fb5331a74 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -35,6 +35,9 @@ #define GST_CAT_DEFAULT GST_CAT_PADS +/* FIXME */ +#define gst_caps_debug(a,b) GST_DEBUG_CAPS(b,a) + enum { TEMPL_PAD_CREATED, @@ -1043,21 +1046,21 @@ static void gst_pad_link_intersect (GstPadLink *link) GST_DEBUG ("intersecting link from %s:%s to %s:%s", GST_DEBUG_PAD_NAME (link->srcpad), GST_DEBUG_PAD_NAME (link->sinkpad)); - GST_DEBUG ("srccaps " GST_PTR_FORMAT, link->srccaps); - GST_DEBUG ("sinkcaps " GST_PTR_FORMAT, link->sinkcaps); - GST_DEBUG ("filtercaps " GST_PTR_FORMAT, link->filtercaps); + GST_DEBUG_CAPS ("srccaps", link->srccaps); + GST_DEBUG_CAPS ("sinkcaps", link->sinkcaps); + GST_DEBUG_CAPS ("filtercaps", link->filtercaps); pad_intersection = gst_caps_intersect (link->srccaps, link->sinkcaps); if (link->filtercaps) { - GST_DEBUG ("unfiltered intersection " GST_PTR_FORMAT, pad_intersection); + GST_DEBUG_CAPS ("unfiltered intersection", pad_intersection); link->caps = gst_caps_intersect (pad_intersection, link->filtercaps); gst_caps_free (pad_intersection); } else { link->caps = pad_intersection; } - GST_DEBUG ("intersection " GST_PTR_FORMAT, link->caps); + GST_DEBUG_CAPS ("intersection", link->caps); } static gboolean @@ -1092,7 +1095,7 @@ gst_pad_link_fixate (GstPadLink *link) g_return_if_fail (caps != NULL); g_return_if_fail (!gst_caps_is_empty(caps)); - GST_DEBUG ("trying to fixate caps " GST_PTR_FORMAT, caps); + GST_DEBUG_CAPS ("trying to fixate caps", caps); while (!gst_caps_is_fixed (caps)) { int i; @@ -1103,31 +1106,31 @@ gst_pad_link_fixate (GstPadLink *link) case 0: g_signal_emit (G_OBJECT (link->srcpad), gst_real_pad_signals[REAL_FIXATE], 0, caps, &newcaps); - GST_DEBUG ("app srcpad signal fixated to " GST_PTR_FORMAT, newcaps); + GST_DEBUG_CAPS ("app srcpad signal fixated to", newcaps); break; case 1: g_signal_emit (G_OBJECT (link->sinkpad), gst_real_pad_signals[REAL_FIXATE], 0, caps, &newcaps); - GST_DEBUG ("app sinkpad signal fixated to " GST_PTR_FORMAT, newcaps); + GST_DEBUG_CAPS ("app sinkpad signal fixated to", newcaps); break; case 2: if (GST_RPAD_FIXATEFUNC(link->srcpad)) { newcaps = GST_RPAD_FIXATEFUNC(link->srcpad) ( GST_PAD (link->srcpad), caps); - GST_DEBUG ("srcpad fixated to " GST_PTR_FORMAT, newcaps); + GST_DEBUG_CAPS ("srcpad fixated to", newcaps); } break; case 3: if (GST_RPAD_FIXATEFUNC(link->sinkpad)) { newcaps = GST_RPAD_FIXATEFUNC(link->sinkpad) ( GST_PAD (link->sinkpad), caps); - GST_DEBUG ("sinkpad fixated to " GST_PTR_FORMAT, newcaps); + GST_DEBUG_CAPS ("sinkpad fixated to", newcaps); } break; case 4: newcaps = _gst_pad_default_fixate_func ( GST_PAD(link->srcpad), caps); - GST_DEBUG ("core fixated to GST_PTR_FORMAT", newcaps); + GST_DEBUG_CAPS ("core fixated to", newcaps); break; } if (newcaps) { @@ -1329,7 +1332,7 @@ gst_pad_try_set_caps (GstPad *pad, const GstCaps *caps) g_warning ("trying to set non fixed caps on pad %s:%s, not allowed", GST_DEBUG_PAD_NAME (pad)); - GST_DEBUG ("unfixed caps " GST_PTR_FORMAT, caps); + gst_caps_debug (caps, "unfixed caps"); return GST_PAD_LINK_REFUSED; } @@ -1536,12 +1539,9 @@ gst_pad_can_link_filtered (GstPad *srcpad, GstPad *sinkpad, if (filtercaps) link->filtercaps = gst_caps_copy (filtercaps); gst_pad_link_intersect (link); - if (gst_caps_is_empty (link->caps)) { - gst_pad_link_free (link); + if (gst_caps_is_empty (link->caps)) return FALSE; - } - gst_pad_link_free (link); return TRUE; } @@ -2716,11 +2716,6 @@ gst_real_pad_dispose (GObject *object) gst_element_remove_pad (GST_ELEMENT (GST_OBJECT_PARENT (pad)), pad); } - if (GST_RPAD_EXPLICIT_CAPS (pad)) { - GST_ERROR_OBJECT (pad, "still explicit caps %"GST_PTR_FORMAT" set", GST_RPAD_EXPLICIT_CAPS (pad)); - g_warning ("pad %p has still explicit caps set", pad); - gst_caps_replace (&GST_RPAD_EXPLICIT_CAPS (pad), NULL); - } G_OBJECT_CLASS (real_pad_parent_class)->dispose (object); } diff --git a/gst/gststructure.c b/gst/gststructure.c index 7e1cb0ea13..d593371ce1 100644 --- a/gst/gststructure.c +++ b/gst/gststructure.c @@ -237,6 +237,8 @@ void gst_structure_free(GstStructure *structure) GstStructureField *field; int i; + return; + g_return_if_fail(structure != NULL); for(i=0;ifields->len;i++){ @@ -1335,8 +1337,9 @@ gst_structure_from_string (const gchar *string, gchar **end) char *w; char *r; char save; - GstStructure *structure = NULL; + GstStructure *structure; GstStructureField field = { 0 }; + gboolean res; g_return_val_if_fail(string != NULL, NULL); @@ -1344,11 +1347,11 @@ gst_structure_from_string (const gchar *string, gchar **end) r = copy; name = r; - if (!_gst_structure_parse_string (r, &w, &r)) - goto error; + res = _gst_structure_parse_string (r, &w, &r); + if (!res) return NULL; while (g_ascii_isspace(*r)) r++; - if(*r != 0 && *r != ';' && *r != ',') goto error; + if(*r != 0 && *r != ';' && *r != ',') return NULL; save = *w; *w = 0; @@ -1356,28 +1359,24 @@ gst_structure_from_string (const gchar *string, gchar **end) *w = save; while (*r && (*r != ';')){ - if(*r != ',') - goto error; + if(*r != ',') { + return NULL; + } r++; while (*r && g_ascii_isspace(*r)) r++; memset(&field,0,sizeof(field)); - if (!_gst_structure_parse_field (r, &r, &field)) - goto error; + res = _gst_structure_parse_field (r, &r, &field); + if (!res) { + gst_structure_free (structure); + return NULL; + } gst_structure_set_field(structure, &field); while (*r && g_ascii_isspace(*r)) r++; } if (end) *end = (char *)string + (r - copy); - - g_free (copy); return structure; - -error: - if (structure) - gst_structure_free (structure); - g_free (copy); - return NULL; } static void