diff --git a/ChangeLog b/ChangeLog index a7f7c2fd3f..2013492bb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,30 @@ +2006-02-28 Wim Taymans + + * gst/gstbin.c: (gst_bin_get_type), (gst_bin_handle_message_func): + Help the compiler a bit with type registration. + Use existing forward cod path instead of duplicating it when + handling a message. + + * gst/gstbus.c: (gst_bus_get_type): + * gst/gstcaps.c: (gst_caps_get_type), (gst_static_caps_get_type): + * gst/gstchildproxy.c: (gst_child_proxy_get_type): + * gst/gstclock.c: (gst_clock_get_type): + * gst/gstelement.c: (gst_element_get_type), + * gst/gstelementfactory.c: (gst_element_factory_get_type): + * gst/gstindexfactory.c: (gst_index_factory_get_type): + * gst/gstminiobject.c: (gst_mini_object_get_type): + * gst/gstpad.c: (gst_pad_get_type): + * gst/gstsegment.c: (gst_segment_get_type): + * gst/gststructure.c: (gst_structure_get_type): + * gst/gstsystemclock.c: (gst_system_clock_get_type): + * gst/gsttask.c: (gst_task_get_type), (gst_task_join): + * gst/gstvalue.c: + Help compiler with type registration. + + * plugins/elements/gstqueue.c: (gst_queue_handle_sink_event): + Small doc update. + + 2006-02-27 Tim-Philipp Müller * plugins/elements/gsttypefindelement.c: diff --git a/gst/gstbin.c b/gst/gstbin.c index 339b7595a4..995ff430a2 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -203,7 +203,7 @@ gst_bin_get_type (void) { static GType gst_bin_type = 0; - if (!gst_bin_type) { + if (G_UNLIKELY (gst_bin_type == 0)) { static const GTypeInfo bin_info = { sizeof (GstBinClass), gst_bin_base_init, @@ -2020,12 +2020,8 @@ gst_bin_handle_message_func (GstBin * bin, GstMessage * message) not_toplevel: { GST_OBJECT_UNLOCK (bin); - GST_DEBUG_OBJECT (bin, "not toplevel"); - - /* post message up, mark parent bins dirty */ - gst_element_post_message (GST_ELEMENT_CAST (bin), message); - - break; + GST_DEBUG_OBJECT (bin, "not toplevel, forwarding"); + goto forward; } } case GST_MESSAGE_SEGMENT_START: @@ -2103,12 +2099,11 @@ gst_bin_handle_message_func (GstBin * bin, GstMessage * message) provided, playing, forward); GST_OBJECT_UNLOCK (bin); - if (forward) { + if (forward) goto forward; - } + /* free message */ gst_message_unref (message); - break; } case GST_MESSAGE_CLOCK_PROVIDE: @@ -2124,15 +2119,14 @@ gst_bin_handle_message_func (GstBin * bin, GstMessage * message) if (forward) goto forward; + /* free message */ gst_message_unref (message); - break; } default: goto forward; } - return; forward: diff --git a/gst/gstbus.c b/gst/gstbus.c index 35c535a50f..b9ee671e7e 100644 --- a/gst/gstbus.c +++ b/gst/gstbus.c @@ -110,7 +110,7 @@ gst_bus_get_type (void) { static GType bus_type = 0; - if (!bus_type) { + if (G_UNLIKELY (bus_type == 0)) { static const GTypeInfo bus_info = { sizeof (GstBusClass), NULL, diff --git a/gst/gstcaps.c b/gst/gstcaps.c index bdfb84d388..116c1d1c5f 100644 --- a/gst/gstcaps.c +++ b/gst/gstcaps.c @@ -103,7 +103,7 @@ gst_caps_get_type (void) { static GType gst_caps_type = 0; - if (!gst_caps_type) { + if (G_UNLIKELY (gst_caps_type == 0)) { gst_caps_type = g_boxed_type_register_static ("GstCaps", (GBoxedCopyFunc) gst_caps_copy_conditional, (GBoxedFreeFunc) gst_caps_unref); @@ -394,7 +394,7 @@ gst_static_caps_get_type (void) { static GType staticcaps_type = 0; - if (!staticcaps_type) { + if (G_UNLIKELY (staticcaps_type == 0)) { staticcaps_type = g_pointer_type_register_static ("GstStaticCaps"); } return staticcaps_type; diff --git a/gst/gstchildproxy.c b/gst/gstchildproxy.c index 5fb07bad1a..d5d6e39efa 100644 --- a/gst/gstchildproxy.c +++ b/gst/gstchildproxy.c @@ -454,7 +454,7 @@ gst_child_proxy_get_type (void) { static GType type = 0; - if (type == 0) { + if (G_UNLIKELY (type == 0)) { static const GTypeInfo info = { sizeof (GstChildProxyInterface), gst_child_proxy_base_init, /* base_init */ diff --git a/gst/gstclock.c b/gst/gstclock.c index afb07375c1..a6c682908c 100644 --- a/gst/gstclock.c +++ b/gst/gstclock.c @@ -497,7 +497,7 @@ gst_clock_get_type (void) { static GType clock_type = 0; - if (!clock_type) { + if (G_UNLIKELY (clock_type == 0)) { static const GTypeInfo clock_info = { sizeof (GstClockClass), NULL, diff --git a/gst/gstelement.c b/gst/gstelement.c index 2ad92889a7..900030279b 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -142,7 +142,7 @@ gst_element_get_type (void) { static GType gst_element_type = 0; - if (!gst_element_type) { + if (G_UNLIKELY (gst_element_type == 0)) { static const GTypeInfo element_info = { sizeof (GstElementClass), gst_element_base_class_init, diff --git a/gst/gstelementfactory.c b/gst/gstelementfactory.c index db5614c162..6958228aa9 100644 --- a/gst/gstelementfactory.c +++ b/gst/gstelementfactory.c @@ -79,7 +79,7 @@ gst_element_factory_get_type (void) { static GType elementfactory_type = 0; - if (!elementfactory_type) { + if (G_UNLIKELY (elementfactory_type == 0)) { static const GTypeInfo elementfactory_info = { sizeof (GstElementFactoryClass), NULL, diff --git a/gst/gstindexfactory.c b/gst/gstindexfactory.c index ed8bfb6e18..cad2abc9eb 100644 --- a/gst/gstindexfactory.c +++ b/gst/gstindexfactory.c @@ -50,7 +50,7 @@ gst_index_factory_get_type (void) { static GType indexfactory_type = 0; - if (!indexfactory_type) { + if (G_UNLIKELY (indexfactory_type == 0)) { static const GTypeInfo indexfactory_info = { sizeof (GstIndexFactoryClass), NULL, diff --git a/gst/gstminiobject.c b/gst/gstminiobject.c index d81adba616..3ffec9579f 100644 --- a/gst/gstminiobject.c +++ b/gst/gstminiobject.c @@ -65,7 +65,7 @@ gst_mini_object_get_type (void) { static GType _gst_mini_object_type = 0; - if (!_gst_mini_object_type) { + if (G_UNLIKELY (_gst_mini_object_type == 0)) { GTypeValueTable value_table = { gst_value_mini_object_init, gst_value_mini_object_free, diff --git a/gst/gstpad.c b/gst/gstpad.c index 81dc3a09f9..e267a1f705 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -187,7 +187,7 @@ gst_pad_get_type (void) { static GType gst_pad_type = 0; - if (!gst_pad_type) { + if (G_UNLIKELY (gst_pad_type == 0)) { static const GTypeInfo pad_info = { sizeof (GstPadClass), NULL, NULL, (GClassInitFunc) gst_pad_class_init, NULL, NULL, diff --git a/gst/gstsegment.c b/gst/gstsegment.c index 843400a94d..e2f987d6e1 100644 --- a/gst/gstsegment.c +++ b/gst/gstsegment.c @@ -97,7 +97,7 @@ gst_segment_get_type (void) { static GType gst_segment_type = 0; - if (!gst_segment_type) { + if (G_UNLIKELY (gst_segment_type == 0)) { gst_segment_type = g_boxed_type_register_static ("GstSegment", (GBoxedCopyFunc) gst_segment_copy, (GBoxedFreeFunc) gst_segment_free); } diff --git a/gst/gststructure.c b/gst/gststructure.c index ce433dab29..0d3cbc2701 100644 --- a/gst/gststructure.c +++ b/gst/gststructure.c @@ -93,7 +93,7 @@ gst_structure_get_type (void) { static GType gst_structure_type = 0; - if (!gst_structure_type) { + if (G_UNLIKELY (gst_structure_type == 0)) { gst_structure_type = g_boxed_type_register_static ("GstStructure", (GBoxedCopyFunc) gst_structure_copy_conditional, (GBoxedFreeFunc) gst_structure_free); diff --git a/gst/gstsystemclock.c b/gst/gstsystemclock.c index b226db04f5..eaf798b3b4 100644 --- a/gst/gstsystemclock.c +++ b/gst/gstsystemclock.c @@ -73,7 +73,7 @@ gst_system_clock_get_type (void) { static GType clock_type = 0; - if (!clock_type) { + if (G_UNLIKELY (clock_type == 0)) { static const GTypeInfo clock_info = { sizeof (GstSystemClockClass), NULL, diff --git a/gst/gsttask.c b/gst/gsttask.c index d6d01d5caa..d4824f69c5 100644 --- a/gst/gsttask.c +++ b/gst/gsttask.c @@ -81,7 +81,7 @@ gst_task_get_type (void) { static GType _gst_task_type = 0; - if (!_gst_task_type) { + if (G_UNLIKELY (_gst_task_type == 0)) { static const GTypeInfo task_info = { sizeof (GstTaskClass), NULL, diff --git a/gst/gstvalue.c b/gst/gstvalue.c index d31589cc72..39af6fe123 100644 --- a/gst/gstvalue.c +++ b/gst/gstvalue.c @@ -3655,7 +3655,7 @@ GType gst_ ## type ## _get_type (void) \ { \ static GType gst_ ## type ## _type = 0; \ \ - if (!gst_ ## type ## _type) { \ + if (G_UNLIKELY (gst_ ## type ## _type == 0)) { \ _info.value_table = & _gst_ ## type ## _value_table; \ gst_ ## type ## _type = g_type_register_fundamental ( \ g_type_fundamental_next (), \ diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index 2cea209f4a..42104fff60 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -520,7 +520,8 @@ gst_queue_handle_sink_event (GstPad * pad, GstEvent * event) g_cond_signal (queue->item_del); GST_QUEUE_MUTEX_UNLOCK (queue); - /* make sure it pauses */ + /* make sure it pauses, this should happen since we sent + * flush_start downstream. */ gst_pad_pause_task (queue->srcpad); GST_CAT_LOG_OBJECT (queue_dataflow, queue, "loop stopped"); goto done;