[456/906] glfilter/glmixer/gltestsrc/glupload: throw an element error if no parent bin

Fixes bug #602153
This commit is contained in:
Julien Isorce 2010-05-05 11:21:31 +02:00 committed by Tim-Philipp Müller
parent ade2526b8f
commit 769e43a2e0
2 changed files with 28 additions and 10 deletions

View file

@ -238,11 +238,20 @@ gst_gl_filter_start (GstBaseTransform * bt)
GstGLFilter *filter = GST_GL_FILTER (bt); GstGLFilter *filter = GST_GL_FILTER (bt);
GstGLFilterClass *filter_class = GST_GL_FILTER_GET_CLASS (filter); GstGLFilterClass *filter_class = GST_GL_FILTER_GET_CLASS (filter);
GstElement *parent = GST_ELEMENT (gst_element_get_parent (filter)); GstElement *parent = GST_ELEMENT (gst_element_get_parent (filter));
GstStructure *structure = GstStructure *structure = NULL;
gst_structure_new (gst_element_get_name (filter), NULL); GstQuery *query = NULL;
GstQuery *query = gst_query_new_application (GST_QUERY_CUSTOM, structure); gboolean isPerformed = FALSE;
gboolean isPerformed = gst_element_query (parent, query); if (!parent) {
GST_ELEMENT_ERROR (filter, CORE, STATE_CHANGE, (NULL),
("A parent bin is required"));
return FALSE;
}
structure = gst_structure_new (gst_element_get_name (filter), NULL);
query = gst_query_new_application (GST_QUERY_CUSTOM, structure);
isPerformed = gst_element_query (parent, query);
if (isPerformed) { if (isPerformed) {
const GValue *id_value = const GValue *id_value =

View file

@ -1243,12 +1243,21 @@ gst_gl_mixer_change_state (GstElement * element, GstStateChange transition)
gint i = 0; gint i = 0;
GstElement *parent = GST_ELEMENT (gst_element_get_parent (mix)); GstElement *parent = GST_ELEMENT (gst_element_get_parent (mix));
GstStructure *structure = GstStructure *structure = NULL;
gst_structure_new (gst_element_get_name (mix), NULL); GstQuery *query = NULL;
GstQuery *query = gst_query_new_application (GST_QUERY_CUSTOM, structure); gboolean isPerformed = FALSE;
if (!parent) {
GST_ELEMENT_ERROR (mix, CORE, STATE_CHANGE, (NULL),
("A parent bin is required"));
return FALSE;
}
structure = gst_structure_new (gst_element_get_name (mix), NULL);
query = gst_query_new_application (GST_QUERY_CUSTOM, structure);
/* retrieve the gldisplay that is owned by gl elements after the gl mixer */ /* retrieve the gldisplay that is owned by gl elements after the gl mixer */
gboolean isPerformed = gst_element_query (parent, query); isPerformed = gst_element_query (parent, query);
if (isPerformed) { if (isPerformed) {
const GValue *id_value = const GValue *id_value =