+2004-02-05 Thomas Vander Stichele <thomas at apestaart dot org>
+
+ * 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 <in7y118@public.uni-hamburg.de>
* gst/gsttag.c: (_gst_tag_initialize):
};
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);
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;
}
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);
}
/**
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);
}
#define GST_CAT_DEFAULT GST_CAT_PADS
+/* FIXME */
+#define gst_caps_debug(a,b) GST_DEBUG_CAPS(b,a)
+
enum {
TEMPL_PAD_CREATED,
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
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;
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) {
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;
}
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;
}
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);
}
GstStructureField *field;
int i;
+ return;
+
g_return_if_fail(structure != NULL);
for(i=0;i<structure->fields->len;i++){
char *w;
char *r;
char save;
- GstStructure *structure = NULL;
+ GstStructure *structure;
GstStructureField field = { 0 };
+ gboolean res;
g_return_val_if_fail(string != NULL, NULL);
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;
*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