gst/: correctly fix GEnumValues so that nick is the short lowercase dashed tag
authorThomas Vander Stichele <thomas@apestaart.org>
Tue, 22 Nov 2005 15:52:03 +0000 (15:52 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Tue, 22 Nov 2005 15:52:03 +0000 (15:52 +0000)
Original commit message from CVS:

* gst/elements/Makefile.am:
* gst/elements/gstfakesink.c: (gst_fake_sink_state_error_get_type):
* gst/elements/gstfakesrc.c: (gst_fake_src_data_get_type),
(gst_fake_src_sizetype_get_type), (gst_fake_src_filltype_get_type),
(gst_fake_src_init), (gst_fake_src_prepare_buffer),
(gst_fake_src_alloc_buffer), (gst_fake_src_get_size):
* gst/elements/gstfakesrc.h:
* gst/gstqueue.c: (queue_leaky_get_type):
correctly fix GEnumValues so that nick is the short lowercase
dashed tag
* tools/gst-inspect.c: (print_element_properties_info):
also show the nick, since it's useful to use from parse_launch
syntax
Fixes #322139

12 files changed:
ChangeLog
gst/elements/Makefile.am
gst/elements/gstfakesink.c
gst/elements/gstfakesrc.c
gst/elements/gstfakesrc.h
gst/gstqueue.c
plugins/elements/Makefile.am
plugins/elements/gstfakesink.c
plugins/elements/gstfakesrc.c
plugins/elements/gstfakesrc.h
plugins/elements/gstqueue.c
tools/gst-inspect.c

index 1571d26..e380b60 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2005-11-22  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+       * gst/elements/Makefile.am:
+       * gst/elements/gstfakesink.c: (gst_fake_sink_state_error_get_type):
+       * gst/elements/gstfakesrc.c: (gst_fake_src_data_get_type),
+       (gst_fake_src_sizetype_get_type), (gst_fake_src_filltype_get_type),
+       (gst_fake_src_init), (gst_fake_src_prepare_buffer),
+       (gst_fake_src_alloc_buffer), (gst_fake_src_get_size):
+       * gst/elements/gstfakesrc.h:
+       * gst/gstqueue.c: (queue_leaky_get_type):
+         correctly fix GEnumValues so that nick is the short lowercase
+         dashed tag
+       * tools/gst-inspect.c: (print_element_properties_info):
+         also show the nick, since it's useful to use from parse_launch
+         syntax
+         Fixes #322139
+
 2005-11-22  Michael Smith <msmith@fluendo.com>
 
        * gst/gstutils.c: (gst_util_clocktime_scale):
index 399f8e2..d6e639b 100644 (file)
@@ -1,6 +1,6 @@
 # FIXME:
 # need to get gstbufferstore.[ch] into its own lib, preferrably 
-# libs/gst/buifferstore
+# libs/gst/bufferstore
 # This requires building libs/gst before this dir, which we currently don't
 # do.
 
index 2c7389b..35a9396 100644 (file)
@@ -87,19 +87,19 @@ gst_fake_sink_state_error_get_type (void)
 {
   static GType fakesink_state_error_type = 0;
   static GEnumValue fakesink_state_error[] = {
-    {FAKE_SINK_STATE_ERROR_NONE, "0", "No state change errors"},
-    {FAKE_SINK_STATE_ERROR_NULL_READY, "1",
-        "Fail state change from NULL to READY"},
-    {FAKE_SINK_STATE_ERROR_READY_PAUSED, "2",
-        "Fail state change from READY to PAUSED"},
-    {FAKE_SINK_STATE_ERROR_PAUSED_PLAYING, "3",
-        "Fail state change from PAUSED to PLAYING"},
-    {FAKE_SINK_STATE_ERROR_PLAYING_PAUSED, "4",
-        "Fail state change from PLAYING to PAUSED"},
-    {FAKE_SINK_STATE_ERROR_PAUSED_READY, "5",
-        "Fail state change from PAUSED to READY"},
-    {FAKE_SINK_STATE_ERROR_READY_NULL, "6",
-        "Fail state change from READY to NULL"},
+    {FAKE_SINK_STATE_ERROR_NONE, "No state change errors", "none"},
+    {FAKE_SINK_STATE_ERROR_NULL_READY,
+        "Fail state change from NULL to READY", "null-to-ready"},
+    {FAKE_SINK_STATE_ERROR_READY_PAUSED,
+        "Fail state change from READY to PAUSED", "ready-to-paused"},
+    {FAKE_SINK_STATE_ERROR_PAUSED_PLAYING,
+        "Fail state change from PAUSED to PLAYING", "paused-to-playing"},
+    {FAKE_SINK_STATE_ERROR_PLAYING_PAUSED,
+        "Fail state change from PLAYING to PAUSED", "playing-to-paused"},
+    {FAKE_SINK_STATE_ERROR_PAUSED_READY,
+        "Fail state change from PAUSED to READY", "paused-to-ready"},
+    {FAKE_SINK_STATE_ERROR_READY_NULL,
+        "Fail state change from READY to NULL", "ready-to-null"},
     {0, NULL, NULL},
   };
 
index 0502b8f..c4fde28 100644 (file)
@@ -63,10 +63,10 @@ enum
 
 #define DEFAULT_OUTPUT         FAKE_SRC_FIRST_LAST_LOOP
 #define DEFAULT_DATA           FAKE_SRC_DATA_ALLOCATE
-#define DEFAULT_SIZETYPE       FAKE_SRC_SIZETYPE_NULL
+#define DEFAULT_SIZETYPE       FAKE_SRC_SIZETYPE_EMPTY
 #define DEFAULT_SIZEMIN                0
 #define DEFAULT_SIZEMAX                4096
-#define DEFAULT_FILLTYPE       FAKE_SRC_FILLTYPE_NULL
+#define DEFAULT_FILLTYPE       FAKE_SRC_FILLTYPE_ZERO
 #define DEFAULT_DATARATE       0
 #define DEFAULT_SYNC           FALSE
 #define DEFAULT_PATTERN                NULL
@@ -133,8 +133,8 @@ gst_fake_src_data_get_type (void)
 {
   static GType fakesrc_data_type = 0;
   static GEnumValue fakesrc_data[] = {
-    {FAKE_SRC_DATA_ALLOCATE, "1", "Allocate data"},
-    {FAKE_SRC_DATA_SUBBUFFER, "2", "Subbuffer data"},
+    {FAKE_SRC_DATA_ALLOCATE, "Allocate data", "allocate"},
+    {FAKE_SRC_DATA_SUBBUFFER, "Subbuffer data", "subbuffer"},
     {0, NULL, NULL},
   };
 
@@ -150,10 +150,10 @@ gst_fake_src_sizetype_get_type (void)
 {
   static GType fakesrc_sizetype_type = 0;
   static GEnumValue fakesrc_sizetype[] = {
-    {FAKE_SRC_SIZETYPE_NULL, "1", "Send empty buffers"},
-    {FAKE_SRC_SIZETYPE_FIXED, "2", "Fixed size buffers (sizemax sized)"},
-    {FAKE_SRC_SIZETYPE_RANDOM, "3",
-        "Random sized buffers (sizemin <= size <= sizemax)"},
+    {FAKE_SRC_SIZETYPE_EMPTY, "Send empty buffers", "empty"},
+    {FAKE_SRC_SIZETYPE_FIXED, "Fixed size buffers (sizemax sized)", "fixed"},
+    {FAKE_SRC_SIZETYPE_RANDOM,
+        "Random sized buffers (sizemin <= size <= sizemax)", "random"},
     {0, NULL, NULL},
   };
 
@@ -170,12 +170,14 @@ gst_fake_src_filltype_get_type (void)
 {
   static GType fakesrc_filltype_type = 0;
   static GEnumValue fakesrc_filltype[] = {
-    {FAKE_SRC_FILLTYPE_NOTHING, "1", "Leave data as malloced"},
-    {FAKE_SRC_FILLTYPE_NULL, "2", "Fill buffers with zeros"},
-    {FAKE_SRC_FILLTYPE_RANDOM, "3", "Fill buffers with random crap"},
-    {FAKE_SRC_FILLTYPE_PATTERN, "4", "Fill buffers with pattern 0x00 -> 0xff"},
-    {FAKE_SRC_FILLTYPE_PATTERN_CONT, "5",
-        "Fill buffers with pattern 0x00 -> 0xff that spans buffers"},
+    {FAKE_SRC_FILLTYPE_NOTHING, "Leave data as malloced", "nothing"},
+    {FAKE_SRC_FILLTYPE_ZERO, "Fill buffers with zeros", "zero"},
+    {FAKE_SRC_FILLTYPE_RANDOM, "Fill buffers with random crap", "random"},
+    {FAKE_SRC_FILLTYPE_PATTERN, "Fill buffers with pattern 0x00 -> 0xff",
+          "pattern"},
+    {FAKE_SRC_FILLTYPE_PATTERN_CONT,
+        "Fill buffers with pattern 0x00 -> 0xff that spans buffers",
+          "pattern-span"},
     {0, NULL, NULL},
   };
 
@@ -330,7 +332,7 @@ gst_fake_src_init (GstFakeSrc * fakesrc, GstFakeSrcClass * g_class)
   fakesrc->dump = DEFAULT_DUMP;
   fakesrc->pattern_byte = 0x00;
   fakesrc->data = FAKE_SRC_DATA_ALLOCATE;
-  fakesrc->sizetype = FAKE_SRC_SIZETYPE_NULL;
+  fakesrc->sizetype = FAKE_SRC_SIZETYPE_EMPTY;
   fakesrc->filltype = FAKE_SRC_FILLTYPE_NOTHING;
   fakesrc->sizemin = DEFAULT_SIZEMIN;
   fakesrc->sizemax = DEFAULT_SIZEMAX;
@@ -542,7 +544,7 @@ gst_fake_src_prepare_buffer (GstFakeSrc * src, GstBuffer * buf)
     return;
 
   switch (src->filltype) {
-    case FAKE_SRC_FILLTYPE_NULL:
+    case FAKE_SRC_FILLTYPE_ZERO:
       memset (GST_BUFFER_DATA (buf), 0, GST_BUFFER_SIZE (buf));
       break;
     case FAKE_SRC_FILLTYPE_RANDOM:
@@ -587,7 +589,7 @@ gst_fake_src_alloc_buffer (GstFakeSrc * src, guint size)
         GST_BUFFER_DATA (buf) = g_malloc (size);
         GST_BUFFER_MALLOCDATA (buf) = GST_BUFFER_DATA (buf);
         break;
-      case FAKE_SRC_FILLTYPE_NULL:
+      case FAKE_SRC_FILLTYPE_ZERO:
         GST_BUFFER_DATA (buf) = g_malloc0 (size);
         GST_BUFFER_MALLOCDATA (buf) = GST_BUFFER_DATA (buf);
         break;
@@ -620,7 +622,7 @@ gst_fake_src_get_size (GstFakeSrc * src)
           (guint8) (((gfloat) src->sizemax) * rand () / (RAND_MAX +
               (gfloat) src->sizemin));
       break;
-    case FAKE_SRC_SIZETYPE_NULL:
+    case FAKE_SRC_SIZETYPE_EMPTY:
     default:
       size = 0;
       break;
index 783db23..c8901cf 100644 (file)
@@ -46,14 +46,14 @@ typedef enum {
 } GstFakeSrcDataType;
 
 typedef enum {
-  FAKE_SRC_SIZETYPE_NULL = 1,
+  FAKE_SRC_SIZETYPE_EMPTY = 1,
   FAKE_SRC_SIZETYPE_FIXED,
   FAKE_SRC_SIZETYPE_RANDOM
 } GstFakeSrcSizeType;
 
 typedef enum {
   FAKE_SRC_FILLTYPE_NOTHING = 1,
-  FAKE_SRC_FILLTYPE_NULL,
+  FAKE_SRC_FILLTYPE_ZERO,
   FAKE_SRC_FILLTYPE_RANDOM,
   FAKE_SRC_FILLTYPE_PATTERN,
   FAKE_SRC_FILLTYPE_PATTERN_CONT
index c0f4085..d41b8df 100644 (file)
@@ -171,9 +171,9 @@ queue_leaky_get_type (void)
 {
   static GType queue_leaky_type = 0;
   static GEnumValue queue_leaky[] = {
-    {GST_QUEUE_NO_LEAK, "0", "Not Leaky"},
-    {GST_QUEUE_LEAK_UPSTREAM, "1", "Leaky on Upstream"},
-    {GST_QUEUE_LEAK_DOWNSTREAM, "2", "Leaky on Downstream"},
+    {GST_QUEUE_NO_LEAK, "Not Leaky", "no"},
+    {GST_QUEUE_LEAK_UPSTREAM, "Leaky on Upstream", "upstream"},
+    {GST_QUEUE_LEAK_DOWNSTREAM, "Leaky on Downstream", "downstream"},
     {0, NULL, NULL},
   };
 
index 399f8e2..d6e639b 100644 (file)
@@ -1,6 +1,6 @@
 # FIXME:
 # need to get gstbufferstore.[ch] into its own lib, preferrably 
-# libs/gst/buifferstore
+# libs/gst/bufferstore
 # This requires building libs/gst before this dir, which we currently don't
 # do.
 
index 2c7389b..35a9396 100644 (file)
@@ -87,19 +87,19 @@ gst_fake_sink_state_error_get_type (void)
 {
   static GType fakesink_state_error_type = 0;
   static GEnumValue fakesink_state_error[] = {
-    {FAKE_SINK_STATE_ERROR_NONE, "0", "No state change errors"},
-    {FAKE_SINK_STATE_ERROR_NULL_READY, "1",
-        "Fail state change from NULL to READY"},
-    {FAKE_SINK_STATE_ERROR_READY_PAUSED, "2",
-        "Fail state change from READY to PAUSED"},
-    {FAKE_SINK_STATE_ERROR_PAUSED_PLAYING, "3",
-        "Fail state change from PAUSED to PLAYING"},
-    {FAKE_SINK_STATE_ERROR_PLAYING_PAUSED, "4",
-        "Fail state change from PLAYING to PAUSED"},
-    {FAKE_SINK_STATE_ERROR_PAUSED_READY, "5",
-        "Fail state change from PAUSED to READY"},
-    {FAKE_SINK_STATE_ERROR_READY_NULL, "6",
-        "Fail state change from READY to NULL"},
+    {FAKE_SINK_STATE_ERROR_NONE, "No state change errors", "none"},
+    {FAKE_SINK_STATE_ERROR_NULL_READY,
+        "Fail state change from NULL to READY", "null-to-ready"},
+    {FAKE_SINK_STATE_ERROR_READY_PAUSED,
+        "Fail state change from READY to PAUSED", "ready-to-paused"},
+    {FAKE_SINK_STATE_ERROR_PAUSED_PLAYING,
+        "Fail state change from PAUSED to PLAYING", "paused-to-playing"},
+    {FAKE_SINK_STATE_ERROR_PLAYING_PAUSED,
+        "Fail state change from PLAYING to PAUSED", "playing-to-paused"},
+    {FAKE_SINK_STATE_ERROR_PAUSED_READY,
+        "Fail state change from PAUSED to READY", "paused-to-ready"},
+    {FAKE_SINK_STATE_ERROR_READY_NULL,
+        "Fail state change from READY to NULL", "ready-to-null"},
     {0, NULL, NULL},
   };
 
index 0502b8f..c4fde28 100644 (file)
@@ -63,10 +63,10 @@ enum
 
 #define DEFAULT_OUTPUT         FAKE_SRC_FIRST_LAST_LOOP
 #define DEFAULT_DATA           FAKE_SRC_DATA_ALLOCATE
-#define DEFAULT_SIZETYPE       FAKE_SRC_SIZETYPE_NULL
+#define DEFAULT_SIZETYPE       FAKE_SRC_SIZETYPE_EMPTY
 #define DEFAULT_SIZEMIN                0
 #define DEFAULT_SIZEMAX                4096
-#define DEFAULT_FILLTYPE       FAKE_SRC_FILLTYPE_NULL
+#define DEFAULT_FILLTYPE       FAKE_SRC_FILLTYPE_ZERO
 #define DEFAULT_DATARATE       0
 #define DEFAULT_SYNC           FALSE
 #define DEFAULT_PATTERN                NULL
@@ -133,8 +133,8 @@ gst_fake_src_data_get_type (void)
 {
   static GType fakesrc_data_type = 0;
   static GEnumValue fakesrc_data[] = {
-    {FAKE_SRC_DATA_ALLOCATE, "1", "Allocate data"},
-    {FAKE_SRC_DATA_SUBBUFFER, "2", "Subbuffer data"},
+    {FAKE_SRC_DATA_ALLOCATE, "Allocate data", "allocate"},
+    {FAKE_SRC_DATA_SUBBUFFER, "Subbuffer data", "subbuffer"},
     {0, NULL, NULL},
   };
 
@@ -150,10 +150,10 @@ gst_fake_src_sizetype_get_type (void)
 {
   static GType fakesrc_sizetype_type = 0;
   static GEnumValue fakesrc_sizetype[] = {
-    {FAKE_SRC_SIZETYPE_NULL, "1", "Send empty buffers"},
-    {FAKE_SRC_SIZETYPE_FIXED, "2", "Fixed size buffers (sizemax sized)"},
-    {FAKE_SRC_SIZETYPE_RANDOM, "3",
-        "Random sized buffers (sizemin <= size <= sizemax)"},
+    {FAKE_SRC_SIZETYPE_EMPTY, "Send empty buffers", "empty"},
+    {FAKE_SRC_SIZETYPE_FIXED, "Fixed size buffers (sizemax sized)", "fixed"},
+    {FAKE_SRC_SIZETYPE_RANDOM,
+        "Random sized buffers (sizemin <= size <= sizemax)", "random"},
     {0, NULL, NULL},
   };
 
@@ -170,12 +170,14 @@ gst_fake_src_filltype_get_type (void)
 {
   static GType fakesrc_filltype_type = 0;
   static GEnumValue fakesrc_filltype[] = {
-    {FAKE_SRC_FILLTYPE_NOTHING, "1", "Leave data as malloced"},
-    {FAKE_SRC_FILLTYPE_NULL, "2", "Fill buffers with zeros"},
-    {FAKE_SRC_FILLTYPE_RANDOM, "3", "Fill buffers with random crap"},
-    {FAKE_SRC_FILLTYPE_PATTERN, "4", "Fill buffers with pattern 0x00 -> 0xff"},
-    {FAKE_SRC_FILLTYPE_PATTERN_CONT, "5",
-        "Fill buffers with pattern 0x00 -> 0xff that spans buffers"},
+    {FAKE_SRC_FILLTYPE_NOTHING, "Leave data as malloced", "nothing"},
+    {FAKE_SRC_FILLTYPE_ZERO, "Fill buffers with zeros", "zero"},
+    {FAKE_SRC_FILLTYPE_RANDOM, "Fill buffers with random crap", "random"},
+    {FAKE_SRC_FILLTYPE_PATTERN, "Fill buffers with pattern 0x00 -> 0xff",
+          "pattern"},
+    {FAKE_SRC_FILLTYPE_PATTERN_CONT,
+        "Fill buffers with pattern 0x00 -> 0xff that spans buffers",
+          "pattern-span"},
     {0, NULL, NULL},
   };
 
@@ -330,7 +332,7 @@ gst_fake_src_init (GstFakeSrc * fakesrc, GstFakeSrcClass * g_class)
   fakesrc->dump = DEFAULT_DUMP;
   fakesrc->pattern_byte = 0x00;
   fakesrc->data = FAKE_SRC_DATA_ALLOCATE;
-  fakesrc->sizetype = FAKE_SRC_SIZETYPE_NULL;
+  fakesrc->sizetype = FAKE_SRC_SIZETYPE_EMPTY;
   fakesrc->filltype = FAKE_SRC_FILLTYPE_NOTHING;
   fakesrc->sizemin = DEFAULT_SIZEMIN;
   fakesrc->sizemax = DEFAULT_SIZEMAX;
@@ -542,7 +544,7 @@ gst_fake_src_prepare_buffer (GstFakeSrc * src, GstBuffer * buf)
     return;
 
   switch (src->filltype) {
-    case FAKE_SRC_FILLTYPE_NULL:
+    case FAKE_SRC_FILLTYPE_ZERO:
       memset (GST_BUFFER_DATA (buf), 0, GST_BUFFER_SIZE (buf));
       break;
     case FAKE_SRC_FILLTYPE_RANDOM:
@@ -587,7 +589,7 @@ gst_fake_src_alloc_buffer (GstFakeSrc * src, guint size)
         GST_BUFFER_DATA (buf) = g_malloc (size);
         GST_BUFFER_MALLOCDATA (buf) = GST_BUFFER_DATA (buf);
         break;
-      case FAKE_SRC_FILLTYPE_NULL:
+      case FAKE_SRC_FILLTYPE_ZERO:
         GST_BUFFER_DATA (buf) = g_malloc0 (size);
         GST_BUFFER_MALLOCDATA (buf) = GST_BUFFER_DATA (buf);
         break;
@@ -620,7 +622,7 @@ gst_fake_src_get_size (GstFakeSrc * src)
           (guint8) (((gfloat) src->sizemax) * rand () / (RAND_MAX +
               (gfloat) src->sizemin));
       break;
-    case FAKE_SRC_SIZETYPE_NULL:
+    case FAKE_SRC_SIZETYPE_EMPTY:
     default:
       size = 0;
       break;
index 783db23..c8901cf 100644 (file)
@@ -46,14 +46,14 @@ typedef enum {
 } GstFakeSrcDataType;
 
 typedef enum {
-  FAKE_SRC_SIZETYPE_NULL = 1,
+  FAKE_SRC_SIZETYPE_EMPTY = 1,
   FAKE_SRC_SIZETYPE_FIXED,
   FAKE_SRC_SIZETYPE_RANDOM
 } GstFakeSrcSizeType;
 
 typedef enum {
   FAKE_SRC_FILLTYPE_NOTHING = 1,
-  FAKE_SRC_FILLTYPE_NULL,
+  FAKE_SRC_FILLTYPE_ZERO,
   FAKE_SRC_FILLTYPE_RANDOM,
   FAKE_SRC_FILLTYPE_PATTERN,
   FAKE_SRC_FILLTYPE_PATTERN_CONT
index c0f4085..d41b8df 100644 (file)
@@ -171,9 +171,9 @@ queue_leaky_get_type (void)
 {
   static GType queue_leaky_type = 0;
   static GEnumValue queue_leaky[] = {
-    {GST_QUEUE_NO_LEAK, "0", "Not Leaky"},
-    {GST_QUEUE_LEAK_UPSTREAM, "1", "Leaky on Upstream"},
-    {GST_QUEUE_LEAK_DOWNSTREAM, "2", "Leaky on Downstream"},
+    {GST_QUEUE_NO_LEAK, "Not Leaky", "no"},
+    {GST_QUEUE_LEAK_UPSTREAM, "Leaky on Upstream", "upstream"},
+    {GST_QUEUE_LEAK_DOWNSTREAM, "Leaky on Downstream", "downstream"},
     {0, NULL, NULL},
   };
 
index 8ea664f..34d18e1 100644 (file)
@@ -453,8 +453,9 @@ print_element_properties_info (GstElement * element)
 
           j = 0;
           while (values[j].value_name) {
-            g_print ("\n%s%-23.23s    (%d): \t%s", "",
-                _name, values[j].value, values[j].value_nick);
+            g_print ("\n%s%-23.23s    %d) %-16s - %s", "",
+                _name, values[j].value, values[j].value_nick,
+                values[j].value_name);
             j++;
           }
           /* g_type_class_unref (ec); */