Commit fc7dd46b authored by Wim Taymans's avatar Wim Taymans Committed by Wim Taymans
Browse files

avoid some more type checks

parent c059cb43
......@@ -515,7 +515,7 @@ gst_bin_init (GstBin * bin, GstBinClass * klass)
static void
gst_bin_dispose (GObject * object)
{
GstBin *bin = GST_BIN (object);
GstBin *bin = GST_BIN_CAST (object);
GstBus **child_bus_p = &bin->child_bus;
GstClock **provided_clock_p = &bin->provided_clock;
GstElement **clock_provider_p = &bin->clock_provider;
......@@ -562,7 +562,7 @@ gst_bin_set_property (GObject * object, guint prop_id,
{
GstBin *gstbin;
gstbin = GST_BIN (object);
gstbin = GST_BIN_CAST (object);
switch (prop_id) {
case PROP_ASYNC_HANDLING:
......@@ -582,7 +582,7 @@ gst_bin_get_property (GObject * object, guint prop_id,
{
GstBin *gstbin;
gstbin = GST_BIN (object);
gstbin = GST_BIN_CAST (object);
switch (prop_id) {
case PROP_ASYNC_HANDLING:
......@@ -603,7 +603,7 @@ gst_bin_get_index_func (GstElement * element)
GstBin *bin;
GstIndex *result;
bin = GST_BIN (element);
bin = GST_BIN_CAST (element);
GST_OBJECT_LOCK (bin);
if ((result = bin->priv->index))
......@@ -625,7 +625,7 @@ gst_bin_set_index_func (GstElement * element, GstIndex * index)
GstIterator *it;
GstIndex *old;
bin = GST_BIN (element);
bin = GST_BIN_CAST (element);
GST_OBJECT_LOCK (bin);
old = bin->priv->index;
......@@ -691,7 +691,7 @@ gst_bin_set_clock_func (GstElement * element, GstClock * clock)
GstIterator *it;
gboolean res = TRUE;
bin = GST_BIN (element);
bin = GST_BIN_CAST (element);
it = gst_bin_iterate_elements (bin);
......@@ -746,7 +746,7 @@ gst_bin_provide_clock_func (GstElement * element)
GstClock **provided_clock_p;
GstElement **clock_provider_p;
bin = GST_BIN (element);
bin = GST_BIN_CAST (element);
GST_OBJECT_LOCK (bin);
if (!bin->clock_dirty)
......@@ -1036,7 +1036,7 @@ gst_bin_add_func (GstBin * bin, GstElement * element)
gst_element_set_bus (element, bin->child_bus);
/* propagate the current base_time, start_time and clock */
gst_element_set_base_time (element, GST_ELEMENT (bin)->base_time);
gst_element_set_base_time (element, GST_ELEMENT_CAST (bin)->base_time);
gst_element_set_start_time (element, GST_ELEMENT_START_TIME (bin));
/* it's possible that the element did not accept the clock but
* that is not important right now. When the pipeline goes to PLAYING,
......@@ -1508,7 +1508,7 @@ iterate_child_recurse (GstIterator * it, GstElement * child)
{
gst_object_ref (child);
if (GST_IS_BIN (child)) {
GstIterator *other = gst_bin_iterate_recurse (GST_BIN (child));
GstIterator *other = gst_bin_iterate_recurse (GST_BIN_CAST (child));
gst_iterator_push (it, other);
}
......@@ -2568,7 +2568,7 @@ activate_failure:
static gboolean
gst_bin_send_event (GstElement * element, GstEvent * event)
{
GstBin *bin = GST_BIN (element);
GstBin *bin = GST_BIN_CAST (element);
GstIterator *iter;
gboolean res = TRUE;
gboolean done = FALSE;
......@@ -3431,7 +3431,7 @@ bin_query_generic_fold (GstElement * item, GValue * ret, QueryFold * fold)
static gboolean
gst_bin_query (GstElement * element, GstQuery * query)
{
GstBin *bin = GST_BIN (element);
GstBin *bin = GST_BIN_CAST (element);
GstIterator *iter;
gboolean res = FALSE;
GstIteratorFoldFunction fold_func;
......@@ -3723,7 +3723,7 @@ gst_bin_iterate_all_by_interface (GstBin * bin, GType iface)
static xmlNodePtr
gst_bin_save_thyself (GstObject * object, xmlNodePtr parent)
{
GstBin *bin = GST_BIN (object);
GstBin *bin = GST_BIN_CAST (object);
xmlNodePtr childlist, elementnode;
GList *children;
GstElement *child;
......@@ -3738,7 +3738,7 @@ gst_bin_save_thyself (GstObject * object, xmlNodePtr parent)
children = g_list_last (bin->children);
while (children) {
child = GST_ELEMENT (children->data);
child = GST_ELEMENT_CAST (children->data);
elementnode = xmlNewChild (childlist, NULL, (xmlChar *) "element", NULL);
gst_object_save_thyself (GST_OBJECT (child), elementnode);
children = g_list_previous (children);
......@@ -3749,7 +3749,7 @@ gst_bin_save_thyself (GstObject * object, xmlNodePtr parent)
static void
gst_bin_restore_thyself (GstObject * object, xmlNodePtr self)
{
GstBin *bin = GST_BIN (object);
GstBin *bin = GST_BIN_CAST (object);
xmlNodePtr field = self->xmlChildrenNode;
xmlNodePtr childlist;
......
......@@ -2845,7 +2845,7 @@ gst_element_get_factory (GstElement * element)
static void
gst_element_dispose (GObject * object)
{
GstElement *element = GST_ELEMENT (object);
GstElement *element = GST_ELEMENT_CAST (object);
GstClock **clock_p;
GstBus **bus_p;
......@@ -2902,7 +2902,7 @@ not_null:
static void
gst_element_finalize (GObject * object)
{
GstElement *element = GST_ELEMENT (object);
GstElement *element = GST_ELEMENT_CAST (object);
GST_CAT_INFO_OBJECT (GST_CAT_REFCOUNTING, element, "finalize");
......@@ -2943,7 +2943,7 @@ gst_element_save_thyself (GstObject * object, xmlNodePtr parent)
g_return_val_if_fail (GST_IS_ELEMENT (object), parent);
element = GST_ELEMENT (object);
element = GST_ELEMENT_CAST (object);
oclass = GST_ELEMENT_GET_CLASS (element);
......@@ -3003,7 +3003,7 @@ gst_element_save_thyself (GstObject * object, xmlNodePtr parent)
GstPad *pad = GST_PAD_CAST (pads->data);
/* figure out if it's a direct pad or a ghostpad */
if (GST_ELEMENT (GST_OBJECT_PARENT (pad)) == element) {
if (GST_ELEMENT_CAST (GST_OBJECT_PARENT (pad)) == element) {
xmlNodePtr padtag = xmlNewChild (parent, NULL, (xmlChar *) "pad", NULL);
gst_object_save_thyself (GST_OBJECT_CAST (pad), padtag);
......@@ -3022,7 +3022,7 @@ gst_element_restore_thyself (GstObject * object, xmlNodePtr self)
gchar *name = NULL;
gchar *value = NULL;
element = GST_ELEMENT (object);
element = GST_ELEMENT_CAST (object);
g_return_if_fail (element != NULL);
/* parameters */
......
......@@ -470,7 +470,7 @@ have_parent:
static void
gst_object_finalize (GObject * object)
{
GstObject *gstobject = GST_OBJECT (object);
GstObject *gstobject = GST_OBJECT_CAST (object);
GST_CAT_LOG_OBJECT (GST_CAT_REFCOUNTING, object, "finalize");
......@@ -945,7 +945,7 @@ gst_object_check_uniqueness (GList * list, const gchar * name)
GstObject *child;
gboolean eq;
child = GST_OBJECT (list->data);
child = GST_OBJECT_CAST (list->data);
GST_OBJECT_LOCK (child);
eq = strcmp (GST_OBJECT_NAME (child), name) == 0;
......@@ -1025,7 +1025,7 @@ gst_object_set_property (GObject * object, guint prop_id,
{
GstObject *gstobject;
gstobject = GST_OBJECT (object);
gstobject = GST_OBJECT_CAST (object);
switch (prop_id) {
case ARG_NAME:
......@@ -1043,7 +1043,7 @@ gst_object_get_property (GObject * object, guint prop_id,
{
GstObject *gstobject;
gstobject = GST_OBJECT (object);
gstobject = GST_OBJECT_CAST (object);
switch (prop_id) {
case ARG_NAME:
......
......@@ -384,7 +384,7 @@ gst_pad_init (GstPad * pad)
static void
gst_pad_dispose (GObject * object)
{
GstPad *pad = GST_PAD (object);
GstPad *pad = GST_PAD_CAST (object);
GstPad *peer;
GST_CAT_DEBUG_OBJECT (GST_CAT_REFCOUNTING, pad, "dispose");
......@@ -418,7 +418,7 @@ gst_pad_dispose (GObject * object)
static void
gst_pad_finalize (GObject * object)
{
GstPad *pad = GST_PAD (object);
GstPad *pad = GST_PAD_CAST (object);
GstTask *task;
/* in case the task is still around, clean it up */
......@@ -3424,7 +3424,7 @@ gst_pad_event_default_dispatch (GstPad * pad, GstEvent * event)
while (!done) {
switch (gst_iterator_next (iter, &item)) {
case GST_ITERATOR_OK:
eventpad = GST_PAD (item);
eventpad = GST_PAD_CAST (item);
/* if already pushed, skip */
if (g_list_find (pushed_pads, eventpad)) {
......@@ -3808,7 +3808,7 @@ gst_pad_save_thyself (GstObject * object, xmlNodePtr parent)
g_return_val_if_fail (GST_IS_PAD (object), NULL);
pad = GST_PAD (object);
pad = GST_PAD_CAST (object);
xmlNewChild (parent, NULL, (xmlChar *) "name",
(xmlChar *) GST_PAD_NAME (pad));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment