From: Andy Wingo Date: Tue, 28 Jun 2005 10:16:13 +0000 (+0000) Subject: *.c: Don't cast to GstObject before reffing/unreffing. X-Git-Tag: 1.19.3~511^2~13002 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0bc038021526280844027f7d19367faa9e563f0;p=platform%2Fupstream%2Fgstreamer.git *.c: Don't cast to GstObject before reffing/unreffing. Original commit message from CVS: 2005-06-28 Andy Wingo * *.c: Don't cast to GstObject before reffing/unreffing. --- diff --git a/ChangeLog b/ChangeLog index 65e66aa..f5da9f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-06-28 Andy Wingo + + * *.c: Don't cast to GstObject before reffing/unreffing. + 2005-06-27 Andy Wingo * gst/videotestsrc/gstvideotestsrc.c diff --git a/examples/dynparams/filter.c b/examples/dynparams/filter.c index 087a5b2..edca876 100644 --- a/examples/dynparams/filter.c +++ b/examples/dynparams/filter.c @@ -315,7 +315,7 @@ cb_parse_clicked (GtkButton * button, gpointer * user_data) return; } if (fd->input) - gst_object_unref (GST_OBJECT (fd->input)); + gst_object_unref (fd->input); fd->input = GST_ELEMENT (gst_parse_launch (fd->input_pipe, &error)); if (error) { ui_feedback_add (fd->ui, "Error : parsing input pipeline : %s\n", @@ -329,7 +329,7 @@ cb_parse_clicked (GtkButton * button, gpointer * user_data) return; } if (fd->output) - gst_object_unref (GST_OBJECT (fd->output)); + gst_object_unref (fd->output); fd->output = GST_ELEMENT (gst_parse_launch (fd->output_pipe, &error)); if (error) { ui_feedback_add (fd->ui, "Error : parsing output pipeline : %s\n", @@ -340,7 +340,7 @@ cb_parse_clicked (GtkButton * button, gpointer * user_data) /* try to create filter */ if (fd->filter) - gst_object_unref (GST_OBJECT (fd->filter)); + gst_object_unref (fd->filter); fd->filter = gst_element_factory_make (fd->filter_element, "filter"); if (fd->filter == NULL) { ui_feedback_add (fd->ui, "Error : could not create element %s\n", diff --git a/examples/seeking/seek.c b/examples/seeking/seek.c index 39082bb..6f8e284 100644 --- a/examples/seeking/seek.c +++ b/examples/seeking/seek.c @@ -1218,7 +1218,7 @@ main (int argc, char **argv) gst_element_set_state (pipeline, GST_STATE_NULL); g_print ("free pipeline\n"); - gst_object_unref (GST_OBJECT (pipeline)); + gst_object_unref (pipeline); return 0; } diff --git a/examples/switch/switcher.c b/examples/switch/switcher.c index 92bf501..8d463c2 100644 --- a/examples/switch/switcher.c +++ b/examples/switch/switcher.c @@ -98,7 +98,7 @@ main (int argc, char *argv[]) gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_READY); /* unref */ - gst_object_unref (GST_OBJECT (pipeline)); + gst_object_unref (pipeline); exit (0); } diff --git a/ext/alsa/gstalsasrc.c b/ext/alsa/gstalsasrc.c index 47ee18d..309f4eb 100644 --- a/ext/alsa/gstalsasrc.c +++ b/ext/alsa/gstalsasrc.c @@ -131,7 +131,7 @@ gst_alsa_src_init (GstAlsaSrc * src) this->clock = gst_alsa_clock_new ("alsasrcclock", gst_alsa_src_get_time, this); /* we hold a ref to our clock until we're disposed */ - gst_object_ref (GST_OBJECT (this->clock)); + gst_object_ref (this->clock); gst_object_sink (GST_OBJECT (this->clock)); src->status = NULL; diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index fc4b7bf..d039489 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -560,7 +560,7 @@ gst_ogg_pad_typefind (GstOggPad * pad, ogg_packet * packet) GstCaps *any; /* this is ours */ - gst_object_ref (GST_OBJECT (element)); + gst_object_ref (element); gst_object_sink (GST_OBJECT (element)); /* FIXME, it might not be named "sink" */ @@ -583,7 +583,7 @@ gst_ogg_pad_typefind (GstOggPad * pad, ogg_packet * packet) p = gst_element_get_pad (element, "src"); gst_pad_link (p, pad->elem_out); - gst_object_unref (GST_OBJECT (p)); + gst_object_unref (p); } } } @@ -769,7 +769,7 @@ gst_ogg_chain_free (GstOggChain * chain) for (i = 0; i < chain->streams->len; i++) { GstOggPad *pad = g_array_index (chain->streams, GstOggPad *, i); - gst_object_unref (GST_OBJECT (pad)); + gst_object_unref (pad); } g_array_free (chain->streams, TRUE); chain->streams = NULL; @@ -787,7 +787,7 @@ gst_ogg_chain_new_stream (GstOggChain * chain, glong serialno) ret = g_object_new (GST_TYPE_OGG_PAD, NULL); /* we own this one */ - gst_object_ref (GST_OBJECT (ret)); + gst_object_ref (ret); gst_object_sink (GST_OBJECT (ret)); list = gst_tag_list_new (); @@ -803,7 +803,7 @@ gst_ogg_chain_new_stream (GstOggChain * chain, glong serialno) if (ogg_stream_init (&ret->stream, serialno) != 0) { GST_ERROR ("Could not initialize ogg_stream struct for serial %08lx.", serialno); - gst_object_unref (GST_OBJECT (ret)); + gst_object_unref (ret); return NULL; } gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, GST_TAG_SERIAL, serialno, @@ -1723,7 +1723,7 @@ gst_ogg_demux_find_chains (GstOggDemux * ogg) /* find length to read last page, we store this for later use. */ format = GST_FORMAT_BYTES; res = gst_pad_query_position (peer, &format, NULL, &ogg->length); - gst_object_unref (GST_OBJECT (peer)); + gst_object_unref (peer); if (!res) goto no_length; diff --git a/ext/ogg/gstogmparse.c b/ext/ogg/gstogmparse.c index f7523fd..afb4ee7 100644 --- a/ext/ogg/gstogmparse.c +++ b/ext/ogg/gstogmparse.c @@ -627,7 +627,7 @@ gst_ogm_parse_chain (GstPad * pad, GstBuffer * buffer) //gst_pad_use_explicit_caps (ogm->srcpad); //if (!gst_pad_set_explicit_caps (ogm->srcpad, caps)) { // GST_ELEMENT_ERROR (ogm, CORE, NEGOTIATION, (NULL), (NULL)); - //gst_object_unref (GST_OBJECT (ogm->srcpad)); + //gst_object_unref (ogm->srcpad); // ogm->srcpad = NULL; // break; //} diff --git a/gst-libs/gst/audio/gstbaseaudiosink.c b/gst-libs/gst/audio/gstbaseaudiosink.c index 8a2f52f..b2fd5ec 100644 --- a/gst-libs/gst/audio/gstbaseaudiosink.c +++ b/gst-libs/gst/audio/gstbaseaudiosink.c @@ -131,7 +131,7 @@ gst_baseaudiosink_get_clock (GstElement * elem) sink = GST_BASEAUDIOSINK (elem); - return GST_CLOCK (gst_object_ref (GST_OBJECT (sink->clock))); + return GST_CLOCK (gst_object_ref (sink->clock)); } static GstClockTime @@ -555,7 +555,7 @@ gst_baseaudiosink_change_state (GstElement * element) case GST_STATE_PAUSED_TO_READY: gst_ringbuffer_stop (sink->ringbuffer); gst_ringbuffer_release (sink->ringbuffer); - gst_object_unref (GST_OBJECT (sink->ringbuffer)); + gst_object_unref (sink->ringbuffer); sink->ringbuffer = NULL; break; case GST_STATE_READY_TO_NULL: diff --git a/gst/adder/gstadder.c b/gst/adder/gstadder.c index 298355b..4969084 100644 --- a/gst/adder/gstadder.c +++ b/gst/adder/gstadder.c @@ -294,7 +294,7 @@ not_sink: could_not_add: { gst_collectpads_remove_pad (adder->collect, newpad); - gst_object_unref (GST_OBJECT (newpad)); + gst_object_unref (newpad); return NULL; } } diff --git a/gst/audioconvert/channelmixtest.c b/gst/audioconvert/channelmixtest.c index 1f5a429..096a683 100644 --- a/gst/audioconvert/channelmixtest.c +++ b/gst/audioconvert/channelmixtest.c @@ -88,7 +88,7 @@ main (gint argc, gchar ** argv) } } } - gst_object_unref (GST_OBJECT (bin)); + gst_object_unref (bin); } return 0; diff --git a/gst/ffmpegcolorspace/gstffmpegcolorspace.c b/gst/ffmpegcolorspace/gstffmpegcolorspace.c index c46f2cd..1863428 100644 --- a/gst/ffmpegcolorspace/gstffmpegcolorspace.c +++ b/gst/ffmpegcolorspace/gstffmpegcolorspace.c @@ -290,7 +290,7 @@ gst_ffmpegcsp_setcaps (GstPad * pad, GstCaps * caps) gst_caps_unref (targetcaps); } } - gst_object_unref (GST_OBJECT (otherpeer)); + gst_object_unref (otherpeer); } space->width = width; @@ -305,7 +305,7 @@ configure_error_source: } configure_error_target: { - gst_object_unref (GST_OBJECT (otherpeer)); + gst_object_unref (otherpeer); GST_DEBUG ("could not configure context for target"); return FALSE; } diff --git a/gst/playback/gstdecodebin.c b/gst/playback/gstdecodebin.c index 7de4d8d..d7e03f9 100644 --- a/gst/playback/gstdecodebin.c +++ b/gst/playback/gstdecodebin.c @@ -314,7 +314,7 @@ gst_decode_bin_init (GstDecodeBin * decode_bin) /* add the typefind element */ if (!gst_bin_add (GST_BIN (decode_bin), decode_bin->typefind)) { g_warning ("Could not add typefind element, decodebin will not work"); - gst_object_unref (GST_OBJECT (decode_bin->typefind)); + gst_object_unref (decode_bin->typefind); decode_bin->typefind = NULL; } @@ -325,7 +325,7 @@ gst_decode_bin_init (GstDecodeBin * decode_bin) gst_element_add_pad (GST_ELEMENT (decode_bin), gst_ghost_pad_new ("sink", pad)); - gst_object_unref (GST_OBJECT_CAST (pad)); + gst_object_unref (pad); /* connect a signal to find out when the typefind element found * a type */ @@ -358,8 +358,8 @@ dynamic_create (GstElement * element, GstDecodeBin * decode_bin) GstDynamic *dyn; /* take refs */ - gst_object_ref (GST_OBJECT (element)); - gst_object_ref (GST_OBJECT (decode_bin)); + gst_object_ref (element); + gst_object_ref (decode_bin); dyn = g_new0 (GstDynamic, 1); dyn->element = element; @@ -379,8 +379,8 @@ dynamic_free (GstDynamic * dyn) g_signal_handler_disconnect (G_OBJECT (dyn->element), dyn->np_sig_id); g_signal_handler_disconnect (G_OBJECT (dyn->element), dyn->nmp_sig_id); - gst_object_unref (GST_OBJECT (dyn->element)); - gst_object_unref (GST_OBJECT (dyn->decode_bin)); + gst_object_unref (dyn->element); + gst_object_unref (dyn->decode_bin); dyn->element = NULL; dyn->decode_bin = NULL; g_free (dyn); @@ -595,7 +595,7 @@ try_to_link_1 (GstDecodeBin * decode_bin, GstPad * pad, GList * factories) GST_DEBUG_OBJECT (decode_bin, "link failed on pad %s:%s, reason %d", GST_DEBUG_PAD_NAME (pad), ret); /* get rid of the sinkpad */ - gst_object_unref (GST_OBJECT_CAST (sinkpad)); + gst_object_unref (sinkpad); /* this element did not work, remove it again and continue trying * other elements, the element will be disposed. */ gst_bin_remove (GST_BIN (decode_bin), element); @@ -637,7 +637,7 @@ try_to_link_1 (GstDecodeBin * decode_bin, GstPad * pad, GList * factories) result = element; /* get rid of the sinkpad now */ - gst_object_unref (GST_OBJECT_CAST (sinkpad)); + gst_object_unref (sinkpad); /* and exit */ goto done; @@ -665,11 +665,11 @@ get_our_ghost_pad (GstDecodeBin * decode_bin, GstPad * pad) if (parent == GST_ELEMENT (decode_bin)) { GST_DEBUG_OBJECT (decode_bin, "pad is our ghostpad"); - gst_object_unref (GST_OBJECT_CAST (parent)); + gst_object_unref (parent); return pad; } else { GST_DEBUG_OBJECT (decode_bin, "pad is ghostpad but not ours"); - gst_object_unref (GST_OBJECT_CAST (parent)); + gst_object_unref (parent); return NULL; } } @@ -752,10 +752,10 @@ remove_element_chain (GstDecodeBin * decode_bin, GstPad * pad) GST_ELEMENT_NAME (elem), GST_DEBUG_PAD_NAME (pad)); remove_element_chain (decode_bin, peer); } - gst_object_unref (GST_OBJECT_CAST (parent)); + gst_object_unref (parent); } } - gst_object_unref (GST_OBJECT_CAST (peer)); + gst_object_unref (peer); } GST_DEBUG_OBJECT (decode_bin, "removing %s", GST_ELEMENT_NAME (elem)); @@ -854,8 +854,8 @@ unlinked (GstPad * pad, GstPad * peerpad, GstDecodeBin * decode_bin) decode_bin->dynamics = g_list_prepend (decode_bin->dynamics, dyn); exit: - gst_object_unref (GST_OBJECT (element)); - gst_object_unref (GST_OBJECT (peer)); + gst_object_unref (element); + gst_object_unref (peer); } /* this function inspects the given element and tries to connect something @@ -968,7 +968,7 @@ close_link (GstElement * element, GstDecodeBin * decode_bin) if (caps) gst_caps_unref (caps); - gst_object_unref (GST_OBJECT_CAST (pad)); + gst_object_unref (pad); } g_list_free (to_connect); } @@ -987,7 +987,7 @@ type_found (GstElement * typefind, guint probability, GstCaps * caps, /* autoplug the new pad with the caps that the signal gave us. */ pad = gst_element_get_pad (typefind, "src"); close_pad_link (typefind, pad, caps, decode_bin, FALSE); - gst_object_unref (GST_OBJECT_CAST (pad)); + gst_object_unref (pad); dynamic = gst_decode_bin_is_dynamic (decode_bin); if (dynamic == FALSE) { diff --git a/gst/playback/gstplaybasebin.c b/gst/playback/gstplaybasebin.c index 9fbfdcf..b44349a 100644 --- a/gst/playback/gstplaybasebin.c +++ b/gst/playback/gstplaybasebin.c @@ -323,8 +323,8 @@ group_destroy (GstPlayBaseGroup * group) gst_bin_remove (group->type[n].bin, group->type[n].selector); } else { /* else we can just unref it */ - gst_object_unref (GST_OBJECT (element)); - gst_object_unref (GST_OBJECT (group->type[n].selector)); + gst_object_unref (element); + gst_object_unref (group->type[n].selector); } group->type[n].preroll = NULL; @@ -618,7 +618,7 @@ gen_preroll_element (GstPlayBaseBin * play_base_bin, probe = gst_probe_new (FALSE, probe_triggered, info); /* have to REALIZE the pad as we cannot attach a padprobe to a ghostpad */ gst_pad_add_probe (preroll_pad, probe); - gst_object_unref (GST_OBJECT_CAST (preroll_pad)); + gst_object_unref (preroll_pad); /* add to group list */ /* FIXME refcount elements */ @@ -860,7 +860,7 @@ preroll_unlinked (GstPad * pad, GstPad * peerpad, srcpad = gst_element_get_pad (fakesrc, "src"); gst_bin_add (GST_BIN (play_base_bin), fakesrc); gst_pad_link (srcpad, pad); - gst_object_unref (GST_OBJECT_CAST (srcpad)); + gst_object_unref (srcpad); /* keep track of these patch elements */ g_object_set_data (G_OBJECT (pad), "fakesrc", fakesrc); @@ -1204,7 +1204,7 @@ setup_source (GstPlayBaseBin * play_base_bin, } GST_DEBUG ("No subtitle found - ignoring"); - gst_object_unref (GST_OBJECT (play_base_bin->subtitle)); + gst_object_unref (play_base_bin->subtitle); play_base_bin->subtitle = NULL; } else { GST_DEBUG ("Subtitle set-up successful"); @@ -1435,13 +1435,13 @@ mute_group_type (GstPlayBaseGroup * group, GstStreamType type, gboolean mute) pad = gst_element_get_pad (group->type[type - 1].preroll, "src"); gst_pad_set_active (pad, active); - gst_object_unref (GST_OBJECT_CAST (pad)); + gst_object_unref (pad); pad = gst_element_get_pad (group->type[type - 1].preroll, "sink"); gst_pad_set_active (pad, active); - gst_object_unref (GST_OBJECT_CAST (pad)); + gst_object_unref (pad); pad = gst_element_get_pad (group->type[type - 1].selector, "src"); gst_pad_set_active (pad, active); - gst_object_unref (GST_OBJECT_CAST (pad)); + gst_object_unref (pad); if (mute) { g_signal_connect (group->type[type - 1].preroll, "state-change", diff --git a/gst/playback/gstplaybin.c b/gst/playback/gstplaybin.c index 26edd9a..80732b4 100644 --- a/gst/playback/gstplaybin.c +++ b/gst/playback/gstplaybin.c @@ -223,15 +223,15 @@ gst_play_bin_dispose (GObject * object) } if (play_bin->audio_sink != NULL) { - gst_object_unref (GST_OBJECT (play_bin->audio_sink)); + gst_object_unref (play_bin->audio_sink); play_bin->audio_sink = NULL; } if (play_bin->video_sink != NULL) { - gst_object_unref (GST_OBJECT (play_bin->video_sink)); + gst_object_unref (play_bin->video_sink); play_bin->video_sink = NULL; } if (play_bin->visualisation != NULL) { - gst_object_unref (GST_OBJECT (play_bin->visualisation)); + gst_object_unref (play_bin->visualisation); play_bin->visualisation = NULL; } g_free (play_bin->font_desc); @@ -254,11 +254,11 @@ gst_play_bin_set_property (GObject * object, guint prop_id, switch (prop_id) { case ARG_VIDEO_SINK: if (play_bin->video_sink != NULL) { - gst_object_unref (GST_OBJECT (play_bin->video_sink)); + gst_object_unref (play_bin->video_sink); } play_bin->video_sink = g_value_get_object (value); if (play_bin->video_sink != NULL) { - gst_object_ref (GST_OBJECT (play_bin->video_sink)); + gst_object_ref (play_bin->video_sink); gst_object_sink (GST_OBJECT (play_bin->video_sink)); } /* when changing the videosink, we just remove the @@ -268,22 +268,22 @@ gst_play_bin_set_property (GObject * object, guint prop_id, break; case ARG_AUDIO_SINK: if (play_bin->audio_sink != NULL) { - gst_object_unref (GST_OBJECT (play_bin->audio_sink)); + gst_object_unref (play_bin->audio_sink); } play_bin->audio_sink = g_value_get_object (value); if (play_bin->audio_sink != NULL) { - gst_object_ref (GST_OBJECT (play_bin->audio_sink)); + gst_object_ref (play_bin->audio_sink); gst_object_sink (GST_OBJECT (play_bin->audio_sink)); } g_hash_table_remove (play_bin->cache, "abin"); break; case ARG_VIS_PLUGIN: if (play_bin->visualisation != NULL) { - gst_object_unref (GST_OBJECT (play_bin->visualisation)); + gst_object_unref (play_bin->visualisation); } play_bin->visualisation = g_value_get_object (value); if (play_bin->visualisation != NULL) { - gst_object_ref (GST_OBJECT (play_bin->visualisation)); + gst_object_ref (play_bin->visualisation); gst_object_sink (GST_OBJECT (play_bin->visualisation)); } break; @@ -395,7 +395,7 @@ gen_video_element (GstPlayBin * play_bin) } else { sink = gst_element_factory_make ("xvimagesink", "videosink"); } - gst_object_ref (GST_OBJECT (sink)); + gst_object_ref (sink); g_hash_table_insert (play_bin->cache, "video_sink", sink); gst_bin_add (GST_BIN (element), identity); @@ -408,13 +408,13 @@ gen_video_element (GstPlayBin * play_bin) pad = gst_element_get_pad (identity, "sink"); gst_element_add_pad (element, gst_ghost_pad_new ("sink", pad)); - gst_object_unref (GST_OBJECT (pad)); + gst_object_unref (pad); gst_element_set_state (element, GST_STATE_READY); /* since we're gonna add it to a bin but don't want to lose it, * we keep a reference. */ - gst_object_ref (GST_OBJECT (element)); + gst_object_ref (element); g_hash_table_insert (play_bin->cache, "vbin", element); return element; @@ -460,11 +460,11 @@ gen_text_element (GstPlayBin * play_bin) #define gst_element_add_ghost_pad(element, pad, name) \ gst_element_add_pad (element, gst_ghost_pad_new (name, pad)) gst_element_add_ghost_pad (element, pad, "text_sink"); - gst_object_unref (GST_OBJECT (pad)); + gst_object_unref (pad); pad = gst_element_get_pad (csp, "sink"); gst_element_add_ghost_pad (element, pad, "sink"); - gst_object_unref (GST_OBJECT (pad)); + gst_object_unref (pad); return element; } @@ -508,10 +508,10 @@ gen_audio_element (GstPlayBin * play_bin) sink = play_bin->audio_sink; } else { sink = gst_element_factory_make ("alsasink", "audiosink"); - play_bin->audio_sink = GST_ELEMENT (gst_object_ref (GST_OBJECT (sink))); + play_bin->audio_sink = GST_ELEMENT (gst_object_ref (sink)); } - gst_object_ref (GST_OBJECT (sink)); + gst_object_ref (sink); g_hash_table_insert (play_bin->cache, "audio_sink", sink); gst_bin_add (GST_BIN (element), conv); @@ -525,13 +525,13 @@ gen_audio_element (GstPlayBin * play_bin) pad = gst_element_get_pad (conv, "sink"); gst_element_add_ghost_pad (element, pad, "sink"); - gst_object_unref (GST_OBJECT (pad)); + gst_object_unref (pad); gst_element_set_state (element, GST_STATE_READY); /* since we're gonna add it to a bin but don't want to lose it, * we keep a reference. */ - gst_object_ref (GST_OBJECT (element)); + gst_object_ref (element); g_hash_table_insert (play_bin->cache, "abin", element); return element; @@ -589,7 +589,7 @@ gen_vis_element (GstPlayBin * play_bin) conv = gst_element_factory_make ("audioconvert", "aconv"); if (play_bin->visualisation) { - gst_object_ref (GST_OBJECT (play_bin->visualisation)); + gst_object_ref (play_bin->visualisation); vis = play_bin->visualisation; } else { vis = gst_element_factory_make ("goom", "vis"); @@ -606,19 +606,19 @@ gen_vis_element (GstPlayBin * play_bin) pad = gst_element_get_pad (aqueue, "sink"); rpad = gst_element_get_request_pad (tee, "src%d"); gst_pad_link (rpad, pad); - gst_object_unref (GST_OBJECT (rpad)); - gst_object_unref (GST_OBJECT (pad)); + gst_object_unref (rpad); + gst_object_unref (pad); gst_element_link_pads (aqueue, "src", asink, "sink"); pad = gst_element_get_pad (conv, "sink"); rpad = gst_element_get_request_pad (tee, "src%d"); gst_pad_link (rpad, pad); - gst_object_unref (GST_OBJECT (rpad)); - gst_object_unref (GST_OBJECT (pad)); + gst_object_unref (rpad); + gst_object_unref (pad); pad = gst_element_get_pad (tee, "sink"); gst_element_add_ghost_pad (element, pad, "sink"); - gst_object_unref (GST_OBJECT (pad)); + gst_object_unref (pad); return element; } @@ -641,7 +641,7 @@ remove_sinks (GstPlayBin * play_bin) * is disposed */ play_bin->sinks = g_list_remove (play_bin->sinks, element); gst_bin_remove (GST_BIN (parent), element); - gst_object_unref (GST_OBJECT (parent)); + gst_object_unref (parent); } } element = g_hash_table_lookup (play_bin->cache, "vbin"); @@ -650,7 +650,7 @@ remove_sinks (GstPlayBin * play_bin) if (parent != NULL) { play_bin->sinks = g_list_remove (play_bin->sinks, element); gst_bin_remove (GST_BIN (parent), element); - gst_object_unref (GST_OBJECT (parent)); + gst_object_unref (parent); } } @@ -666,9 +666,9 @@ remove_sinks (GstPlayBin * play_bin) peer = gst_pad_get_peer (pad); if (peer) { gst_pad_unlink (peer, pad); - gst_object_unref (GST_OBJECT (peer)); + gst_object_unref (peer); } - gst_object_unref (GST_OBJECT (pad)); + gst_object_unref (pad); gst_bin_remove (GST_BIN (play_bin), element); } @@ -704,12 +704,12 @@ add_sink (GstPlayBin * play_bin, GstElement * sink, GstPad * srcpad) /* we found a sink for this stream, now try to install it */ sinkpad = gst_element_get_pad (sink, "sink"); res = gst_pad_link (srcpad, sinkpad); - gst_object_unref (GST_OBJECT (sinkpad)); + gst_object_unref (sinkpad); parent = gst_pad_get_parent (srcpad); GST_DEBUG ("Adding sink with state %d (parent: %d, peer: %d)\n", GST_STATE (sink), GST_STATE (play_bin), GST_STATE (parent)); - gst_object_unref (GST_OBJECT (parent)); + gst_object_unref (parent); /* try to link the pad of the sink to the stream */ if (res < 0) { @@ -780,7 +780,7 @@ setup_sinks (GstPlayBaseBin * play_base_bin, GstPlayBaseGroup * group) pad = gst_element_get_pad (group->type[GST_STREAM_TYPE_AUDIO - 1].preroll, "src"); add_sink (play_bin, sink, pad); - gst_object_unref (GST_OBJECT (pad)); + gst_object_unref (pad); } /* link video */ @@ -793,15 +793,15 @@ setup_sinks (GstPlayBaseBin * play_base_bin, GstPlayBaseGroup * group) gst_element_get_pad (group->type[GST_STREAM_TYPE_TEXT - 1].preroll, "src"); gst_pad_link (textsrcpad, textsinkpad); - gst_object_unref (GST_OBJECT (textsinkpad)); - gst_object_unref (GST_OBJECT (textsrcpad)); + gst_object_unref (textsinkpad); + gst_object_unref (textsrcpad); } else { sink = gen_video_element (play_bin); } pad = gst_element_get_pad (group->type[GST_STREAM_TYPE_VIDEO - 1].preroll, "src"); add_sink (play_bin, sink, pad); - gst_object_unref (GST_OBJECT (pad)); + gst_object_unref (pad); } if (play_bin->fakesink) { diff --git a/gst/videorate/gstvideorate.c b/gst/videorate/gstvideorate.c index 4ac31fa..5563b28 100644 --- a/gst/videorate/gstvideorate.c +++ b/gst/videorate/gstvideorate.c @@ -322,7 +322,7 @@ gst_videorate_setcaps (GstPad * pad, GstCaps * caps) gst_pad_set_caps (otherpad, caps); ret = TRUE; } - gst_object_unref (GST_OBJECT (opeer)); + gst_object_unref (opeer); } done: return ret; diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index 39082bb..6f8e284 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -1218,7 +1218,7 @@ main (int argc, char **argv) gst_element_set_state (pipeline, GST_STATE_NULL); g_print ("free pipeline\n"); - gst_object_unref (GST_OBJECT (pipeline)); + gst_object_unref (pipeline); return 0; } diff --git a/tests/old/examples/dynparams/filter.c b/tests/old/examples/dynparams/filter.c index 087a5b2..edca876 100644 --- a/tests/old/examples/dynparams/filter.c +++ b/tests/old/examples/dynparams/filter.c @@ -315,7 +315,7 @@ cb_parse_clicked (GtkButton * button, gpointer * user_data) return; } if (fd->input) - gst_object_unref (GST_OBJECT (fd->input)); + gst_object_unref (fd->input); fd->input = GST_ELEMENT (gst_parse_launch (fd->input_pipe, &error)); if (error) { ui_feedback_add (fd->ui, "Error : parsing input pipeline : %s\n", @@ -329,7 +329,7 @@ cb_parse_clicked (GtkButton * button, gpointer * user_data) return; } if (fd->output) - gst_object_unref (GST_OBJECT (fd->output)); + gst_object_unref (fd->output); fd->output = GST_ELEMENT (gst_parse_launch (fd->output_pipe, &error)); if (error) { ui_feedback_add (fd->ui, "Error : parsing output pipeline : %s\n", @@ -340,7 +340,7 @@ cb_parse_clicked (GtkButton * button, gpointer * user_data) /* try to create filter */ if (fd->filter) - gst_object_unref (GST_OBJECT (fd->filter)); + gst_object_unref (fd->filter); fd->filter = gst_element_factory_make (fd->filter_element, "filter"); if (fd->filter == NULL) { ui_feedback_add (fd->ui, "Error : could not create element %s\n", diff --git a/tests/old/examples/switch/switcher.c b/tests/old/examples/switch/switcher.c index 92bf501..8d463c2 100644 --- a/tests/old/examples/switch/switcher.c +++ b/tests/old/examples/switch/switcher.c @@ -98,7 +98,7 @@ main (int argc, char *argv[]) gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_READY); /* unref */ - gst_object_unref (GST_OBJECT (pipeline)); + gst_object_unref (pipeline); exit (0); } diff --git a/tests/old/testsuite/alsa/formats.c b/tests/old/testsuite/alsa/formats.c index 2aa30e1..0142e9d 100644 --- a/tests/old/testsuite/alsa/formats.c +++ b/tests/old/testsuite/alsa/formats.c @@ -174,7 +174,7 @@ main (gint argc, gchar * argv[]) gst_bin_iterate (GST_BIN (pipeline)); if ((counter / 200) > last) { last = counter / 200; - gst_object_unref (GST_OBJECT (pipeline)); + gst_object_unref (pipeline); create_pipeline (); } } diff --git a/tests/old/testsuite/alsa/srcstate.c b/tests/old/testsuite/alsa/srcstate.c index 2d02348..de7ef9c 100644 --- a/tests/old/testsuite/alsa/srcstate.c +++ b/tests/old/testsuite/alsa/srcstate.c @@ -89,7 +89,7 @@ main (gint argc, gchar * argv[]) g_print ("The alsa plugin mastered another test.\n"); - gst_object_unref (GST_OBJECT (pipeline)); + gst_object_unref (pipeline); return 0; } diff --git a/tests/old/testsuite/alsa/state.c b/tests/old/testsuite/alsa/state.c index 3ca69e8..7462633 100644 --- a/tests/old/testsuite/alsa/state.c +++ b/tests/old/testsuite/alsa/state.c @@ -102,7 +102,7 @@ main (gint argc, gchar * argv[]) g_print ("The alsa plugin mastered another test.\n"); - gst_object_unref (GST_OBJECT (pipeline)); + gst_object_unref (pipeline); return 0; } diff --git a/testsuite/alsa/formats.c b/testsuite/alsa/formats.c index 2aa30e1..0142e9d 100644 --- a/testsuite/alsa/formats.c +++ b/testsuite/alsa/formats.c @@ -174,7 +174,7 @@ main (gint argc, gchar * argv[]) gst_bin_iterate (GST_BIN (pipeline)); if ((counter / 200) > last) { last = counter / 200; - gst_object_unref (GST_OBJECT (pipeline)); + gst_object_unref (pipeline); create_pipeline (); } } diff --git a/testsuite/alsa/srcstate.c b/testsuite/alsa/srcstate.c index 2d02348..de7ef9c 100644 --- a/testsuite/alsa/srcstate.c +++ b/testsuite/alsa/srcstate.c @@ -89,7 +89,7 @@ main (gint argc, gchar * argv[]) g_print ("The alsa plugin mastered another test.\n"); - gst_object_unref (GST_OBJECT (pipeline)); + gst_object_unref (pipeline); return 0; } diff --git a/testsuite/alsa/state.c b/testsuite/alsa/state.c index 3ca69e8..7462633 100644 --- a/testsuite/alsa/state.c +++ b/testsuite/alsa/state.c @@ -102,7 +102,7 @@ main (gint argc, gchar * argv[]) g_print ("The alsa plugin mastered another test.\n"); - gst_object_unref (GST_OBJECT (pipeline)); + gst_object_unref (pipeline); return 0; }