element: Remove GstContext caching

This commit is contained in:
Sebastian Dröge 2013-09-17 13:12:28 +02:00
parent e3ce799217
commit 014690326f
3 changed files with 1 additions and 44 deletions

View file

@ -1165,9 +1165,6 @@ gst_bin_add_func (GstBin * bin, GstElement * element)
* a new clock will be selected */
gst_element_set_clock (element, GST_ELEMENT_CLOCK (bin));
if (GST_ELEMENT_CAST (bin)->context)
gst_element_set_context (element, GST_ELEMENT_CAST (bin)->context);
#if 0
/* set the cached index on the children */
if (bin->priv->index)

View file

@ -136,8 +136,6 @@ static gboolean gst_element_set_clock_func (GstElement * element,
static void gst_element_set_bus_func (GstElement * element, GstBus * bus);
static gboolean gst_element_post_message_default (GstElement * element,
GstMessage * message);
static void gst_element_set_context_func (GstElement * element,
GstContext * context);
static gboolean gst_element_default_send_event (GstElement * element,
GstEvent * event);
@ -244,7 +242,6 @@ gst_element_class_init (GstElementClass * klass)
klass->send_event = GST_DEBUG_FUNCPTR (gst_element_default_send_event);
klass->numpadtemplates = 0;
klass->post_message = GST_DEBUG_FUNCPTR (gst_element_post_message_default);
klass->set_context = GST_DEBUG_FUNCPTR (gst_element_set_context_func);
klass->elementfactory = NULL;
}
@ -2915,7 +2912,6 @@ gst_element_dispose (GObject * object)
bus_p = &element->bus;
gst_object_replace ((GstObject **) clock_p, NULL);
gst_object_replace ((GstObject **) bus_p, NULL);
gst_context_replace (&element->context, NULL);
GST_OBJECT_UNLOCK (element);
GST_CAT_INFO_OBJECT (GST_CAT_REFCOUNTING, element, "parent class dispose");
@ -3026,14 +3022,6 @@ gst_element_get_bus (GstElement * element)
return result;
}
static void
gst_element_set_context_func (GstElement * element, GstContext * context)
{
GST_OBJECT_LOCK (element);
gst_context_replace (&element->context, context);
GST_OBJECT_UNLOCK (element);
}
/**
* gst_element_set_context:
* @element: a #GstElement to set the context of.
@ -3059,28 +3047,3 @@ gst_element_set_context (GstElement * element, GstContext * context)
if (oclass->set_context)
oclass->set_context (element, context);
}
/**
* gst_element_get_context:
* @element: a #GstElement to get the context from.
*
* Gets the current context of the element.
*
* MT safe.
*
* Returns: (transfer full): The current context of the element
*/
GstContext *
gst_element_get_context (GstElement * element)
{
GstContext *context = NULL;
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
GST_OBJECT_LOCK (element);
if (element->context)
context = gst_context_ref (element->context);
GST_OBJECT_UNLOCK (element);
return context ? context : gst_context_new ();
}

View file

@ -568,10 +568,8 @@ struct _GstElement
GList *sinkpads;
guint32 pads_cookie;
GstContext *context;
/*< private >*/
gpointer _gst_reserved[GST_PADDING-1];
gpointer _gst_reserved[GST_PADDING];
};
/**
@ -744,7 +742,6 @@ GstBus * gst_element_get_bus (GstElement * element);
/* context */
void gst_element_set_context (GstElement * element, GstContext * context);
GstContext * gst_element_get_context (GstElement * element);
/* pad management */
gboolean gst_element_add_pad (GstElement *element, GstPad *pad);