- make all _get_list functions return a const reference to original lists and no...
authorBenjamin Otte <otte@gnome.org>
Fri, 19 Apr 2002 19:49:41 +0000 (19:49 +0000)
committerBenjamin Otte <otte@gnome.org>
Fri, 19 Apr 2002 19:49:41 +0000 (19:49 +0000)
Original commit message from CVS:
- make all _get_list functions return a const reference to original lists and no copy
- redo code accordingly
- fix compile issue in dparam stuff

15 files changed:
gst/gstautoplug.c
gst/gstautoplug.h
gst/gstbin.c
gst/gstbin.h
gst/gstplugin.c
gst/gstplugin.h
gst/gstscheduler.c
gst/gstscheduler.h
gst/gstthread.c
gst/gsttype.c
gst/gsttype.h
gst/gsttypefind.c
libs/gst/control/unitconvert.c
tools/gst-compprep.c
tools/gst-inspect.c

index 74f7085..f2ef2c2 100644 (file)
@@ -313,7 +313,7 @@ gst_autoplug_factory_find (const gchar *name)
  *
  * Returns: GList of type #GstAutoplugFactory
  */
-GList*
+const GList*
 gst_autoplug_factory_get_list (void)
 {
   return _gst_autoplugfactories;
index 5cc8da2..3b50b2b 100644 (file)
@@ -114,7 +114,7 @@ GstAutoplugFactory* gst_autoplug_factory_new                        (const gchar *name, const gchar *
 void                    gst_autoplug_factory_destroy           (GstAutoplugFactory *factory);
 
 GstAutoplugFactory*    gst_autoplug_factory_find               (const gchar *name);
-GList*                 gst_autoplug_factory_get_list           (void);
+const GList*           gst_autoplug_factory_get_list           (void);
 
 GstAutoplug*           gst_autoplug_factory_create             (GstAutoplugFactory *factory);
 GstAutoplug*           gst_autoplug_factory_make               (const gchar *name);
index c1fc641..8a85ee3 100644 (file)
@@ -725,7 +725,7 @@ gst_bin_get_by_name_recurse_up (GstBin * bin, const gchar * name)
  *
  * Returns: a GList of elements
  */
-GList *
+const GList *
 gst_bin_get_list (GstBin * bin)
 {
   g_return_val_if_fail (bin != NULL, NULL);
index fb33713..740d37e 100644 (file)
@@ -106,7 +106,7 @@ void                gst_bin_remove                  (GstBin *bin, GstElement *element);
 /* retrieve a single element or the list of children */
 GstElement*    gst_bin_get_by_name             (GstBin *bin, const gchar *name);
 GstElement*    gst_bin_get_by_name_recurse_up  (GstBin *bin, const gchar *name);
-GList*         gst_bin_get_list                (GstBin *bin);
+const GList*   gst_bin_get_list                (GstBin *bin);
 
 gboolean       gst_bin_set_state_type          (GstBin *bin, GstElementState state, GType type);
 
index 3adc835..6746f66 100644 (file)
@@ -777,10 +777,10 @@ gst_plugin_add_feature (GstPlugin *plugin, GstPluginFeature *feature)
  *
  * Returns; a GList of GstPlugin elements
  */
-GList*
+const GList*
 gst_plugin_get_list (void)
 {
-  return g_list_copy (_gst_plugins);
+  return _gst_plugins;
 }
 
 #ifndef GST_DISABLE_REGISTRY
index a6bdad7..fba15df 100644 (file)
@@ -108,7 +108,7 @@ gboolean            gst_plugin_load_plugin          (GstPlugin *plugin);
 void                   gst_plugin_add_feature          (GstPlugin *plugin, GstPluginFeature *feature);
 
 GstPlugin*             gst_plugin_find                 (const gchar *name);
-GList*                 gst_plugin_get_list             (void);
+const GList*           gst_plugin_get_list             (void);
 
 
 #ifndef GST_DISABLE_REGISTRY
index 4ad2fc3..a53fad0 100644 (file)
@@ -723,7 +723,7 @@ gst_scheduler_factory_find (const gchar *name)
  *
  * Returns: GList of type #GstSchedulerFactory
  */
-GList*
+const GList*
 gst_scheduler_factory_get_list (void)
 {
   return _gst_schedulerfactories;
index b48836a..49a0986 100644 (file)
@@ -174,7 +174,7 @@ GstSchedulerFactory*        gst_scheduler_factory_new               (const gchar *name, const gchar
 void                    gst_scheduler_factory_destroy          (GstSchedulerFactory *factory);
 
 GstSchedulerFactory*   gst_scheduler_factory_find              (const gchar *name);
-GList*                 gst_scheduler_factory_get_list          (void);
+const GList*           gst_scheduler_factory_get_list          (void);
 
 GstScheduler*          gst_scheduler_factory_create            (GstSchedulerFactory *factory, GstElement *parent);
 GstScheduler*          gst_scheduler_factory_make              (const gchar *name, GstElement *parent);
index 2fc7039..e015783 100644 (file)
@@ -311,7 +311,7 @@ gst_thread_change_state (GstElement * element)
       break;
     case GST_STATE_PLAYING_TO_PAUSED:
     {
-      GList *elements = gst_bin_get_list (GST_BIN (thread));
+      GList *elements = (GList *) gst_bin_get_list (GST_BIN (thread));
 
       THR_INFO ("pausing thread");
 
index 973c3d1..0b986cc 100644 (file)
@@ -284,7 +284,7 @@ gst_type_find_by_id (guint16 id)
  *
  * Returns: a list of GstTypes
  */
-GList*
+const GList*
 gst_type_get_list (void)
 {
   return _gst_types;
@@ -297,7 +297,7 @@ gst_type_get_list (void)
  *
  * Returns: a list of GstTypeFactories
  */
-GList*
+const GList*
 gst_type_factory_get_list (void)
 {
   return _gst_typefactories;
index 1117298..ca7b73d 100644 (file)
@@ -83,7 +83,7 @@ GType                 gst_type_factory_get_type       (void);
 GstTypeFactory*                gst_type_factory_new            (GstTypeDefinition *definition);
 
 GstTypeFactory*                gst_type_factory_find           (const gchar *name);
-GList*                         gst_type_factory_get_list       (void);
+const GList*           gst_type_factory_get_list       (void);
 
 
 /* create a new type, or find/merge an existing one */
@@ -97,6 +97,6 @@ guint16                       gst_type_find_by_ext            (const gchar *ext);
 GstType*               gst_type_find_by_id             (guint16 id);
 
 /* get the list of registered types (returns list of GstType!) */
-GList*                 gst_type_get_list               (void);
+const GList*           gst_type_get_list               (void);
 
 #endif /* __GST_TYPE_H__ */
index 3bd264b..7962f86 100644 (file)
@@ -168,7 +168,7 @@ gst_type_find_chain (GstPad *pad, GstBuffer *buf)
   GST_DEBUG (0,"got buffer of %d bytes in '%s'",
         GST_BUFFER_SIZE (buf), GST_OBJECT_NAME (typefind));
 
-  type_list = gst_type_get_list ();
+  type_list = (GList *) gst_type_get_list ();
 
   while (type_list) {
     GSList *factories;
index e770d62..d45b6a3 100644 (file)
@@ -381,19 +381,19 @@ gst_unitconv_time_nanoseconds_to_seconds(GstUnitConvert *unitconv, GValue *nanos
 static void
 gst_unitconv_time_seconds_to_samples(GstUnitConvert *unitconv, GValue *seconds_val, GValue *samples_val)
 {      
-       GValue *samplerate;
-       /* GValue *samplerate = g_hash_table_lookup(unitconv->currentToUnit->convert_properties, "samplerate"); */
+       /* GValue *samplerate;
+       GValue *samplerate = g_hash_table_lookup(unitconv->currentToUnit->convert_properties, "samplerate");
        g_value_set_int64(samples_val,
-               (gint64)(g_value_get_float(seconds_val) * (gfloat)g_value_get_int(samplerate)));
+               (gint64)(g_value_get_float(seconds_val) * (gfloat)g_value_get_int(samplerate))); */
 }
 
 static void
 gst_unitconv_time_samples_to_seconds(GstUnitConvert *unitconv, GValue *samples_val, GValue *seconds_val)
 {      
-       GValue *samplerate;
-       /* GValue *samplerate = g_hash_table_lookup(unitconv->currentFromUnit->convert_properties, "samplerate"); */
+       /* GValue *samplerate;
+       GValue *samplerate = g_hash_table_lookup(unitconv->currentFromUnit->convert_properties, "samplerate"); 
        g_value_set_float(seconds_val,
-               ((gfloat)g_value_get_int64(samples_val)) / (gfloat)g_value_get_int(samplerate));
+               ((gfloat)g_value_get_int64(samples_val)) / (gfloat)g_value_get_int(samplerate));*/
 }
 
 static void
index f6457b3..49fd163 100644 (file)
@@ -18,7 +18,7 @@ int main(int argc,char *argv[]) {
   doc = xmlNewDoc("1.0");
   doc->xmlRootNode = xmlNewDocNode(doc, NULL, "GST-CompletionRegistry", NULL);
 
-  plugins = gst_plugin_get_list();
+  plugins = (GList *) gst_plugin_get_list();
   while (plugins) {
     GstPlugin *plugin;
 
index 9ef78da..75080a6 100644 (file)
@@ -513,7 +513,7 @@ print_element_info (GstElementFactory *factory)
   /* for compound elements */
   if (GST_IS_BIN(element)) {
     printf("\nChildren:\n");
-    children = gst_bin_get_list(GST_BIN(element));
+    children = (GList *) gst_bin_get_list(GST_BIN(element));
     if (!children) 
       g_print ("  none\n");
     else {
@@ -534,7 +534,7 @@ print_element_list (void)
 {
   GList *plugins;
 
-  plugins = gst_plugin_get_list();
+  plugins = (GList *) gst_plugin_get_list();
   while (plugins) {
     GList *features;
     GstPlugin *plugin;