revert patch that breaks applications revert this patch after release so everything can be fixed properly

Original commit message from CVS:
revert patch that breaks applications
revert this patch after release so everything can be fixed properly
This commit is contained in:
Thomas Vander Stichele 2004-02-05 13:32:09 +00:00
parent 2826ec0813
commit 6fb4c764af
5 changed files with 52 additions and 47 deletions

View file

@ -1,3 +1,16 @@
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> 2004-02-05 Benjamin Otte <in7y118@public.uni-hamburg.de>
* gst/gsttag.c: (_gst_tag_initialize): * gst/gsttag.c: (_gst_tag_initialize):

View file

@ -58,10 +58,12 @@ struct _GstStaticCaps {
#define GST_TYPE_CAPS gst_caps_get_type() #define GST_TYPE_CAPS gst_caps_get_type()
#ifndef GST_DISABLE_DEPRECATED /* FIXME Company should decide the best way to do this */
#define GST_DEBUG_CAPS(string, caps) \ #define GST_DEBUG_CAPS(string, caps) do { \
GST_DEBUG ( string "%s: " GST_PTR_FORMAT, caps) char *s = gst_caps_to_string(caps); \
#endif GST_DEBUG ( "%s: %s", (string), s); \
g_free(s); \
}while(0)
void _gst_caps_initialize (void); void _gst_caps_initialize (void);

View file

@ -53,7 +53,7 @@ enum {
}; };
extern void __gst_element_details_clear (GstElementDetails *dp); 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); const GstElementDetails *src);
static void gst_element_class_init (GstElementClass *klass); 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->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);
memset (&element_class->details, 0, sizeof (GstElementDetails));
element_class->padtemplates = NULL; 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_CLASS (klass));
g_return_if_fail (GST_IS_ELEMENT_DETAILS (details)); 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); GstPad *pad = GST_PAD (pads->data);
gst_pad_unnegotiate (pad); gst_pad_unnegotiate (pad);
if (GST_IS_REAL_PAD (pad)){
gst_caps_replace (&GST_RPAD_EXPLICIT_CAPS (pad), NULL);
}
pads = g_list_next (pads); pads = g_list_next (pads);
} }

View file

@ -35,6 +35,9 @@
#define GST_CAT_DEFAULT GST_CAT_PADS #define GST_CAT_DEFAULT GST_CAT_PADS
/* FIXME */
#define gst_caps_debug(a,b) GST_DEBUG_CAPS(b,a)
enum { enum {
TEMPL_PAD_CREATED, 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 ("intersecting link from %s:%s to %s:%s",
GST_DEBUG_PAD_NAME (link->srcpad), GST_DEBUG_PAD_NAME (link->sinkpad)); GST_DEBUG_PAD_NAME (link->srcpad), GST_DEBUG_PAD_NAME (link->sinkpad));
GST_DEBUG ("srccaps " GST_PTR_FORMAT, link->srccaps); GST_DEBUG_CAPS ("srccaps", link->srccaps);
GST_DEBUG ("sinkcaps " GST_PTR_FORMAT, link->sinkcaps); GST_DEBUG_CAPS ("sinkcaps", link->sinkcaps);
GST_DEBUG ("filtercaps " GST_PTR_FORMAT, link->filtercaps); GST_DEBUG_CAPS ("filtercaps", link->filtercaps);
pad_intersection = gst_caps_intersect (link->srccaps, link->sinkcaps); pad_intersection = gst_caps_intersect (link->srccaps, link->sinkcaps);
if (link->filtercaps) { 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); link->caps = gst_caps_intersect (pad_intersection, link->filtercaps);
gst_caps_free (pad_intersection); gst_caps_free (pad_intersection);
} else { } else {
link->caps = pad_intersection; link->caps = pad_intersection;
} }
GST_DEBUG ("intersection " GST_PTR_FORMAT, link->caps); GST_DEBUG_CAPS ("intersection", link->caps);
} }
static gboolean static gboolean
@ -1092,7 +1095,7 @@ gst_pad_link_fixate (GstPadLink *link)
g_return_if_fail (caps != NULL); g_return_if_fail (caps != NULL);
g_return_if_fail (!gst_caps_is_empty(caps)); 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)) { while (!gst_caps_is_fixed (caps)) {
int i; int i;
@ -1103,31 +1106,31 @@ gst_pad_link_fixate (GstPadLink *link)
case 0: case 0:
g_signal_emit (G_OBJECT (link->srcpad), g_signal_emit (G_OBJECT (link->srcpad),
gst_real_pad_signals[REAL_FIXATE], 0, caps, &newcaps); 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; break;
case 1: case 1:
g_signal_emit (G_OBJECT (link->sinkpad), g_signal_emit (G_OBJECT (link->sinkpad),
gst_real_pad_signals[REAL_FIXATE], 0, caps, &newcaps); 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; break;
case 2: case 2:
if (GST_RPAD_FIXATEFUNC(link->srcpad)) { if (GST_RPAD_FIXATEFUNC(link->srcpad)) {
newcaps = GST_RPAD_FIXATEFUNC(link->srcpad) ( newcaps = GST_RPAD_FIXATEFUNC(link->srcpad) (
GST_PAD (link->srcpad), caps); GST_PAD (link->srcpad), caps);
GST_DEBUG ("srcpad fixated to " GST_PTR_FORMAT, newcaps); GST_DEBUG_CAPS ("srcpad fixated to", newcaps);
} }
break; break;
case 3: case 3:
if (GST_RPAD_FIXATEFUNC(link->sinkpad)) { if (GST_RPAD_FIXATEFUNC(link->sinkpad)) {
newcaps = GST_RPAD_FIXATEFUNC(link->sinkpad) ( newcaps = GST_RPAD_FIXATEFUNC(link->sinkpad) (
GST_PAD (link->sinkpad), caps); GST_PAD (link->sinkpad), caps);
GST_DEBUG ("sinkpad fixated to " GST_PTR_FORMAT, newcaps); GST_DEBUG_CAPS ("sinkpad fixated to", newcaps);
} }
break; break;
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_CAPS ("core fixated to", newcaps);
break; break;
} }
if (newcaps) { 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", g_warning ("trying to set non fixed caps on pad %s:%s, not allowed",
GST_DEBUG_PAD_NAME (pad)); GST_DEBUG_PAD_NAME (pad));
GST_DEBUG ("unfixed caps " GST_PTR_FORMAT, caps); gst_caps_debug (caps, "unfixed caps");
return GST_PAD_LINK_REFUSED; 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); if (filtercaps) link->filtercaps = gst_caps_copy (filtercaps);
gst_pad_link_intersect (link); gst_pad_link_intersect (link);
if (gst_caps_is_empty (link->caps)) { if (gst_caps_is_empty (link->caps))
gst_pad_link_free (link);
return FALSE; return FALSE;
}
gst_pad_link_free (link);
return TRUE; return TRUE;
} }
@ -2716,11 +2716,6 @@ gst_real_pad_dispose (GObject *object)
gst_element_remove_pad (GST_ELEMENT (GST_OBJECT_PARENT (pad)), pad); 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); G_OBJECT_CLASS (real_pad_parent_class)->dispose (object);
} }

View file

@ -237,6 +237,8 @@ void gst_structure_free(GstStructure *structure)
GstStructureField *field; GstStructureField *field;
int i; int i;
return;
g_return_if_fail(structure != NULL); g_return_if_fail(structure != NULL);
for(i=0;i<structure->fields->len;i++){ for(i=0;i<structure->fields->len;i++){
@ -1335,8 +1337,9 @@ gst_structure_from_string (const gchar *string, gchar **end)
char *w; char *w;
char *r; char *r;
char save; char save;
GstStructure *structure = NULL; GstStructure *structure;
GstStructureField field = { 0 }; GstStructureField field = { 0 };
gboolean res;
g_return_val_if_fail(string != NULL, NULL); g_return_val_if_fail(string != NULL, NULL);
@ -1344,11 +1347,11 @@ gst_structure_from_string (const gchar *string, gchar **end)
r = copy; r = copy;
name = r; name = r;
if (!_gst_structure_parse_string (r, &w, &r)) res = _gst_structure_parse_string (r, &w, &r);
goto error; if (!res) return NULL;
while (g_ascii_isspace(*r)) r++; while (g_ascii_isspace(*r)) r++;
if(*r != 0 && *r != ';' && *r != ',') goto error; if(*r != 0 && *r != ';' && *r != ',') return NULL;
save = *w; save = *w;
*w = 0; *w = 0;
@ -1356,28 +1359,24 @@ gst_structure_from_string (const gchar *string, gchar **end)
*w = save; *w = save;
while (*r && (*r != ';')){ while (*r && (*r != ';')){
if(*r != ',') if(*r != ',') {
goto error; return NULL;
}
r++; r++;
while (*r && g_ascii_isspace(*r)) r++; while (*r && g_ascii_isspace(*r)) r++;
memset(&field,0,sizeof(field)); memset(&field,0,sizeof(field));
if (!_gst_structure_parse_field (r, &r, &field)) res = _gst_structure_parse_field (r, &r, &field);
goto error; if (!res) {
gst_structure_free (structure);
return NULL;
}
gst_structure_set_field(structure, &field); gst_structure_set_field(structure, &field);
while (*r && g_ascii_isspace(*r)) r++; while (*r && g_ascii_isspace(*r)) r++;
} }
if (end) *end = (char *)string + (r - copy); if (end) *end = (char *)string + (r - copy);
g_free (copy);
return structure; return structure;
error:
if (structure)
gst_structure_free (structure);
g_free (copy);
return NULL;
} }
static void static void