From: <bi...@ke...> - 2006-05-08 17:06:06
|
CVS Root: /cvs/gstreamer Module: gnonlin Changes by: bilboed Date: Mon May 08 2006 14:04:46 UTC Log message: * gnl/gnlcomposition.c: (gnl_composition_finalize), (gnl_composition_handle_message), (gnl_composition_ghost_pad_set_target), (gnl_composition_change_state), (no_more_pads_object_cb), (update_pipeline): * gnl/gnlfilesource.c: (gnl_filesource_init): * gnl/gnlobject.c: (translate_incoming_seek), (gnl_object_ghost_pad_full), (gnl_object_remove_ghost_pad), (gnl_object_change_state): * gnl/gnlsource.c: (gnl_source_class_init), (gnl_source_prepare), (element_pad_added_cb), (element_pad_removed_cb), (ghost_seek_pad), (pad_event_probe), (has_dynamic_srcpads), (gnl_source_control_element_func), (gnl_source_add_element), (gnl_source_remove_element), (gnl_source_change_state): * gnl/gnlsource.h: Indent properly using gstreamer/tools/gst-indent Modified files: . : ChangeLog gnl : gnlcomposition.c gnlfilesource.c gnlobject.c gnlsource.c gnlsource.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gnonlin/ChangeLog.diff?r1=1.114&r2=1.115 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gnonlin/gnl/gnlcomposition.c.diff?r1=1.43&r2=1.44 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gnonlin/gnl/gnlfilesource.c.diff?r1=1.18&r2=1.19 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gnonlin/gnl/gnlobject.c.diff?r1=1.35&r2=1.36 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gnonlin/gnl/gnlsource.c.diff?r1=1.42&r2=1.43 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gnonlin/gnl/gnlsource.h.diff?r1=1.18&r2=1.19 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gnonlin/ChangeLog,v retrieving revision 1.114 retrieving revision 1.115 diff -u -d -r1.114 -r1.115 --- ChangeLog 8 May 2006 14:00:10 -0000 1.114 +++ ChangeLog 8 May 2006 14:04:33 -0000 1.115 @@ -1,5 +1,24 @@ 2006-05-08 Edward Hervey <ed...@fl...> + * gnl/gnlcomposition.c: (gnl_composition_finalize), + (gnl_composition_handle_message), + (gnl_composition_ghost_pad_set_target), + (gnl_composition_change_state), (no_more_pads_object_cb), + (update_pipeline): + * gnl/gnlfilesource.c: (gnl_filesource_init): + * gnl/gnlobject.c: (translate_incoming_seek), + (gnl_object_ghost_pad_full), (gnl_object_remove_ghost_pad), + (gnl_object_change_state): + * gnl/gnlsource.c: (gnl_source_class_init), (gnl_source_prepare), + (element_pad_added_cb), (element_pad_removed_cb), (ghost_seek_pad), + (pad_event_probe), (has_dynamic_srcpads), + (gnl_source_control_element_func), (gnl_source_add_element), + (gnl_source_remove_element), (gnl_source_change_state): + * gnl/gnlsource.h: + Indent properly using gstreamer/tools/gst-indent + +2006-05-08 Edward Hervey <ed...@fl...> * gnl/gnlcomposition.c: (gnl_composition_ghost_pad_set_target), (get_src_pad), (update_pipeline): Convert non-fatal GST_WARNING to GST_DEBUG. Index: gnlcomposition.c RCS file: /cvs/gstreamer/gnonlin/gnl/gnlcomposition.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- gnlcomposition.c 8 May 2006 14:00:10 -0000 1.43 +++ gnlcomposition.c 8 May 2006 14:04:33 -0000 1.44 @@ -249,7 +249,7 @@ COMP_OBJECTS_LOCK (comp); g_list_free (comp->private->objects_start); g_list_free (comp->private->objects_stop); - g_list_free(comp->private->current); + g_list_free (comp->private->current); g_hash_table_destroy (comp->private->objects_hash); COMP_OBJECTS_UNLOCK (comp); @@ -370,29 +370,32 @@ if (!(comp->private->current)) { GST_DEBUG_OBJECT (comp, "Nothing else to play"); - /* - We drop all segments and only emit SEGMENT_DONE if segment->flags had segment - and we've finished. - */ - gst_message_unref (message); + /* + We drop all segments and only emit SEGMENT_DONE if segment->flags had segment + and we've finished. + */ + gst_message_unref (message); if (!(comp->private->segment->flags & GST_SEEK_FLAG_SEGMENT) - && comp->private->ghostpad) - gst_pad_push_event (comp->private->ghostpad, gst_event_new_eos ()); - else if (comp->private->segment->flags & GST_SEEK_FLAG_SEGMENT) { - gint64 epos; - if (GST_CLOCK_TIME_IS_VALID(comp->private->segment->stop)) - epos = (MIN (comp->private->segment->stop, GNL_OBJECT (comp)->stop)); - else - epos = (GNL_OBJECT (comp)->stop); - - GST_BIN_CLASS (parent_class)->handle_message - (bin, gst_message_new_segment_done(GST_OBJECT (comp), comp->private->segment->format, epos)); - } + && comp->private->ghostpad) + gst_pad_push_event (comp->private->ghostpad, gst_event_new_eos ()); + else if (comp->private->segment->flags & GST_SEEK_FLAG_SEGMENT) { + gint64 epos; + if (GST_CLOCK_TIME_IS_VALID (comp->private->segment->stop)) + epos = + (MIN (comp->private->segment->stop, GNL_OBJECT (comp)->stop)); + else + epos = (GNL_OBJECT (comp)->stop); + GST_BIN_CLASS (parent_class)->handle_message + (bin, gst_message_new_segment_done (GST_OBJECT (comp), + comp->private->segment->format, epos)); + } GST_DEBUG_OBJECT (comp, "END of Nothing else to play"); } - return; + return; } else { GST_DEBUG_OBJECT (comp, "position outside current segment, discarding message"); @@ -547,7 +550,8 @@ gst_ghost_pad_get_target (GST_GHOST_PAD (comp->private->ghostpad)); if (ptarget == target) { - GST_DEBUG_OBJECT (comp, "Target of ghostpad is the same as existing one, not changing"); + GST_DEBUG_OBJECT (comp, + "Target of ghostpad is the same as existing one, not changing"); gst_object_unref (ptarget); gst_object_ref (target); return; @@ -555,7 +559,7 @@ GST_DEBUG_OBJECT (comp, "Previous target was %s:%s, blocking that pad", GST_DEBUG_PAD_NAME (ptarget)); - gst_object_unref (ptarget); } @@ -761,11 +765,11 @@ /* set ghostpad target */ if (!(update_pipeline (comp, COMP_REAL_START (comp), TRUE, FALSE))) { ret = GST_STATE_CHANGE_FAILURE; - goto beach; + goto beach; } break; - case GST_STATE_CHANGE_PAUSED_TO_READY: - case GST_STATE_CHANGE_READY_TO_NULL: + case GST_STATE_CHANGE_PAUSED_TO_READY: + case GST_STATE_CHANGE_READY_TO_NULL: gnl_composition_reset (comp); default: @@ -778,14 +782,13 @@ return ret; switch (transition) { - case GST_STATE_CHANGE_NULL_TO_READY:{ + case GST_STATE_CHANGE_NULL_TO_READY:{ GstIterator *childs; GstIteratorResult res; GValue val = { 0 }; /* state-lock all elements */ - GST_DEBUG_OBJECT (comp, - "Locking all childs"); + GST_DEBUG_OBJECT (comp, "Locking all childs"); g_value_init (&val, G_TYPE_BOOLEAN); g_value_set_boolean (&val, FALSE); childs = gst_bin_iterate_elements (GST_BIN (comp)); @@ -908,10 +911,10 @@ /* toplevel element */ gnl_composition_ghost_pad_set_target (comp, pad); - if (comp->private->childseek) - if (!(gst_pad_send_event (pad, comp->private->childseek))) - GST_WARNING_OBJECT (comp, "Sending seek event failed!"); - comp->private->childseek = NULL; + if (comp->private->childseek) + if (!(gst_pad_send_event (pad, comp->private->childseek))) + GST_WARNING_OBJECT (comp, "Sending seek event failed!"); + comp->private->childseek = NULL; /* remove signal handler */ g_signal_handler_disconnect (object, entry->nomorepadshandler); @@ -1125,7 +1128,7 @@ comp->private->segment_start = currenttime; comp->private->segment_stop = new_stop; - /* Clear pending child seek*/ + /* Clear pending child seek */ if (comp->private->childseek) { gst_event_unref (comp->private->childseek); comp->private->childseek = NULL; @@ -1138,8 +1141,8 @@ /* state-lock elements no more used */ while (deactivate) { - if (change_state) - gst_element_set_state (GST_ELEMENT (deactivate->data), state); + if (change_state) + gst_element_set_state (GST_ELEMENT (deactivate->data), state); gst_element_set_locked_state (GST_ELEMENT (deactivate->data), TRUE); deactivate = g_list_next (deactivate); @@ -1171,14 +1174,14 @@ while (stack) { gst_element_set_locked_state (GST_ELEMENT (stack->data), FALSE); if (change_state) - gst_element_set_state (GST_ELEMENT (stack->data), nextstate); + gst_element_set_state (GST_ELEMENT (stack->data), nextstate); stack = g_list_next (stack); } GST_DEBUG_OBJECT (comp, "Finished activating objects in new stack"); if (comp->private->current) { - GstEvent * event; + GstEvent *event; event = get_new_seek_event (comp, initial); @@ -1193,14 +1196,14 @@ GST_DEBUG_OBJECT (comp->private->current, "Couldn't get the source pad.. storing the pending child seek"); - comp->private->childseek = event; + comp->private->childseek = event; ret = TRUE; } else { COMP_OBJECTS_UNLOCK (comp); - GST_DEBUG_OBJECT (comp, "Returning %d", ret); return ret; Index: gnlfilesource.c RCS file: /cvs/gstreamer/gnonlin/gnl/gnlfilesource.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- gnlfilesource.c 8 May 2006 11:29:53 -0000 1.18 +++ gnlfilesource.c 8 May 2006 14:04:33 -0000 1.19 @@ -103,7 +103,7 @@ static void gnl_filesource_init (GnlFileSource * filesource, GnlFileSourceClass * klass) { - GstElement *filesrc, *decodebin; + GstElement *filesrc, *decodebin; GST_OBJECT_FLAG_SET (filesource, GNL_OBJECT_SOURCE); filesource->private = g_new0 (GnlFileSourcePrivate, 1); @@ -122,15 +122,14 @@ ("Could not create a decodebin element, are you sure you have decodebin installed ?"); filesource->private->filesource = filesrc; - gst_bin_add_many (GST_BIN (filesource), - filesrc, decodebin, NULL); - if (!(gst_element_link (filesrc, - decodebin))) + gst_bin_add_many (GST_BIN (filesource), filesrc, decodebin, NULL); + if (!(gst_element_link (filesrc, decodebin))) g_warning ("Could not link the file source element to decodebin"); - GNL_SOURCE_GET_CLASS (filesource)->control_element (GNL_SOURCE (filesource), decodebin); + GNL_SOURCE_GET_CLASS (filesource)->control_element (GNL_SOURCE (filesource), + decodebin); GST_DEBUG_OBJECT (filesource, "done"); } Index: gnlobject.c RCS file: /cvs/gstreamer/gnonlin/gnl/gnlobject.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- gnlobject.c 5 May 2006 12:34:32 -0000 1.35 +++ gnlobject.c 8 May 2006 14:04:33 -0000 1.36 @@ -464,7 +464,7 @@ "event already has GST_SEEK_FLAG_ACCURATE : %d", flags); GST_DEBUG_OBJECT (object, "SENDING SEEK rate:%f, format:TIME, flags:%d, curtype:SET, stoptype:SET, %" @@ -862,7 +862,7 @@ GstPad *ghost; GST_DEBUG_OBJECT (object, "name:%s, target:%p, flush_hack:%d", - name, target, flush_hack); + name, target, flush_hack); g_return_val_if_fail (target, FALSE); g_return_val_if_fail ((dir != GST_PAD_UNKNOWN), FALSE); @@ -931,9 +931,8 @@ GnlPadPrivate *priv; - GST_DEBUG_OBJECT (object, "ghostpad %s:%s", - GST_DEBUG_PAD_NAME (ghost)); + GST_DEBUG_OBJECT (object, "ghostpad %s:%s", GST_DEBUG_PAD_NAME (ghost)); priv = gst_pad_get_element_private (ghost); gst_element_remove_pad (GST_ELEMENT (object), ghost); if (priv) @@ -1215,16 +1214,16 @@ gnl_object_change_state (GstElement * element, GstStateChange transition) GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; - case GST_STATE_CHANGE_READY_TO_PAUSED: - if (gnl_object_prepare (GNL_OBJECT (element)) == GST_STATE_CHANGE_FAILURE) { - ret = GST_STATE_CHANGE_FAILURE; - goto beach; - } - break; - default: + case GST_STATE_CHANGE_READY_TO_PAUSED: + if (gnl_object_prepare (GNL_OBJECT (element)) == GST_STATE_CHANGE_FAILURE) { + ret = GST_STATE_CHANGE_FAILURE; + } + break; + default: GST_DEBUG_OBJECT (element, "Calling parent change_state"); @@ -1235,17 +1234,17 @@ if (ret == GST_STATE_CHANGE_FAILURE) goto beach; case GST_STATE_CHANGE_PAUSED_TO_READY: /* cleanup gnlobject */ if (gnl_object_cleanup (GNL_OBJECT (element)) == GST_STATE_CHANGE_FAILURE) - ret = GST_STATE_CHANGE_FAILURE; - beach: +beach: Index: gnlsource.c RCS file: /cvs/gstreamer/gnonlin/gnl/gnlsource.c,v retrieving revision 1.42 diff -u -d -r1.42 -r1.43 --- gnlsource.c 8 May 2006 11:29:53 -0000 1.42 +++ gnlsource.c 8 May 2006 14:04:33 -0000 1.43 @@ -46,13 +46,13 @@ gboolean dispose_has_run; - gboolean dynamicpads; /* TRUE if the controlled element has dynamic pads */ - GstPad *ghostpad; /* The source ghostpad */ - GstEvent *event; /* queued event */ + gboolean dynamicpads; /* TRUE if the controlled element has dynamic pads */ + GstPad *ghostpad; /* The source ghostpad */ + GstEvent *event; /* queued event */ - gulong padremovedid; /* signal handler for element pad-removed signal*/ - gulong padaddedid; /* signal handler for element pad-added signal*/ - gulong eventprobeid; /* signal handler for event probe */ + gulong padremovedid; /* signal handler for element pad-removed signal */ + gulong padaddedid; /* signal handler for element pad-added signal */ + gulong eventprobeid; /* signal handler for event probe */ }; static gboolean gnl_source_prepare (GnlObject * object); @@ -64,14 +64,12 @@ static void gnl_source_dispose (GObject * object); static void gnl_source_finalize (GObject * object); -static gboolean -gnl_source_send_event (GstElement * element, GstEvent * event); +static gboolean gnl_source_send_event (GstElement * element, GstEvent * event); static GstStateChangeReturn gnl_source_change_state (GstElement * element, GstStateChange transition); -static void -pad_blocked_cb (GstPad * pad, gboolean blocked, GnlSource * source); +static void pad_blocked_cb (GstPad * pad, gboolean blocked, GnlSource * source); static gboolean pad_event_probe (GstPad * pad, GstEvent * event, GnlSource * source); @@ -113,7 +111,7 @@ gstbin_class->remove_element = GST_DEBUG_FUNCPTR (gnl_source_remove_element); gstelement_class->send_event = GST_DEBUG_FUNCPTR (gnl_source_send_event); - gstelement_class->change_state = GST_DEBUG_FUNCPTR (gnl_source_change_state); + gstelement_class->change_state = GST_DEBUG_FUNCPTR (gnl_source_change_state); gobject_class->dispose = GST_DEBUG_FUNCPTR (gnl_source_dispose); gobject_class->finalize = GST_DEBUG_FUNCPTR (gnl_source_finalize); @@ -173,21 +171,22 @@ gnl_source_prepare (GnlObject * object) - GnlSource * source = GNL_SOURCE (object); - GstElement * parent = (GstElement*) gst_element_get_parent ((GstElement *) object); + GnlSource *source = GNL_SOURCE (object); + GstElement *parent = + (GstElement *) gst_element_get_parent ((GstElement *) object); if (!GNL_IS_COMPOSITION (parent)) { /* Figure out if we're in a composition */ if (source->priv->event) gst_event_unref (source->priv->event); GST_DEBUG_OBJECT (object, "Creating initial seek"); source->priv->event = gst_event_new_seek (1.0, GST_FORMAT_TIME, - GST_SEEK_FLAG_ACCURATE, - GST_SEEK_TYPE_SET, object->media_start, - GST_SEEK_TYPE_SET, object->media_stop); + GST_SEEK_FLAG_ACCURATE, + GST_SEEK_TYPE_SET, object->media_start, + GST_SEEK_TYPE_SET, object->media_stop); gst_object_unref (parent); @@ -214,14 +213,14 @@ GST_DEBUG_OBJECT (pad, "valid pad, about to add event probe and pad block"); source->priv->eventprobeid = gst_pad_add_event_probe - (pad, G_CALLBACK (pad_event_probe), source); + (pad, G_CALLBACK (pad_event_probe), source); if (!(gst_pad_set_blocked_async (pad, TRUE, - (GstPadBlockCallback) pad_blocked_cb, source))) + (GstPadBlockCallback) pad_blocked_cb, source))) GST_WARNING_OBJECT (source, "Couldn't set Async pad blocking"); GST_DEBUG_OBJECT (source, "Done handling pad %s:%s", - GST_DEBUG_PAD_NAME (pad)); + GST_DEBUG_PAD_NAME (pad)); @@ -230,14 +229,15 @@ GST_DEBUG_OBJECT (source, "pad %s:%s", GST_DEBUG_PAD_NAME (pad)); if (source->priv->ghostpad) { - GstPad *target = gst_ghost_pad_get_target (GST_GHOST_PAD (source->priv->ghostpad)); + GstPad *target = + gst_ghost_pad_get_target (GST_GHOST_PAD (source->priv->ghostpad)); if (target == pad) { gst_pad_set_blocked (target, FALSE); - if (source->priv->eventprobeid) { - gst_pad_remove_event_probe (target, source->priv->eventprobeid); - source->priv->eventprobeid = 0; + gst_pad_remove_event_probe (target, source->priv->eventprobeid); + source->priv->eventprobeid = 0; gnl_object_remove_ghost_pad (GNL_OBJECT (source), source->priv->ghostpad); @@ -325,7 +325,7 @@ gst_object_unref (pad); return FALSE; @@ -343,19 +343,18 @@ pad_event_probe (GstPad * pad, GstEvent * event, GnlSource * source) GST_DEBUG_OBJECT (source, "event %s on pad %s:%s ", - GST_EVENT_TYPE_NAME (event), + GST_EVENT_TYPE_NAME (event), GST_DEBUG_PAD_NAME (pad)); if (source->priv->ghostpad) return TRUE; switch (GST_EVENT_TYPE (event)) { - case GST_EVENT_FLUSH_START: - case GST_EVENT_FLUSH_STOP: - return TRUE; - g_idle_add ((GSourceFunc) ghost_seek_pad, source); - return FALSE; + case GST_EVENT_FLUSH_START: + case GST_EVENT_FLUSH_STOP: + return TRUE; + g_idle_add ((GSourceFunc) ghost_seek_pad, source); + return FALSE; @@ -368,16 +367,17 @@ has_dynamic_srcpads (GstElement * element) gboolean ret = TRUE; - GList * templates; - GstPadTemplate * template; - templates = gst_element_class_get_pad_template_list (GST_ELEMENT_GET_CLASS (element)); + GList *templates; + GstPadTemplate *template; + templates = + gst_element_class_get_pad_template_list (GST_ELEMENT_GET_CLASS (element)); while (templates) { template = (GstPadTemplate *) templates->data; - if ((GST_PAD_TEMPLATE_DIRECTION(template) == GST_PAD_SRC) - && (GST_PAD_TEMPLATE_PRESENCE (template) == GST_PAD_ALWAYS)) { + if ((GST_PAD_TEMPLATE_DIRECTION (template) == GST_PAD_SRC) + && (GST_PAD_TEMPLATE_PRESENCE (template) == GST_PAD_ALWAYS)) { ret = FALSE; @@ -394,8 +394,7 @@ GstPad *pad = NULL; GST_DEBUG_OBJECT (source, "element:%s, source->element:%p", - GST_ELEMENT_NAME (element), - source->element); + GST_ELEMENT_NAME (element), source->element); g_return_val_if_fail (source->element == NULL, FALSE); @@ -404,18 +403,21 @@ if (get_valid_src_pad (source, source->element, &pad)) { gst_object_unref (pad); - GST_DEBUG_OBJECT (source, "There is a valid source pad, we consider the object as NOT having dynamic pads"); + GST_DEBUG_OBJECT (source, + "There is a valid source pad, we consider the object as NOT having dynamic pads"); source->priv->dynamicpads = FALSE; - source->priv->dynamicpads = has_dynamic_srcpads(element); + source->priv->dynamicpads = has_dynamic_srcpads (element); GST_DEBUG_OBJECT (source, "No valid source pad yet, dynamicpads:%d", - source->priv->dynamicpads); + source->priv->dynamicpads); if (source->priv->dynamicpads) { /* connect to pad-added/removed signals */ source->priv->padremovedid = g_signal_connect - (G_OBJECT (element), "pad-removed", G_CALLBACK (element_pad_removed_cb), source); - source->priv->padaddedid = g_signal_connect - (G_OBJECT (element), "pad-added", G_CALLBACK (element_pad_added_cb), source); + (G_OBJECT (element), "pad-removed", + G_CALLBACK (element_pad_removed_cb), source); + source->priv->padaddedid = + g_signal_connect (G_OBJECT (element), "pad-added", + G_CALLBACK (element_pad_added_cb), source); @@ -428,9 +430,8 @@ GnlSource *source = GNL_SOURCE (bin); gboolean pret; - GST_DEBUG_OBJECT (source, "Adding element %s", - GST_ELEMENT_NAME (element)); + GST_DEBUG_OBJECT (source, "Adding element %s", GST_ELEMENT_NAME (element)); if (GNL_SOURCE_GET_CLASS (source)->controls_one && source->element) { GST_WARNING_OBJECT (bin, "GnlSource can only handle one element at a time"); return FALSE; @@ -451,9 +452,8 @@ - GST_DEBUG_OBJECT (source, "Removing element %s", + GST_DEBUG_OBJECT (source, "Removing element %s", GST_ELEMENT_NAME (element)); /* try to remove it */ pret = GST_BIN_CLASS (parent_class)->remove_element (bin, element); @@ -476,13 +476,11 @@ /* remove signal handlers */ if (source->priv->padremovedid) { - g_signal_handler_disconnect (source->element, - source->priv->padremovedid); + g_signal_handler_disconnect (source->element, source->priv->padremovedid); source->priv->padremovedid = 0; if (source->priv->padaddedid) { - source->priv->padaddedid); + g_signal_handler_disconnect (source->element, source->priv->padaddedid); source->priv->padaddedid = 0; @@ -519,41 +517,42 @@ gnl_source_change_state (GstElement * element, GstStateChange transition) - GnlSource * source = GNL_SOURCE (element); + GnlSource *source = GNL_SOURCE (element); - if (!source->element) { - GST_WARNING_OBJECT (source, "GnlSource doesn't have an element to control !"); - GST_LOG_OBJECT (source, "ghostpad:%p, dynamicpads:%d", - source->priv->ghostpad, source->priv->dynamicpads); + if (!source->element) { + GST_WARNING_OBJECT (source, + "GnlSource doesn't have an element to control !"); - if (!(source->priv->ghostpad)) { - GstPad * pad; + GST_LOG_OBJECT (source, "ghostpad:%p, dynamicpads:%d", + source->priv->ghostpad, source->priv->dynamicpads); - GST_LOG_OBJECT (source, "no ghostpad and not dynamic pads"); + if (!(source->priv->ghostpad)) { + GstPad *pad; - /* Do an async block on valid source pad */ - if (!(get_valid_src_pad (source, source->element, &pad))) { - GST_WARNING_OBJECT (source, "Couldn't find a valid source pad"); - } else { - GST_LOG_OBJECT (source, "Trying to async block source pad"); - if (!(source->priv->eventprobeid)) - source->priv->eventprobeid = gst_pad_add_event_probe - gst_pad_set_blocked_async (pad, TRUE, - (GstPadBlockCallback) pad_blocked_cb, source); - gst_object_unref (pad); + GST_LOG_OBJECT (source, "no ghostpad and not dynamic pads"); + /* Do an async block on valid source pad */ + if (!(get_valid_src_pad (source, source->element, &pad))) { + GST_WARNING_OBJECT (source, "Couldn't find a valid source pad"); + } else { + GST_LOG_OBJECT (source, "Trying to async block source pad"); + if (!(source->priv->eventprobeid)) + source->priv->eventprobeid = gst_pad_add_event_probe + (pad, G_CALLBACK (pad_event_probe), source); + gst_pad_set_blocked_async (pad, TRUE, + (GstPadBlockCallback) pad_blocked_cb, source); + gst_object_unref (pad); + } @@ -565,20 +564,22 @@ - if (source->priv->ghostpad) { - GstPad * target = gst_ghost_pad_get_target ((GstGhostPad *) source->priv->ghostpad); - gst_pad_set_blocked_async (target, FALSE, - (GstPadBlockCallback) pad_blocked_cb, source); - gnl_object_remove_ghost_pad (GNL_OBJECT (source), source->priv->ghostpad); - source->priv->ghostpad = NULL; - gst_object_unref (target); + if (source->priv->ghostpad) { + GstPad *target = + gst_ghost_pad_get_target ((GstGhostPad *) source->priv->ghostpad); + gst_pad_set_blocked_async (target, FALSE, + (GstPadBlockCallback) pad_blocked_cb, source); + gnl_object_remove_ghost_pad (GNL_OBJECT (source), + source->priv->ghostpad); + source->priv->ghostpad = NULL; + gst_object_unref (target); Index: gnlsource.h RCS file: /cvs/gstreamer/gnonlin/gnl/gnlsource.h,v --- gnlsource.h 8 May 2006 11:29:53 -0000 1.18 +++ gnlsource.h 8 May 2006 14:04:34 -0000 1.19 @@ -57,9 +57,9 @@ GnlObjectClass parent_class; /* controls_one is TRUE if the class only controls one element */ - gboolean controls_one; + gboolean controls_one; /* control_element() takes care of controlling the given element */ - gboolean (*control_element) (GnlSource * source, GstElement * element); + gboolean (*control_element) (GnlSource * source, GstElement * element); GType gnl_source_get_type (void); |