gst/gstbin.c: Help the compiler a bit with type registration.
authorWim Taymans <wim.taymans@gmail.com>
Tue, 28 Feb 2006 10:52:02 +0000 (10:52 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Tue, 28 Feb 2006 10:52:02 +0000 (10:52 +0000)
Original commit message from CVS:
* 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.

17 files changed:
ChangeLog
gst/gstbin.c
gst/gstbus.c
gst/gstcaps.c
gst/gstchildproxy.c
gst/gstclock.c
gst/gstelement.c
gst/gstelementfactory.c
gst/gstindexfactory.c
gst/gstminiobject.c
gst/gstpad.c
gst/gstsegment.c
gst/gststructure.c
gst/gstsystemclock.c
gst/gsttask.c
gst/gstvalue.c
plugins/elements/gstqueue.c

index a7f7c2f..2013492 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2006-02-28  Wim Taymans  <wim@fluendo.com>
+
+       * 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  <tim at centricular dot net>
 
        * plugins/elements/gsttypefindelement.c:
index 339b759..995ff43 100644 (file)
@@ -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:
index 35c535a..b9ee671 100644 (file)
@@ -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,
index bdfb84d..116c1d1 100644 (file)
@@ -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;
index 5fb07ba..d5d6e39 100644 (file)
@@ -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 */
index afb0737..a6c6829 100644 (file)
@@ -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,
index 2ad9288..9000302 100644 (file)
@@ -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,
index db5614c..6958228 100644 (file)
@@ -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,
index ed8bfb6..cad2abc 100644 (file)
@@ -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,
index d81adba..3ffec95 100644 (file)
@@ -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,
index 81dc3a0..e267a1f 100644 (file)
@@ -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,
index 843400a..e2f987d 100644 (file)
@@ -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);
   }
index ce433da..0d3cbc2 100644 (file)
@@ -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);
index b226db0..eaf798b 100644 (file)
@@ -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,
index d6d01d5..d4824f6 100644 (file)
@@ -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,
index d31589c..39af6fe 100644 (file)
@@ -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 (),                             \
index 2cea209..42104ff 100644 (file)
@@ -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;