diff --git a/ChangeLog b/ChangeLog index 6499a541e7..5fc17bef66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-02-11 David Schleef + + * docs/gst/tmpl/gstcaps.sgml: Fix stuff that mentions GstProps + * docs/gst/tmpl/gstpadtemplate.sgml: same + * docs/gst/tmpl/gstreamer-unused.sgml: Remove GstProps + * gst/gstobject.c: (gst_object_set_name_default): Do the memleak + fixing dance. + * gst/gstutils.c: Remove disabled code that uses GstProps. + * gst/registries/gstxmlregistry.h: same + * docs/random/ds/0.9-suggested-changes: random notes + 2004-02-11 kost@imn.htwk-leipzig.de reviewed by: David Schleef diff --git a/docs/gst/tmpl/gstcaps.sgml b/docs/gst/tmpl/gstcaps.sgml index d84d3d6e83..27c7d894fa 100644 --- a/docs/gst/tmpl/gstcaps.sgml +++ b/docs/gst/tmpl/gstcaps.sgml @@ -11,32 +11,24 @@ a mime-type and a set of properties. GstCaps can be named and chained into a list, which is then a GstCaps on its own. -GstCaps are created with gst_caps_new(), which takes a name, a mime type and -a pointer to a #GstProps. A convenience macro with a cleaner syntax is -available to create a caps with GST_CAPS_NEW(). The following example shows how -to create a GstCaps. +GstCaps are created with gst_caps_new_simpl(), which takes a mime type and +a list of arguments in sets of 3, terminated with NULL. Each set of 3 +arguments is the name of a field, the GType of the field, and the value +of the field. The following example shows how to create a GstCaps. GstCaps *caps; caps = gst_caps_new ( - "my_caps", /* capability name */ - "audio/raw", /* mime type */ - gst_props_new ( /* properties */ - "format", GST_PROPS_STRING ("float"), - "channels", GST_PROPS_INT (5), - NULL)); + "audio/x-raw-int", /* mime type */ + "channels", G_TYPE_INT, 5, + NULL); The following code example is equivalent to the above example: GstCaps *caps; - caps = GST_CAPS_NEW ( - "my_caps", /* capability name */ - "audio/raw", /* mime type */ - "format", GST_PROPS_STRING ("float"), - "channels", GST_PROPS_INT (5) - ); + caps = gst_caps_from_string ("audio/x-raw-int, channels = (int) 5"); @@ -53,15 +45,16 @@ gst_caps_get_boolean(), gst_caps_get_fourcc_int(), gst_caps_get_int(), gst_caps_get_string(), gst_caps_get_float(), which all take a property name as an argument. -The properties of the caps structure can be modified with gst_caps_set, which -takes a list of key value pairs in the #GstProps syntax as shown by this example: +The fields of the caps structure can be modified with gst_caps_set_simple, +which takes the caps structure to be modified, a list of arguments in +sets of 3, terminated by NULL. The format of these arguments is the +same as above. GstCaps *caps; .... - gst_caps_set (caps, "format", GST_PROPS_STRING ("int"), NULL); - gst_caps_set (caps, "channels", GST_PROPS_INT (20), NULL); + gst_caps_set_simple (caps, "channels", G_TYPE_INT, 20, NULL); @@ -73,25 +66,18 @@ gst_caps_copy_on_write(). This will copy the GstCaps if the refcount is >1. If you need a unique instance of a GstCaps you can use the convenient GST_CAPS_FACTORY() macro as shown below. - GST_CAPS_FACTORY (my_caps, - GST_CAPS_NEW ( - "caps1", - "audio/raw", - "format", GST_PROPS_STRING ("float"), - "channels", GST_PROPS_INT (5) - ), - GST_CAPS_NEW ( - "caps2", - "audio/raw", - "format", GST_PROPS_STRING ("int"), - "channels", GST_PROPS_INT (5) + GstStaticCaps my_caps = GST_STATIC_CAPS ( + "audio/x-raw-float, " + "channels = (int) 5; " + "audio/x-raw-int, " + "channels = (int) 5" ) ) void some_function (void) { - GstCaps *caps = GST_CAPS_GET (my_caps); + GstCaps *caps = gst_caps_copy (gst_static_caps_get (&my_caps)); ... } @@ -108,7 +94,7 @@ of the capabilities. -#GstProps, #GstPad +#GstStructure, #GstPad diff --git a/docs/gst/tmpl/gstpadtemplate.sgml b/docs/gst/tmpl/gstpadtemplate.sgml index a2736922d0..0955989f15 100644 --- a/docs/gst/tmpl/gstpadtemplate.sgml +++ b/docs/gst/tmpl/gstpadtemplate.sgml @@ -23,15 +23,14 @@ to add to an elementfactory. The following code example shows the code to create a pad from a padtemplate. - GST_PAD_TEMPLATE_FACTORY (my_template_factory, + GstStaticPadTemplate my_template = + GST_STATIC_PAD_TEMPLATE ( "sink", /* the name of the pad */ GST_PAD_SINK, /* the direction of the pad */ GST_PAD_ALWAYS, /* when this pad will be present */ - GST_CAPS_NEW ( /* the capabilities of the padtemplate */ - "my_caps", - "audio/raw", - "format", GST_PROPS_STRING ("int"), - "channels", GST_PROPS_INT_RANGE (1, 6) + GST_STATIC_CAPS ( /* the capabilities of the padtemplate */ + "audio/x-raw-int, " + "channels = (int) [ 1, 6 ]" ) ) diff --git a/docs/gst/tmpl/gstreamer-unused.sgml b/docs/gst/tmpl/gstreamer-unused.sgml index ba393dd5da..eb05c6432d 100644 --- a/docs/gst/tmpl/gstreamer-unused.sgml +++ b/docs/gst/tmpl/gstreamer-unused.sgml @@ -2163,13 +2163,6 @@ Set or get the flush flag of the discont event. @event: The event to operate on - - -The properties of the info event - - -@event: The event to query - Qeury wether the seek event also needs a flush. @@ -3035,65 +3028,6 @@ A macro used to define a statically linked plugin. @name: The name of the plugin. @init: The init function of this plugin. - - - - - - - - - - - -@a: - - - - - - -@a: -@b: - - - - - - -@a: - - - - - - - - - -Create a fourcc property out of an integer value. - - -@a: the integer value - - - - - - - - - - - - - - - - - - - @@ -3791,12 +3725,6 @@ A type that can be used to indicate a filename. - - - - - - @@ -5577,36 +5505,6 @@ Sets the command to be executed. - - - - - - - - - - - - - - - - - -@GST_PROPS_END_ID_NUM: -@GST_PROPS_LIST_ID_NUM: -@GST_PROPS_INT_ID_NUM: -@GST_PROPS_INT_RANGE_ID_NUM: -@GST_PROPS_FOURCC_ID_NUM: -@GST_PROPS_BOOL_ID_NUM: - - - - - - - diff --git a/docs/random/ds/0.9-suggested-changes b/docs/random/ds/0.9-suggested-changes index 6f25cb588e..c8c5a2d1b5 100644 --- a/docs/random/ds/0.9-suggested-changes +++ b/docs/random/ds/0.9-suggested-changes @@ -16,6 +16,9 @@ API: - gst_init() et al. need to work correctly when called multiple times and from libraries, etc. + - gst_pad_get_pad_template_caps -> gst_pad_get_template_caps() + + caps: (Company:) diff --git a/gst/gstobject.c b/gst/gstobject.c index 65eedf8285..2b64ea83e2 100644 --- a/gst/gstobject.c +++ b/gst/gstobject.c @@ -432,8 +432,10 @@ gst_object_set_name_default (GstObject *object) * may ever assign a name */ G_LOCK (object_name_mutex); - if (!object_name_counts) - object_name_counts = g_hash_table_new (g_str_hash, g_str_equal); + if (!object_name_counts) { + object_name_counts = g_hash_table_new_full (g_str_hash, g_str_equal, + g_free, NULL); + } count = GPOINTER_TO_INT (g_hash_table_lookup (object_name_counts, type_name)); g_hash_table_insert (object_name_counts, g_strdup (type_name), diff --git a/gst/gstutils.c b/gst/gstutils.c index 2a89ecb17a..2b2460445c 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -274,104 +274,6 @@ string_append_indent (GString * str, gint count) g_string_append_c (str, ' '); } -#if 0 -static void -gst_print_props (GString *buf, gint indent, GList *props, gboolean showname) -{ - GList *elem; - guint width = 0; - GstPropsType type; - - if (showname) - for (elem = props; elem; elem = g_list_next (elem)) { - GstPropsEntry *prop = elem->data; - const gchar *name = gst_props_entry_get_name (prop); - - if (width < strlen (name)) - width = strlen (name); - } - - for (elem = props; elem; elem = g_list_next (elem)) { - GstPropsEntry *prop = elem->data; - - string_append_indent (buf, indent); - if (showname) { - const gchar *name = gst_props_entry_get_name (prop); - - g_string_append (buf, name); - string_append_indent (buf, 2 + width - strlen (name)); - } - - type = gst_props_entry_get_props_type (prop); - switch (type) { - case GST_PROPS_INT_TYPE: - { - gint val; - gst_props_entry_get_int (prop, &val); - g_string_append_printf (buf, "%d (int)\n", val); - break; - } - case GST_PROPS_INT_RANGE_TYPE: - { - gint min, max; - gst_props_entry_get_int_range (prop, &min, &max); - g_string_append_printf (buf, "%d - %d (int)\n", min, max); - break; - } - case GST_PROPS_FLOAT_TYPE: - { - gfloat val; - gst_props_entry_get_float (prop, &val); - g_string_append_printf (buf, "%f (float)\n", val); - break; - } - case GST_PROPS_FLOAT_RANGE_TYPE: - { - gfloat min, max; - gst_props_entry_get_float_range (prop, &min, &max); - g_string_append_printf (buf, "%f - %f (float)\n", min, max); - break; - } - case GST_PROPS_BOOLEAN_TYPE: - { - gboolean val; - gst_props_entry_get_boolean (prop, &val); - g_string_append_printf (buf, "%s\n", val ? "TRUE" : "FALSE"); - break; - } - case GST_PROPS_STRING_TYPE: - { - const gchar *val; - gst_props_entry_get_string (prop, &val); - g_string_append_printf (buf, "\"%s\"\n", val); - break; - } - case GST_PROPS_FOURCC_TYPE: - { - guint32 val; - gst_props_entry_get_fourcc_int (prop, &val); - g_string_append_printf (buf, "'%c%c%c%c' (fourcc)\n", - (gchar)( val & 0xff), - (gchar)((val >> 8) & 0xff), - (gchar)((val >> 16) & 0xff), - (gchar)((val >> 24) & 0xff)); - break; - } - case GST_PROPS_LIST_TYPE: - { - const GList *list; - gst_props_entry_get_list (prop, &list); - gst_print_props (buf, indent + 2, (GList *)list, FALSE); - break; - } - default: - g_string_append_printf (buf, "unknown proptype %d\n", type); - break; - } - } -} -#endif - /** * gst_print_pad_caps: * @buf: the buffer to print the caps in diff --git a/gst/registries/gstxmlregistry.h b/gst/registries/gstxmlregistry.h index 74ddd070a5..bf1d6a10be 100644 --- a/gst/registries/gstxmlregistry.h +++ b/gst/registries/gstxmlregistry.h @@ -104,8 +104,6 @@ struct _GstXMLRegistry { gchar *caps_name; gchar *structure_name; - //gchar *caps_mime; - //GstProps *props; gboolean in_list; GList *entry_list;