From d8e77f9bf8c98f22bf38e2b3ff7e8d16dbe79a23 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Sat, 17 Nov 2007 17:50:21 +0000 Subject: [PATCH] gst/gstevent.c: Little documentation improvment. Original commit message from CVS: * gst/gstevent.c: Little documentation improvment. * gst/gstpreset.c: More TODO cleanups. Remove c++ comments. * libs/gst/controller/gstcontroller.c: Add TODO and use quark from static string. * tests/check/gst/gstmessage.c: * tests/check/gst/gststructure.c: Use quark from static string. --- ChangeLog | 15 +++++++++++++++ gst/gstevent.c | 2 +- gst/gstpreset.c | 30 +++++++++++++++-------------- libs/gst/controller/gstcontroller.c | 3 ++- tests/check/gst/gstmessage.c | 2 +- tests/check/gst/gststructure.c | 2 +- 6 files changed, 36 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 699cfc590e..a820fea57a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2007-11-17 Stefan Kost + + * gst/gstevent.c: + Little documentation improvment. + + * gst/gstpreset.c: + More TODO cleanups. Remove c++ comments. + + * libs/gst/controller/gstcontroller.c: + Add TODO and use quark from static string. + + * tests/check/gst/gstmessage.c: + * tests/check/gst/gststructure.c: + Use quark from static string. + 2007-11-17 Stefan Kost * gst/gstpreset.c: diff --git a/gst/gstevent.c b/gst/gstevent.c index 0357581e06..fcc2c74de7 100644 --- a/gst/gstevent.c +++ b/gst/gstevent.c @@ -37,7 +37,7 @@ * The event should be unreffed with gst_event_unref() if it has not been sent. * * Events that have been received can be parsed with their respective - * gst_event_parse_*() functions. + * gst_event_parse_*() functions. It is valid to pass %NULL for unwanted details. * * Events are passed between elements in parallel to the data stream. Some events * are serialized with buffers, others are not. Some events only travel downstream, diff --git a/gst/gstpreset.c b/gst/gstpreset.c index d4993e4eb1..09b9a41cc3 100644 --- a/gst/gstpreset.c +++ b/gst/gstpreset.c @@ -30,15 +30,22 @@ * on demand, if presets are not used, the list is not created. * */ -/* @TODO: +/* @todo: * - we need locks to avoid two instances manipulating the preset list -> flock * - need to add support for GstChildProxy - * - how can we support both Preferences and Presets, a flag for _get_preset_names ? + * - how can we support both Preferences and Presets, + * - preferences = static settings (non controlable) + * - preset = a snapshot of dynamic params + * - flag + * - we could save all, but have a flag when loading + * - we could use a flag for _get_preset_names() + * * - should there be a 'preset-list' property to get the preset list * (and to connect a notify:: to to listen for changes) - * - do we want to ship presets for some elements? + * - should there be a 'preset-name' property so that we can set a preset via + * gst-launch * - * http://www.buzztard.org/index.php/Preset_handling_interface + * - do we want to ship presets for some elements? */ #include "gst_private.h" @@ -202,7 +209,7 @@ gst_preset_default_get_preset_names (GstPreset * self) } if (!fgets (line, LINE_LEN, in)) goto eof_error; - /* @todo: what version */ + /* @todo: what version (core?) */ if (!fgets (line, LINE_LEN, in)) goto eof_error; if (strcmp (g_strchomp (line), element_name)) { @@ -421,7 +428,7 @@ gst_preset_default_save_presets_file (GstPreset * self) GST_DEBUG ("saving preset file: '%s'", preset_path); - // create backup if possible + /* create backup if possible */ bak_file_name = g_strdup_printf ("%s.bak", preset_path); if (g_file_test (bak_file_name, G_FILE_TEST_EXISTS)) { if (g_unlink (bak_file_name)) { @@ -436,9 +443,6 @@ gst_preset_default_save_presets_file (GstPreset * self) } g_free (bak_file_name); - - /* @todo: create backup */ - /* write presets */ if ((out = fopen (preset_path, "wb"))) { const gchar *element_name = G_OBJECT_TYPE_NAME (self); @@ -449,7 +453,7 @@ gst_preset_default_save_presets_file (GstPreset * self) /* write header */ if (!(fputs ("GStreamer Preset\n", out))) goto eof_error; - /* @todo: what version */ + /* @todo: what version (core?) */ if (!(fputs ("1.0\n", out))) goto eof_error; if (!(fputs (element_name, out))) @@ -771,13 +775,11 @@ gst_preset_default_create_preset (GstPreset * self) (self)), &number_of_properties))) { gdouble rnd; - /* @todo: what about voice properties */ - GST_INFO ("nr of values : %d", number_of_properties); for (i = 0; i < number_of_properties; i++) { property = properties[i]; - /* skip non-controlable, trigger params & voice params */ + /* skip non-controlable, and non persistent params */ if (!(property->flags & GST_PARAM_CONTROLLABLE)) continue; /* we do not want to create a setting for trigger properties, buzztard @@ -836,10 +838,10 @@ gst_preset_default_create_preset (GstPreset * self) enum_class->minimum) * rnd)), NULL); } break; default: - //GST_WARNING("unhandled GType=%d:'%s'",param_type,G_VALUE_TYPE_NAME(param_type)); GST_WARNING ("unhandled GType=%d", param_type); } } + /* @todo: handle childproxy properties as well */ } } diff --git a/libs/gst/controller/gstcontroller.c b/libs/gst/controller/gstcontroller.c index 3f630b819e..68ab01b586 100644 --- a/libs/gst/controller/gstcontroller.c +++ b/libs/gst/controller/gstcontroller.c @@ -188,6 +188,7 @@ gst_controller_find_controlled_property (GstController * self, for (node = self->properties; node; node = g_list_next (node)) { prop = node->data; + /* FIXME: eventually use GQuark to speed it up */ if (!strcmp (prop->name, name)) { return prop; } @@ -909,7 +910,7 @@ _gst_controller_class_init (GstControllerClass * klass) gobject_class->dispose = _gst_controller_dispose; gobject_class->finalize = _gst_controller_finalize; - __gst_controller_key = g_quark_from_string ("gst::controller"); + __gst_controller_key = g_quark_from_static_string ("gst::controller"); /* register properties */ g_object_class_install_property (gobject_class, PROP_CONTROL_RATE, diff --git a/tests/check/gst/gstmessage.c b/tests/check/gst/gstmessage.c index 20a2e2b32b..6ddbf5d8e5 100644 --- a/tests/check/gst/gstmessage.c +++ b/tests/check/gst/gstmessage.c @@ -28,7 +28,7 @@ GST_START_TEST (test_parsing) { GstMessage *message; - domain = g_quark_from_string ("test"); + domain = g_quark_from_static_string ("test"); /* GST_MESSAGE_EOS */ { diff --git a/tests/check/gst/gststructure.c b/tests/check/gst/gststructure.c index 4a644d6dd4..b0e4239219 100644 --- a/tests/check/gst/gststructure.c +++ b/tests/check/gst/gststructure.c @@ -234,7 +234,7 @@ GST_START_TEST (test_structure_new) gst_structure_free (s); - domain = g_quark_from_string ("test"); + domain = g_quark_from_static_string ("test"); e = g_error_new (domain, 0, "a test error"); s = gst_structure_new ("name", "key", GST_TYPE_G_ERROR, e, NULL); g_error_free (e);