diff options
author | Andy Wingo <wingo@pobox.com> | 2005-06-28 09:59:01 +0000 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2005-06-28 09:59:01 +0000 |
commit | f8e79bdf867f94c6c80c5f43c60405659ed0be03 (patch) | |
tree | c5717a32e8d41a65b56cec6c03940e118dd29834 /gst | |
parent | 5016035bc6a4c5dfafb4170b54597b6c9d52a597 (diff) | |
download | gstreamer-f8e79bdf867f94c6c80c5f43c60405659ed0be03.tar.gz |
*.c: Don't cast to GST_OBJECT when reffing or unreffing. Large source-munging commit!!!
Original commit message from CVS:
2005-06-28 Andy Wingo <wingo@pobox.com>
* *.c: Don't cast to GST_OBJECT when reffing or unreffing. Large
source-munging commit!!!
Diffstat (limited to 'gst')
-rw-r--r-- | gst/elements/gsttypefindelement.c | 2 | ||||
-rw-r--r-- | gst/gstbin.c | 50 | ||||
-rw-r--r-- | gst/gstbus.c | 4 | ||||
-rw-r--r-- | gst/gstelement.c | 41 | ||||
-rw-r--r-- | gst/gstghostpad.c | 2 | ||||
-rw-r--r-- | gst/gstpad.c | 48 | ||||
-rw-r--r-- | gst/gstpipeline.c | 6 | ||||
-rw-r--r-- | gst/gstscheduler.c | 2 | ||||
-rw-r--r-- | gst/gstsystemclock.c | 4 | ||||
-rw-r--r-- | gst/gsturi.c | 2 | ||||
-rw-r--r-- | gst/gstutils.c | 74 | ||||
-rw-r--r-- | gst/schedulers/threadscheduler.c | 6 |
12 files changed, 121 insertions, 120 deletions
diff --git a/gst/elements/gsttypefindelement.c b/gst/elements/gsttypefindelement.c index 4fa1f3456d..e897bd14f5 100644 --- a/gst/elements/gsttypefindelement.c +++ b/gst/elements/gsttypefindelement.c @@ -795,7 +795,7 @@ gst_type_find_element_activate (GstPad * pad) gst_pad_query_position (peer, &format, NULL, &size); found_caps = gst_type_find_helper (peer, (guint64) size); - gst_object_unref (GST_OBJECT (peer)); + gst_object_unref (peer); } } diff --git a/gst/gstbin.c b/gst/gstbin.c index bcd27f3a4e..1cee4e8e8d 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -528,12 +528,12 @@ gst_bin_remove_func (GstBin * bin, GstElement * element) /* we ref here because after the _unparent() the element can be disposed * and we still need it to fire a signal. */ - gst_object_ref (GST_OBJECT_CAST (element)); + gst_object_ref (element); gst_object_unparent (GST_OBJECT_CAST (element)); g_signal_emit (G_OBJECT (bin), gst_bin_signals[ELEMENT_REMOVED], 0, element); /* element is really out of our control now */ - gst_object_unref (GST_OBJECT_CAST (element)); + gst_object_unref (element); return TRUE; @@ -598,7 +598,7 @@ no_function: static GstIteratorItem iterate_child (GstIterator * it, GstElement * child) { - gst_object_ref (GST_OBJECT (child)); + gst_object_ref (child); return GST_ITERATOR_ITEM_PASS; } @@ -626,7 +626,7 @@ gst_bin_iterate_elements (GstBin * bin) /* add ref because the iterator refs the bin. When the iterator * is freed it will unref the bin again using the provided dispose * function. */ - gst_object_ref (GST_OBJECT (bin)); + gst_object_ref (bin); result = gst_iterator_new_list (GST_GET_LOCK (bin), &bin->children_cookie, &bin->children, @@ -641,7 +641,7 @@ gst_bin_iterate_elements (GstBin * bin) static GstIteratorItem iterate_child_recurse (GstIterator * it, GstElement * child) { - gst_object_ref (GST_OBJECT (child)); + gst_object_ref (child); if (GST_IS_BIN (child)) { GstIterator *other = gst_bin_iterate_recurse (GST_BIN (child)); @@ -674,7 +674,7 @@ gst_bin_iterate_recurse (GstBin * bin) /* add ref because the iterator refs the bin. When the iterator * is freed it will unref the bin again using the provided dispose * function. */ - gst_object_ref (GST_OBJECT (bin)); + gst_object_ref (bin); result = gst_iterator_new_list (GST_GET_LOCK (bin), &bin->children_cookie, &bin->children, @@ -720,7 +720,7 @@ has_ancestor (GstObject * object, GstObject * ancestor) parent = gst_object_get_parent (object); result = has_ancestor (parent, ancestor); if (parent) - gst_object_unref (GST_OBJECT_CAST (parent)); + gst_object_unref (parent); return result; } @@ -757,7 +757,7 @@ bin_element_is_semi_sink (GstElement * child, GstBin * bin) if ((peer = gst_pad_get_peer (GST_PAD_CAST (pads->data)))) { connected_src = has_ancestor (GST_OBJECT_CAST (peer), GST_OBJECT_CAST (bin)); - gst_object_unref (GST_OBJECT_CAST (peer)); + gst_object_unref (peer); if (connected_src) { break; } @@ -871,14 +871,14 @@ restart: while (children) { GstElement *child = GST_ELEMENT_CAST (children->data); - gst_object_ref (GST_OBJECT_CAST (child)); + gst_object_ref (child); /* now we release the lock to enter a non blocking wait. We * release the lock anyway since we can. */ GST_UNLOCK (bin); ret = gst_element_get_state (child, NULL, NULL, &tv); - gst_object_unref (GST_OBJECT_CAST (child)); + gst_object_unref (child); /* now grab the lock to iterate to the next child */ GST_LOCK (bin); @@ -932,7 +932,7 @@ restart: while (children) { GstElement *child = GST_ELEMENT_CAST (children->data); - gst_object_ref (GST_OBJECT_CAST (child)); + gst_object_ref (child); /* now we release the lock to enter the potentialy blocking wait */ GST_UNLOCK (bin); @@ -940,7 +940,7 @@ restart: * ater the timeout. */ ret = gst_element_get_state (child, NULL, NULL, timeout); - gst_object_unref (GST_OBJECT_CAST (child)); + gst_object_unref (child); /* now grab the lock to iterate to the next child */ GST_LOCK (bin); @@ -1105,7 +1105,7 @@ restart: while (children) { GstElement *child = GST_ELEMENT_CAST (children->data); - gst_object_ref (GST_OBJECT_CAST (child)); + gst_object_ref (child); GST_UNLOCK (bin); if (bin_element_is_sink (child, bin) == 0) { @@ -1197,11 +1197,11 @@ restart: /* make sure we don't have duplicates */ while ((oldelem = g_queue_find (semi_queue, peer_elem))) { - gst_object_unref (GST_OBJECT (peer_elem)); + gst_object_unref (peer_elem); g_queue_delete_link (semi_queue, oldelem); } while ((oldelem = g_queue_find (elem_queue, peer_elem))) { - gst_object_unref (GST_OBJECT (peer_elem)); + gst_object_unref (peer_elem); g_queue_delete_link (elem_queue, oldelem); } /* was reffed before pushing on the queue by the @@ -1211,13 +1211,13 @@ restart: GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element, "not adding element %s to queue, it is in another bin", GST_ELEMENT_NAME (peer_elem)); - gst_object_unref (GST_OBJECT_CAST (peer_elem)); + gst_object_unref (peer_elem); } if (parent) { gst_object_unref (parent); } } - gst_object_unref (GST_OBJECT_CAST (peer)); + gst_object_unref (peer); } else { GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element, "pad %s:%s does not have a peer", GST_DEBUG_PAD_NAME (pad)); @@ -1253,7 +1253,7 @@ restart: pending, gst_element_state_get_name (pending)); ret = GST_STATE_FAILURE; /* release refcount of element we popped off the queue */ - gst_object_unref (GST_OBJECT (qelement)); + gst_object_unref (qelement); goto exit; case GST_STATE_NO_PREROLL: GST_CAT_DEBUG (GST_CAT_STATES, @@ -1267,7 +1267,7 @@ restart: break; } next_element: - gst_object_unref (GST_OBJECT (qelement)); + gst_object_unref (qelement); } if (have_no_preroll) { @@ -1306,7 +1306,7 @@ gst_bin_dispose (GObject * object) GST_CAT_DEBUG_OBJECT (GST_CAT_REFCOUNTING, object, "dispose"); /* ref to not hit 0 again */ - gst_object_ref (GST_OBJECT (object)); + gst_object_ref (object); while (bin->children) { gst_bin_remove (bin, GST_ELEMENT (bin->children->data)); @@ -1347,7 +1347,7 @@ gst_bin_send_event (GstElement * element, GstEvent * event) gst_event_ref (event); sink = GST_ELEMENT_CAST (data); res &= gst_element_send_event (sink, event); - gst_object_unref (GST_OBJECT (sink)); + gst_object_unref (sink); break; } case GST_ITERATOR_RESYNC: @@ -1386,7 +1386,7 @@ gst_bin_query (GstElement * element, GstQuery * query) sink = GST_ELEMENT_CAST (data); res = gst_element_query (sink, query); - gst_object_unref (GST_OBJECT (sink)); + gst_object_unref (sink); break; } case GST_ITERATOR_RESYNC: @@ -1413,7 +1413,7 @@ compare_name (GstElement * element, const gchar * name) GST_UNLOCK (element); if (eq != 0) { - gst_object_unref (GST_OBJECT (element)); + gst_object_unref (element); } return eq; } @@ -1499,7 +1499,7 @@ compare_interface (GstElement * element, gpointer interface) } else { /* we did not find the element, need to release the ref * added by the iterator */ - gst_object_unref (GST_OBJECT (element)); + gst_object_unref (element); ret = 1; } return ret; @@ -1613,7 +1613,7 @@ gst_bin_restore_thyself (GstObject * object, xmlNodePtr self) /* it had to be parented to find the pads, now we ref and unparent so * we can add it to the bin */ - gst_object_ref (GST_OBJECT (element)); + gst_object_ref (element); gst_object_unparent (GST_OBJECT (element)); gst_bin_add (bin, element); diff --git a/gst/gstbus.c b/gst/gstbus.c index e53ff6ad98..6acece82ed 100644 --- a/gst/gstbus.c +++ b/gst/gstbus.c @@ -433,7 +433,7 @@ gst_bus_source_finalize (GSource * source) { GstBusSource *bsource = (GstBusSource *) source; - gst_object_unref (GST_OBJECT_CAST (bsource->bus)); + gst_object_unref (bsource->bus); bsource->bus = NULL; } @@ -461,7 +461,7 @@ gst_bus_create_watch (GstBus * bus) source = (GstBusSource *) g_source_new (&gst_bus_source_funcs, sizeof (GstBusSource)); - gst_object_ref (GST_OBJECT_CAST (bus)); + gst_object_ref (bus); source->bus = bus; return (GSource *) source; diff --git a/gst/gstelement.c b/gst/gstelement.c index 25c27f3c4e..af35f61542 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -581,7 +581,7 @@ gst_element_remove_pad (GstElement * element, GstPad * pad) else gst_pad_unlink (GST_PAD_CAST (peer), pad); - gst_object_unref (GST_OBJECT (peer)); + gst_object_unref (peer); } GST_LOCK (element); @@ -683,7 +683,7 @@ gst_element_get_static_pad (GstElement * element, const gchar * name) g_list_find_custom (element->pads, name, (GCompareFunc) pad_compare_name); if (find) { result = GST_PAD_CAST (find->data); - gst_object_ref (GST_OBJECT_CAST (result)); + gst_object_ref (result); } if (result == NULL) { @@ -711,7 +711,7 @@ gst_element_request_pad (GstElement * element, GstPadTemplate * templ, newpad = (oclass->request_new_pad) (element, templ, name); if (newpad) - gst_object_ref (GST_OBJECT (newpad)); + gst_object_ref (newpad); return newpad; } @@ -820,7 +820,7 @@ gst_element_get_pad (GstElement * element, const gchar * name) GstIteratorItem iterate_pad (GstIterator * it, GstPad * pad) { - gst_object_ref (GST_OBJECT_CAST (pad)); + gst_object_ref (pad); return GST_ITERATOR_ITEM_PASS; } @@ -842,7 +842,7 @@ gst_element_iterate_pads (GstElement * element) g_return_val_if_fail (GST_IS_ELEMENT (element), NULL); GST_LOCK (element); - gst_object_ref (GST_OBJECT (element)); + gst_object_ref (element); result = gst_iterator_new_list (GST_GET_LOCK (element), &element->pads_cookie, &element->pads, @@ -862,7 +862,8 @@ direction_filter (gconstpointer pad, gconstpointer direction) return 0; } else { /* unref */ - gst_object_unref (GST_OBJECT (pad)); + /* FIXME: this is very stupid */ + gst_object_unref (GST_OBJECT_CAST (pad)); return 1; } } @@ -925,7 +926,7 @@ gst_element_class_add_pad_template (GstElementClass * klass, templ->name_template) == NULL); klass->padtemplates = g_list_append (klass->padtemplates, - gst_object_ref (GST_OBJECT (templ))); + gst_object_ref (templ)); klass->numpadtemplates++; } @@ -1041,7 +1042,7 @@ gst_element_get_random_pad (GstElement * element, GstPadDirection dir) GST_UNLOCK (pad); } if (result) - gst_object_ref (GST_OBJECT (result)); + gst_object_ref (result); GST_UNLOCK (element); @@ -1094,9 +1095,9 @@ gst_element_send_event (GstElement * element, GstEvent * event) "sending event to random pad %s:%s", GST_DEBUG_PAD_NAME (pad)); result = gst_pad_send_event (peer, event); - gst_object_unref (GST_OBJECT (peer)); + gst_object_unref (peer); } - gst_object_unref (GST_OBJECT (pad)); + gst_object_unref (pad); } } GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "can't send event on element %s", @@ -1165,9 +1166,9 @@ gst_element_get_query_types (GstElement * element) if (peer) { result = gst_pad_get_query_types (peer); - gst_object_unref (GST_OBJECT (peer)); + gst_object_unref (peer); } - gst_object_unref (GST_OBJECT (pad)); + gst_object_unref (pad); } } return result; @@ -1209,7 +1210,7 @@ gst_element_query (GstElement * element, GstQuery * query) if (pad) { result = gst_pad_query (pad, query); - gst_object_unref (GST_OBJECT (pad)); + gst_object_unref (pad); } else { pad = gst_element_get_random_pad (element, GST_PAD_SINK); if (pad) { @@ -1218,9 +1219,9 @@ gst_element_query (GstElement * element, GstQuery * query) if (peer) { result = gst_pad_query (peer, query); - gst_object_unref (GST_OBJECT (peer)); + gst_object_unref (peer); } - gst_object_unref (GST_OBJECT (pad)); + gst_object_unref (pad); } } } @@ -1258,12 +1259,12 @@ gst_element_post_message (GstElement * element, GstMessage * message) gst_message_unref (message); return FALSE; } - gst_object_ref (GST_OBJECT (bus)); + gst_object_ref (bus); GST_DEBUG ("... on bus %p", bus); GST_UNLOCK (element); result = gst_bus_post (bus, message); - gst_object_unref (GST_OBJECT (bus)); + gst_object_unref (bus); return result; } @@ -1850,7 +1851,7 @@ activate_pads (GstPad * pad, GValue * ret, gboolean * active) if (!gst_pad_set_active (pad, *active)) g_value_set_boolean (ret, FALSE); - gst_object_unref (GST_OBJECT (pad)); + gst_object_unref (pad); return TRUE; } @@ -2009,7 +2010,7 @@ gst_element_dispose (GObject * object) GST_CAT_INFO_OBJECT (GST_CAT_REFCOUNTING, element, "dispose"); /* ref so we don't hit 0 again */ - gst_object_ref (GST_OBJECT (object)); + gst_object_ref (object); /* first we break all our links with the ouside */ while (element->pads) { @@ -2271,7 +2272,7 @@ gst_element_get_manager (GstElement * element) GST_LOCK (element); result = GST_ELEMENT_MANAGER (element); - gst_object_ref (GST_OBJECT (result)); + gst_object_ref (result); GST_UNLOCK (element); return result; diff --git a/gst/gstghostpad.c b/gst/gstghostpad.c index c8021800bb..bdf2e3a407 100644 --- a/gst/gstghostpad.c +++ b/gst/gstghostpad.c @@ -579,7 +579,7 @@ gst_ghost_pad_set_property (GObject * object, guint prop_id, } else { gst_pad_unlink (intpeer, pad->internal); } - gst_object_unref (GST_OBJECT (intpeer)); + gst_object_unref (intpeer); } /* should dispose it */ diff --git a/gst/gstpad.c b/gst/gstpad.c index ba0cc8bc09..795a5320dd 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -536,7 +536,7 @@ gst_pad_activate_pull (GstPad * pad, gboolean active) GST_CAT_DEBUG_OBJECT (GST_CAT_PADS, pad, "activate_pull on peer (%s:%s) failed", GST_DEBUG_PAD_NAME (peer)); GST_UNLOCK (peer); - gst_object_unref (GST_OBJECT (peer)); + gst_object_unref (peer); goto failure; } } @@ -1706,12 +1706,12 @@ gst_pad_peer_get_caps (GstPad * pad) if (G_UNLIKELY (GST_PAD_IS_IN_GETCAPS (peerpad))) goto was_dispatching; - gst_object_ref (GST_OBJECT_CAST (peerpad)); + gst_object_ref (peerpad); GST_UNLOCK (pad); result = gst_pad_get_caps (peerpad); - gst_object_unref (GST_OBJECT (peerpad)); + gst_object_unref (peerpad); return result; @@ -1989,7 +1989,7 @@ gst_pad_get_peer (GstPad * pad) GST_LOCK (pad); result = GST_PAD_PEER (pad); if (result) - gst_object_ref (GST_OBJECT (result)); + gst_object_ref (result); GST_UNLOCK (pad); return result; @@ -2029,12 +2029,12 @@ gst_pad_get_allowed_caps (GstPad * srcpad) GST_CAT_DEBUG (GST_CAT_PROPERTIES, "%s:%s: getting allowed caps", GST_DEBUG_PAD_NAME (srcpad)); - gst_object_ref (GST_OBJECT_CAST (peer)); + gst_object_ref (peer); GST_UNLOCK (srcpad); mycaps = gst_pad_get_caps (srcpad); peercaps = gst_pad_get_caps (peer); - gst_object_unref (GST_OBJECT_CAST (peer)); + gst_object_unref (peer); caps = gst_caps_intersect (mycaps, peercaps); gst_caps_unref (peercaps); @@ -2147,7 +2147,7 @@ gst_pad_alloc_buffer (GstPad * pad, guint64 offset, gint size, GstCaps * caps, if (G_UNLIKELY ((peer = GST_PAD_PEER (pad)) == NULL)) goto no_peer; - gst_object_ref (GST_OBJECT_CAST (peer)); + gst_object_ref (peer); GST_UNLOCK (pad); if (G_LIKELY ((bufferallocfunc = peer->bufferallocfunc) == NULL)) @@ -2172,7 +2172,7 @@ gst_pad_alloc_buffer (GstPad * pad, guint64 offset, gint size, GstCaps * caps, goto fallback; do_caps: - gst_object_unref (GST_OBJECT_CAST (peer)); + gst_object_unref (peer); /* FIXME, move capnego this into a base class? */ caps = GST_BUFFER_CAPS (*buf); @@ -2198,7 +2198,7 @@ flushing: { /* peer was flushing */ GST_UNLOCK (peer); - gst_object_unref (GST_OBJECT_CAST (peer)); + gst_object_unref (peer); GST_CAT_DEBUG (GST_CAT_PADS, "%s:%s called bufferallocfunc but peer was flushing, returning NULL", GST_DEBUG_PAD_NAME (pad)); @@ -2224,7 +2224,7 @@ not_negotiated: } peer_error: { - gst_object_unref (GST_OBJECT_CAST (peer)); + gst_object_unref (peer); GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad, "alloc function retured error %d", ret); return ret; @@ -2627,7 +2627,7 @@ handle_pad_block (GstPad * pad) "signal block taken on pad %s:%s", GST_DEBUG_PAD_NAME (pad)); /* need to grab extra ref for the callbacks */ - gst_object_ref (GST_OBJECT_CAST (pad)); + gst_object_ref (pad); callback = pad->block_callback; if (callback) { @@ -2654,7 +2654,7 @@ handle_pad_block (GstPad * pad) GST_PAD_BLOCK_SIGNAL (pad); } - gst_object_unref (GST_OBJECT_CAST (pad)); + gst_object_unref (pad); } /********************************************************************** @@ -2780,12 +2780,12 @@ gst_pad_push (GstPad * pad, GstBuffer * buffer) if (G_UNLIKELY ((peer = GST_PAD_PEER (pad)) == NULL)) goto not_linked; - gst_object_ref (GST_OBJECT_CAST (peer)); + gst_object_ref (peer); GST_UNLOCK (pad); ret = gst_pad_chain (peer, buffer); - gst_object_unref (GST_OBJECT_CAST (peer)); + gst_object_unref (peer); return ret; @@ -2832,7 +2832,7 @@ gst_pad_check_pull_range (GstPad * pad) if (G_UNLIKELY ((peer = GST_PAD_PEER (pad)) == NULL)) goto not_connected; - gst_object_ref (GST_OBJECT_CAST (peer)); + gst_object_ref (peer); GST_UNLOCK (pad); /* see note in above function */ @@ -2846,7 +2846,7 @@ gst_pad_check_pull_range (GstPad * pad) ret = checkgetrangefunc (peer); } - gst_object_unref (GST_OBJECT_CAST (peer)); + gst_object_unref (peer); return ret; @@ -2964,12 +2964,12 @@ gst_pad_pull_range (GstPad * pad, guint64 offset, guint size, if (G_UNLIKELY ((peer = GST_PAD_PEER (pad)) == NULL)) goto not_connected; - gst_object_ref (GST_OBJECT_CAST (peer)); + gst_object_ref (peer); GST_UNLOCK (pad); ret = gst_pad_get_range (peer, offset, size, buffer); - gst_object_unref (GST_OBJECT_CAST (peer)); + gst_object_unref (peer); return ret; @@ -3010,12 +3010,12 @@ gst_pad_push_event (GstPad * pad, GstEvent * event) if (peerpad == NULL) goto not_linked; - gst_object_ref (GST_OBJECT_CAST (peerpad)); + gst_object_ref (peerpad); GST_UNLOCK (pad); result = gst_pad_send_event (peerpad, event); - gst_object_unref (GST_OBJECT_CAST (peerpad)); + gst_object_unref (peerpad); return result; @@ -3050,7 +3050,7 @@ gst_pad_send_event (GstPad * pad, GstEvent * event) GST_LOCK (pad); if (GST_EVENT_SRC (event) == NULL) - GST_EVENT_SRC (event) = gst_object_ref (GST_OBJECT (pad)); + GST_EVENT_SRC (event) = gst_object_ref (pad); switch (GST_EVENT_TYPE (event)) { case GST_EVENT_FLUSH: @@ -3080,12 +3080,12 @@ gst_pad_send_event (GstPad * pad, GstEvent * event) if ((eventfunc = GST_PAD_EVENTFUNC (pad)) == NULL) goto no_function; - gst_object_ref (GST_OBJECT_CAST (pad)); + gst_object_ref (pad); GST_UNLOCK (pad); result = eventfunc (GST_PAD_CAST (pad), event); - gst_object_unref (GST_OBJECT_CAST (pad)); + gst_object_unref (pad); return result; @@ -3474,7 +3474,7 @@ gst_pad_stop_task (GstPad * pad) GST_STREAM_LOCK (pad); GST_STREAM_UNLOCK (pad); - gst_object_unref (GST_OBJECT_CAST (task)); + gst_object_unref (task); return TRUE; diff --git a/gst/gstpipeline.c b/gst/gstpipeline.c index 89d39045c6..693a017ef8 100644 --- a/gst/gstpipeline.c +++ b/gst/gstpipeline.c @@ -256,7 +256,7 @@ is_eos (GstPipeline * pipeline) GST_DEBUG ("element %s posted EOS", name); } g_free (name); - gst_object_unref (GST_OBJECT (element)); + gst_object_unref (element); break; } case GST_ITERATOR_RESYNC: @@ -503,7 +503,7 @@ gst_pipeline_get_clock_func (GstElement * element) GST_LOCK (pipeline); if (GST_FLAG_IS_SET (pipeline, GST_PIPELINE_FLAG_FIXED_CLOCK)) { clock = pipeline->fixed_clock; - gst_object_ref (GST_OBJECT (clock)); + gst_object_ref (clock); GST_UNLOCK (pipeline); GST_CAT_DEBUG (GST_CAT_CLOCK, "pipeline using fixed clock %p (%s)", @@ -518,7 +518,7 @@ gst_pipeline_get_clock_func (GstElement * element) /* we unref since this function is not supposed to increase refcount * of clock object returned; this is ok since the systemclock always * has a refcount of at least one in the current code. */ - gst_object_unref (GST_OBJECT (clock)); + gst_object_unref (clock); GST_CAT_DEBUG (GST_CAT_CLOCK, "pipeline obtained system clock: %p (%s)", clock, clock ? GST_STR_NULL (GST_OBJECT_NAME (clock)) : "-"); } else { diff --git a/gst/gstscheduler.c b/gst/gstscheduler.c index 4b00e04684..60aa91cac7 100644 --- a/gst/gstscheduler.c +++ b/gst/gstscheduler.c @@ -346,7 +346,7 @@ gst_scheduler_factory_create (GstSchedulerFactory * factory, sched->parent = parent; /* let's refcount the scheduler */ - gst_object_ref (GST_OBJECT (sched)); + gst_object_ref (sched); gst_object_sink (GST_OBJECT (sched)); } diff --git a/gst/gstsystemclock.c b/gst/gstsystemclock.c index 5b62baf7eb..64c3857d7c 100644 --- a/gst/gstsystemclock.c +++ b/gst/gstsystemclock.c @@ -170,7 +170,7 @@ gst_system_clock_obtain (void) /* we created the global clock; take ownership so * we can hand out instances later */ - gst_object_ref (GST_OBJECT (clock)); + gst_object_ref (clock); gst_object_sink (GST_OBJECT (clock)); _the_system_clock = clock; @@ -181,7 +181,7 @@ gst_system_clock_obtain (void) } /* we ref it since we are a clock factory. */ - gst_object_ref (GST_OBJECT (clock)); + gst_object_ref (clock); return clock; } diff --git a/gst/gsturi.c b/gst/gsturi.c index 6d75f3776e..1eeeb1e596 100644 --- a/gst/gsturi.c +++ b/gst/gsturi.c @@ -485,7 +485,7 @@ gst_element_make_from_uri (const GstURIType type, const gchar * uri, if (gst_uri_handler_set_uri (handler, uri)) break; - gst_object_unref (GST_OBJECT (ret)); + gst_object_unref (ret); ret = NULL; } walk = walk->next; diff --git a/gst/gstutils.c b/gst/gstutils.c index 6dfc1029fd..9ba81a2b73 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -492,7 +492,7 @@ gst_element_request_pad (GstElement * element, GstPadTemplate * templ, newpad = (oclass->request_new_pad) (element, templ, name); if (newpad) - gst_object_ref (GST_OBJECT (newpad)); + gst_object_ref (newpad); return newpad; } @@ -638,9 +638,9 @@ gst_element_get_compatible_pad (GstElement * element, GstPad * pad, } else { GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "unreffing pads"); - gst_object_unref (GST_OBJECT (current)); + gst_object_unref (current); if (peer) - gst_object_unref (GST_OBJECT (peer)); + gst_object_unref (peer); } break; } @@ -664,7 +664,7 @@ gst_element_get_compatible_pad (GstElement * element, GstPad * pad, templ = gst_pad_template_new ((gchar *) GST_PAD_NAME (pad), GST_PAD_DIRECTION (pad), GST_PAD_ALWAYS, templcaps); foundpad = gst_element_request_compatible_pad (element, templ); - gst_object_unref (GST_OBJECT (templ)); + gst_object_unref (templ); if (foundpad) { GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, @@ -953,13 +953,13 @@ gst_element_link_pads (GstElement * src, const gchar * srcpadname, if (!(GST_PAD_DIRECTION (srcpad) == GST_PAD_SRC)) { GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is no src pad", GST_DEBUG_PAD_NAME (srcpad)); - gst_object_unref (GST_OBJECT (srcpad)); + gst_object_unref (srcpad); return FALSE; } if (GST_PAD_PEER (srcpad) != NULL) { GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is already linked", GST_DEBUG_PAD_NAME (srcpad)); - gst_object_unref (GST_OBJECT (srcpad)); + gst_object_unref (srcpad); return FALSE; } } @@ -969,7 +969,7 @@ gst_element_link_pads (GstElement * src, const gchar * srcpadname, srcpads = GST_ELEMENT_PADS (src); srcpad = srcpads ? GST_PAD_CAST (srcpads->data) : NULL; if (srcpad) - gst_object_ref (GST_OBJECT (srcpad)); + gst_object_ref (srcpad); GST_UNLOCK (src); } if (destpadname) { @@ -982,13 +982,13 @@ gst_element_link_pads (GstElement * src, const gchar * srcpadname, if (!(GST_PAD_DIRECTION (destpad) == GST_PAD_SINK)) { GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is no sink pad", GST_DEBUG_PAD_NAME (destpad)); - gst_object_unref (GST_OBJECT (destpad)); + gst_object_unref (destpad); return FALSE; } if (GST_PAD_PEER (destpad) != NULL) { GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is already linked", GST_DEBUG_PAD_NAME (destpad)); - gst_object_unref (GST_OBJECT (destpad)); + gst_object_unref (destpad); return FALSE; } } @@ -998,7 +998,7 @@ gst_element_link_pads (GstElement * src, const gchar * srcpadname, destpads = GST_ELEMENT_PADS (dest); destpad = destpads ? GST_PAD_CAST (destpads->data) : NULL; if (destpad) - gst_object_ref (GST_OBJECT (destpad)); + gst_object_ref (destpad); GST_UNLOCK (dest); } @@ -1008,8 +1008,8 @@ gst_element_link_pads (GstElement * src, const gchar * srcpadname, /* two explicitly specified pads */ result = pad_link_maybe_ghosting (srcpad, destpad); - gst_object_unref (GST_OBJECT (srcpad)); - gst_object_unref (GST_OBJECT (destpad)); + gst_object_unref (srcpad); + gst_object_unref (destpad); return result; } @@ -1027,7 +1027,7 @@ gst_element_link_pads (GstElement * src, const gchar * srcpadname, if (destpadname) { temp = destpad; - gst_object_ref (GST_OBJECT (temp)); + gst_object_ref (temp); } else { temp = gst_element_get_compatible_pad (dest, srcpad, NULL); } @@ -1036,23 +1036,23 @@ gst_element_link_pads (GstElement * src, const gchar * srcpadname, GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "linked pad %s:%s to pad %s:%s", GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (temp)); if (destpad) - gst_object_unref (GST_OBJECT (destpad)); - gst_object_unref (GST_OBJECT (srcpad)); - gst_object_unref (GST_OBJECT (temp)); + gst_object_unref (destpad); + gst_object_unref (srcpad); + gst_object_unref (temp); return TRUE; } if (temp) { - gst_object_unref (GST_OBJECT (temp)); + gst_object_unref (temp); } } /* find a better way for this mess */ if (srcpads) { srcpads = g_list_next (srcpads); if (srcpads) { - gst_object_unref (GST_OBJECT (srcpad)); + gst_object_unref (srcpad); srcpad = GST_PAD_CAST (srcpads->data); - gst_object_ref (GST_OBJECT (srcpad)); + gst_object_ref (srcpad); } } } while (srcpads); @@ -1060,13 +1060,13 @@ gst_element_link_pads (GstElement * src, const gchar * srcpadname, if (srcpadname) { GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "no link possible from %s:%s to %s", GST_DEBUG_PAD_NAME (srcpad), GST_ELEMENT_NAME (dest)); - gst_object_unref (GST_OBJECT (srcpad)); + gst_object_unref (srcpad); if (destpad) - gst_object_unref (GST_OBJECT (destpad)); + gst_object_unref (destpad); return FALSE; } else { if (srcpad) - gst_object_unref (GST_OBJECT (srcpad)); + gst_object_unref (srcpad); srcpad = NULL; } if (destpad) { @@ -1081,22 +1081,22 @@ gst_element_link_pads (GstElement * src, const gchar * srcpadname, if (temp && pad_link_maybe_ghosting (temp, destpad)) { GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "linked pad %s:%s to pad %s:%s", GST_DEBUG_PAD_NAME (temp), GST_DEBUG_PAD_NAME (destpad)); - gst_object_unref (GST_OBJECT (temp)); - gst_object_unref (GST_OBJECT (destpad)); + gst_object_unref (temp); + gst_object_unref (destpad); if (srcpad) - gst_object_unref (GST_OBJECT (srcpad)); + gst_object_unref (srcpad); return TRUE; } if (temp) { - gst_object_unref (GST_OBJECT (temp)); + gst_object_unref (temp); } } if (destpads) { destpads = g_list_next (destpads); if (destpads) { - gst_object_unref (GST_OBJECT (destpad)); + gst_object_unref (destpad); destpad = GST_PAD_CAST (destpads->data); - gst_object_ref (GST_OBJECT (destpad)); + gst_object_ref (destpad); } } } while (destpads); @@ -1104,14 +1104,14 @@ gst_element_link_pads (GstElement * src, const gchar * srcpadname, if (destpadname) { GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "no link possible from %s to %s:%s", GST_ELEMENT_NAME (src), GST_DEBUG_PAD_NAME (destpad)); - gst_object_unref (GST_OBJECT (destpad)); + gst_object_unref (destpad); if (srcpad) - gst_object_unref (GST_OBJECT (srcpad)); + gst_object_unref (srcpad); return FALSE; } else { - gst_object_unref (GST_OBJECT (destpad)); + gst_object_unref (destpad); if (srcpad) - gst_object_unref (GST_OBJECT (srcpad)); + gst_object_unref (srcpad); srcpad = NULL; destpad = NULL; } @@ -1139,8 +1139,8 @@ gst_element_link_pads (GstElement * src, const gchar * srcpadname, GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "linked pad %s:%s to pad %s:%s", GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (destpad)); - gst_object_unref (GST_OBJECT (srcpad)); - gst_object_unref (GST_OBJECT (destpad)); + gst_object_unref (srcpad); + gst_object_unref (destpad); return TRUE; } /* it failed, so we release the request pads */ @@ -1318,12 +1318,12 @@ gst_element_unlink (GstElement * src, GstElement * dest) gst_pad_unlink (pad, peerpad); } if (peerelem) - gst_object_unref (GST_OBJECT (peerelem)); + gst_object_unref (peerelem); - gst_object_unref (GST_OBJECT (peerpad)); + gst_object_unref (peerpad); } } - gst_object_unref (GST_OBJECT (pad)); + gst_object_unref (pad); break; } case GST_ITERATOR_RESYNC: diff --git a/gst/schedulers/threadscheduler.c b/gst/schedulers/threadscheduler.c index 4515aa3f26..19e4196f6b 100644 --- a/gst/schedulers/threadscheduler.c +++ b/gst/schedulers/threadscheduler.c @@ -157,7 +157,7 @@ gst_thread_scheduler_task_start (GstTask * task) GST_TASK_CAST (ttask)->state = GST_TASK_STARTED; switch (old) { case GST_TASK_STOPPED: - gst_object_ref (GST_OBJECT (task)); + gst_object_ref (task); g_thread_pool_push (tsched->pool, task, NULL); break; case GST_TASK_PAUSED: @@ -211,7 +211,7 @@ gst_thread_scheduler_task_pause (GstTask * task) GST_TASK_CAST (ttask)->state = GST_TASK_PAUSED; switch (old) { case GST_TASK_STOPPED: - gst_object_ref (GST_OBJECT (task)); + gst_object_ref (task); g_thread_pool_push (tsched->pool, task, NULL); break; case GST_TASK_PAUSED: @@ -303,7 +303,7 @@ done: GST_DEBUG_OBJECT (sched, "Exit task %p, thread %p", task, g_thread_self ()); - gst_object_unref (GST_OBJECT (task)); + gst_object_unref (task); } static void |