Original commit message from CVS:
Fixed bug #108514.
This commit is contained in:
Christian Meyer 2003-03-16 20:06:02 +00:00
parent 17b8c5d004
commit dabb6637bd
9 changed files with 637 additions and 587 deletions

View file

@ -1,3 +1,21 @@
2003-03-16 Christian Meyer <chrisime@gnome.org>
* tools/gst-inspect.c
(print_prop): Modified to make compile compile with the new introduced
function.
* tools/gst-xmlinspect.c
(print_prop): ditto.
2003-03-16 Christian Meyer <chrisime@gnome.org>
* gst/gstprops.[ch]: Add function gst_props_get_type().
* gst/gstprops.[ch], gst/gstutils.c, gst/registries/gstxmlregistry.c:
- Rename gst_props_entry_get_type() -> gst_props_entry_get_props_type().
- Add gst_props_entry_get_type() (returning the GType).
* gst/gstcaps.[ch]: Add function gst_caps_get_type().
Applied patches from Martin Schulze.
2003-01-09 Thomas Vander Stichele <thomas at apestaart dot org> 2003-01-09 Thomas Vander Stichele <thomas at apestaart dot org>
* first pass at changing _connect/_disconnect -> _link/_unlink * first pass at changing _connect/_disconnect -> _link/_unlink

View file

@ -90,6 +90,12 @@ _gst_caps_initialize (void)
#endif #endif
} }
GType
gst_caps_get_type (void)
{
return _gst_caps_type;
}
static guint16 static guint16
get_type_for_mime (const gchar *mime) get_type_for_mime (const gchar *mime)
{ {

View file

@ -120,6 +120,7 @@ factoryname (void) \
void _gst_caps_initialize (void); void _gst_caps_initialize (void);
/* creating new caps */ /* creating new caps */
GType gst_caps_get_type (void);
GstCaps* gst_caps_new (const gchar *name, const gchar *mime, GstProps *props); GstCaps* gst_caps_new (const gchar *name, const gchar *mime, GstProps *props);
GstCaps* gst_caps_new_id (const gchar *name, const guint16 id, GstProps *props); GstCaps* gst_caps_new_id (const gchar *name, const guint16 id, GstProps *props);
/* replace pointer to caps, doing proper refcounting */ /* replace pointer to caps, doing proper refcounting */

View file

@ -119,7 +119,6 @@ transform_func (const GValue *src_value,
g_string_free (result, FALSE); g_string_free (result, FALSE);
} }
void void
_gst_props_initialize (void) _gst_props_initialize (void)
{ {
@ -363,6 +362,12 @@ gst_props_entry_destroy (GstPropsEntry *entry)
#endif #endif
} }
GType
gst_props_get_type (void)
{
return _gst_props_type;
}
/** /**
* gst_props_empty_new: * gst_props_empty_new:
* *
@ -506,7 +511,6 @@ gst_props_new (const gchar *firstname, ...)
return props; return props;
} }
/** /**
* gst_props_debug: * gst_props_debug:
* @props: the props to debug * @props: the props to debug
@ -636,6 +640,12 @@ gst_props_add_to_int_list (GList *entries, GstPropsEntry *newentry)
return g_list_prepend (entries, newentry); return g_list_prepend (entries, newentry);
} }
GType
gst_props_entry_get_type (void)
{
return _gst_props_entry_type;
}
static GstPropsEntry* static GstPropsEntry*
gst_props_entry_newv (const gchar *name, va_list var_args) gst_props_entry_newv (const gchar *name, va_list var_args)
{ {
@ -1122,7 +1132,7 @@ gst_props_has_fixed_property (GstProps *props, const gchar *name)
} }
/** /**
* gst_props_entry_get_type: * gst_props_entry_get_props_type:
* @entry: the props entry to query * @entry: the props entry to query
* *
* Get the type of the given props entry. * Get the type of the given props entry.
@ -1130,7 +1140,7 @@ gst_props_has_fixed_property (GstProps *props, const gchar *name)
* Returns: The type of the props entry. * Returns: The type of the props entry.
*/ */
GstPropsType GstPropsType
gst_props_entry_get_type (const GstPropsEntry *entry) gst_props_entry_get_props_type (const GstPropsEntry *entry)
{ {
g_return_val_if_fail (entry != NULL, GST_PROPS_INVALID_TYPE); g_return_val_if_fail (entry != NULL, GST_PROPS_INVALID_TYPE);
@ -1465,8 +1475,7 @@ gst_props_entry_check_list_compatibility (GstPropsEntry *entry1, GstPropsEntry *
static gboolean static gboolean
gst_props_entry_check_compatibility (GstPropsEntry *entry1, GstPropsEntry *entry2) gst_props_entry_check_compatibility (GstPropsEntry *entry1, GstPropsEntry *entry2)
{ {
GST_DEBUG (GST_CAT_PROPERTIES,"compare: %s %s", g_quark_to_string (entry1->propid), GST_DEBUG (GST_CAT_PROPERTIES,"compare: %s %s", g_quark_to_string (entry1->propid), g_quark_to_string (entry2->propid));
g_quark_to_string (entry2->propid));
if (entry2->propstype == GST_PROPS_LIST_TYPE && entry1->propstype != GST_PROPS_LIST_TYPE) { if (entry2->propstype == GST_PROPS_LIST_TYPE && entry1->propstype != GST_PROPS_LIST_TYPE) {
return gst_props_entry_check_list_compatibility (entry1, entry2); return gst_props_entry_check_list_compatibility (entry1, entry2);

View file

@ -115,6 +115,7 @@ struct _GstProps {
void _gst_props_initialize (void); void _gst_props_initialize (void);
/* creating new properties */ /* creating new properties */
GType gst_props_get_type (void);
GstProps* gst_props_new (const gchar *firstname, ...); GstProps* gst_props_new (const gchar *firstname, ...);
GstProps* gst_props_newv (const gchar *firstname, va_list var_args); GstProps* gst_props_newv (const gchar *firstname, va_list var_args);
GstProps* gst_props_empty_new (void); GstProps* gst_props_empty_new (void);
@ -161,11 +162,12 @@ void gst_props_remove_entry (GstProps *props, GstPropsEntry *entry);
void gst_props_remove_entry_by_name (GstProps *props, const gchar *name); void gst_props_remove_entry_by_name (GstProps *props, const gchar *name);
/* working with props entries */ /* working with props entries */
GType gst_props_entry_get_type (void);
GstPropsEntry* gst_props_entry_new (const gchar *name, ...); GstPropsEntry* gst_props_entry_new (const gchar *name, ...);
void gst_props_entry_destroy (GstPropsEntry *entry); void gst_props_entry_destroy (GstPropsEntry *entry);
GstPropsEntry* gst_props_entry_copy (const GstPropsEntry *entry); GstPropsEntry* gst_props_entry_copy (const GstPropsEntry *entry);
GstPropsType gst_props_entry_get_type (const GstPropsEntry *entry); GstPropsType gst_props_entry_get_props_type (const GstPropsEntry *entry);
const gchar* gst_props_entry_get_name (const GstPropsEntry *entry); const gchar* gst_props_entry_get_name (const GstPropsEntry *entry);
gboolean gst_props_entry_is_fixed (const GstPropsEntry *entry); gboolean gst_props_entry_is_fixed (const GstPropsEntry *entry);

View file

@ -304,7 +304,7 @@ gst_print_props (GString *buf, gint indent, GList *props, gboolean showname)
string_append_indent (buf, 2 + width - strlen (name)); string_append_indent (buf, 2 + width - strlen (name));
} }
type = gst_props_entry_get_type (prop); type = gst_props_entry_get_props_type (prop);
switch (type) { switch (type) {
case GST_PROPS_INT_TYPE: case GST_PROPS_INT_TYPE:
{ {

View file

@ -1286,7 +1286,7 @@ gst_xml_registry_save_props_func (GstPropsEntry *entry,
name = gst_props_entry_get_name (entry); name = gst_props_entry_get_name (entry);
switch (gst_props_entry_get_type (entry)) { switch (gst_props_entry_get_props_type (entry)) {
case GST_PROPS_INT_TYPE: case GST_PROPS_INT_TYPE:
{ {
gint value; gint value;
@ -1338,7 +1338,7 @@ gst_xml_registry_save_props_func (GstPropsEntry *entry,
break; break;
} }
default: default:
g_warning ("trying to save unknown property type %d", gst_props_entry_get_type (entry)); g_warning ("trying to save unknown property type %d", gst_props_entry_get_props_type (entry));
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
@ -1354,7 +1354,7 @@ gst_xml_registry_save_props (GstXMLRegistry *xmlregistry, GstProps *props)
while (proplist) { while (proplist) {
GstPropsEntry *entry = (GstPropsEntry *) proplist->data; GstPropsEntry *entry = (GstPropsEntry *) proplist->data;
switch (gst_props_entry_get_type (entry)) { switch (gst_props_entry_get_props_type (entry)) {
case GST_PROPS_LIST_TYPE: case GST_PROPS_LIST_TYPE:
{ {
const GList *list; const GList *list;

View file

@ -12,7 +12,7 @@ print_prop (GstPropsEntry *prop, gboolean showname, const gchar *pfx)
else else
g_print(pfx); g_print(pfx);
type = gst_props_entry_get_type (prop); type = gst_props_entry_get_props_type (prop);
switch (type) { switch (type) {
case GST_PROPS_INT_TYPE: case GST_PROPS_INT_TYPE:
@ -313,16 +313,18 @@ print_element_properties (GstElement *element)
{ {
GParamSpecUInt64 *puint64 = G_PARAM_SPEC_UINT64 (param); GParamSpecUInt64 *puint64 = G_PARAM_SPEC_UINT64 (param);
g_print("%-23.23s Unsigned Integer64. ", ""); g_print("%-23.23s Unsigned Integer64. ", "");
if (readable) g_print("Range: %" G_GUINT64_FORMAT " - %" G_GUINT64_FORMAT " (Default %" G_GUINT64_FORMAT ")", if (readable) g_print("Range: %" G_GUINT64_FORMAT " - %"
puint64->minimum, puint64->maximum, g_value_get_uint64 (&value)); G_GUINT64_FORMAT " (Default %" G_GUINT64_FORMAT ")",
puint64->minimum, puint64->maximum,
g_value_get_uint64 (&value));
break; break;
} }
case G_TYPE_INT64: case G_TYPE_INT64:
{ {
GParamSpecInt64 *pint64 = G_PARAM_SPEC_INT64 (param); GParamSpecInt64 *pint64 = G_PARAM_SPEC_INT64 (param);
g_print("%-23.23s Integer64. ", ""); g_print("%-23.23s Integer64. ", "");
if (readable) g_print("Range: %" G_GINT64_FORMAT " - %" G_GINT64_FORMAT " (Default %" G_GINT64_FORMAT ")", if (readable) g_print("Range: %" G_GINT64_FORMAT " - %" G_GINT64_FORMAT " (Default %" G_GINT64_FORMAT ")", pint64->minimum,
pint64->minimum, pint64->maximum, g_value_get_int64 (&value)); pint64->maximum, g_value_get_int64 (&value));
break; break;
} }
case G_TYPE_FLOAT: case G_TYPE_FLOAT:
@ -403,7 +405,7 @@ print_element_properties (GstElement *element)
j++; j++;
} }
g_print ("%-23.23s Flags \"%s\" (default %d, \"%s\")", "", g_print("%-23.23s Flags \"%s\" (default %d, \"%s\")", "",
g_type_name (G_VALUE_TYPE (&value)), g_type_name (G_VALUE_TYPE (&value)),
flags_value, (flags ? flags->str : "(none)")); flags_value, (flags ? flags->str : "(none)"));
@ -422,7 +424,7 @@ print_element_properties (GstElement *element)
g_type_name(param->value_type)); g_type_name(param->value_type));
} }
else { else {
g_print ("%-23.23s Unknown type %ld \"%s\"", "",param->value_type, g_print ("%-23.23s Unknown type %ld \"%s\"", "", param->value_type,
g_type_name(param->value_type)); g_type_name(param->value_type));
} }
break; break;
@ -684,7 +686,8 @@ print_element_info (GstElementFactory *factory)
switch (G_PARAM_SPEC_VALUE_TYPE (specs[x])) { switch (G_PARAM_SPEC_VALUE_TYPE (specs[x])) {
case G_TYPE_INT64: case G_TYPE_INT64:
g_print ("64 Bit Integer (Default %" G_GINT64_FORMAT ", Range %" G_GINT64_FORMAT " -> %" G_GINT64_FORMAT ")", g_print ("64 Bit Integer (Default %" G_GINT64_FORMAT ", Range %"
G_GINT64_FORMAT " -> %" G_GINT64_FORMAT ")",
((GParamSpecInt64 *) specs[x])->default_value, ((GParamSpecInt64 *) specs[x])->default_value,
((GParamSpecInt64 *) specs[x])->minimum, ((GParamSpecInt64 *) specs[x])->minimum,
((GParamSpecInt64 *) specs[x])->maximum); ((GParamSpecInt64 *) specs[x])->maximum);
@ -749,7 +752,7 @@ print_element_info (GstElementFactory *factory)
g_type_name (G_OBJECT_TYPE (element))); g_type_name (G_OBJECT_TYPE (element)));
for (j = 0; j < n_params; j++) { for (j = 0; j < n_params; j++) {
g_print (",\n \t\t\t\t%s arg%d", g_type_name (param_types[j]), j); g_print (",\n \t\t\t\t%s arg%d", g_type_name(param_types[j]), j);
} }
if (k == 0) if (k == 0)
g_print (",\n \t\t\t\tgpointer user_data);\n"); g_print (",\n \t\t\t\tgpointer user_data);\n");
@ -765,7 +768,6 @@ print_element_info (GstElementFactory *factory)
} }
} }
/* for compound elements */ /* for compound elements */
if (GST_IS_BIN (element)) { if (GST_IS_BIN (element)) {
g_print ("\nChildren:\n"); g_print ("\nChildren:\n");
@ -852,9 +854,9 @@ print_element_list (void)
GstURIHandler *handler; GstURIHandler *handler;
handler = GST_URI_HANDLER (feature); handler = GST_URI_HANDLER (feature);
g_print ("%s: %s: \"%s\" (%s) element \"%s\" property \"%s\"\n", plugin->name, g_print ("%s: %s: \"%s\" (%s) element \"%s\" property \"%s\"\n",
GST_PLUGIN_FEATURE_NAME (handler), handler->uri, handler->longdesc, plugin->name, GST_PLUGIN_FEATURE_NAME (handler), handler->uri,
handler->element, handler->property); handler->longdesc, handler->element, handler->property);
} }
#endif #endif
else { else {
@ -962,7 +964,6 @@ print_plugin_info (GstPlugin *plugin)
g_print ("\n"); g_print ("\n");
} }
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
@ -1006,32 +1007,37 @@ main (int argc, char *argv[])
GstPluginFeature* feature; GstPluginFeature* feature;
/* FIXME implement other pretty print function for these */ /* FIXME implement other pretty print function for these */
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_SCHEDULER_FACTORY); feature = gst_registry_pool_find_feature (argv[1],
GST_TYPE_SCHEDULER_FACTORY);
if (feature) { if (feature) {
g_print ("%s: a scheduler\n", argv[1]); g_print ("%s: a scheduler\n", argv[1]);
return 0; return 0;
} }
#ifndef GST_DISABLE_INDEX #ifndef GST_DISABLE_INDEX
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_INDEX_FACTORY); feature = gst_registry_pool_find_feature (argv[1],
GST_TYPE_INDEX_FACTORY);
if (feature) { if (feature) {
g_print ("%s: an index\n", argv[1]); g_print ("%s: an index\n", argv[1]);
return 0; return 0;
} }
#endif #endif
#ifndef GST_DISABLE_AUTOPLUG #ifndef GST_DISABLE_AUTOPLUG
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_AUTOPLUG_FACTORY); feature = gst_registry_pool_find_feature (argv[1],
GST_TYPE_AUTOPLUG_FACTORY);
if (feature) { if (feature) {
g_print ("%s: an autoplugger\n", argv[1]); g_print ("%s: an autoplugger\n", argv[1]);
return 0; return 0;
} }
#endif #endif
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_TYPE_FACTORY); feature = gst_registry_pool_find_feature (argv[1],
GST_TYPE_TYPE_FACTORY);
if (feature) { if (feature) {
g_print ("%s: an type\n", argv[1]); g_print ("%s: an type\n", argv[1]);
return 0; return 0;
} }
#ifndef GST_DISABLE_URI #ifndef GST_DISABLE_URI
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_URI_HANDLER); feature = gst_registry_pool_find_feature (argv[1],
GST_TYPE_URI_HANDLER);
if (feature) { if (feature) {
g_print ("%s: an uri handler\n", argv[1]); g_print ("%s: an uri handler\n", argv[1]);
return 0; return 0;

View file

@ -45,14 +45,15 @@ print_prop (GstPropsEntry *prop, gint pfx)
{ {
GstPropsType type; GstPropsType type;
type = gst_props_entry_get_type (prop); type = gst_props_entry_get_props_type (prop);
switch (type) { switch (type) {
case GST_PROPS_INT_TYPE: case GST_PROPS_INT_TYPE:
{ {
gint val; gint val;
gst_props_entry_get_int (prop, &val); gst_props_entry_get_int (prop, &val);
PUT_STRING (pfx, "<int name=\"%s\" value=\"%d\"/>", gst_props_entry_get_name (prop), val); PUT_STRING (pfx, "<int name=\"%s\" value=\"%d\"/>",
gst_props_entry_get_name (prop), val);
break; break;
} }
case GST_PROPS_INT_RANGE_TYPE: case GST_PROPS_INT_RANGE_TYPE:
@ -67,7 +68,8 @@ print_prop (GstPropsEntry *prop, gint pfx)
{ {
gfloat val; gfloat val;
gst_props_entry_get_float (prop, &val); gst_props_entry_get_float (prop, &val);
PUT_STRING (pfx, "<float name=\"%s\" value=\"%f\"/>", gst_props_entry_get_name (prop), val); PUT_STRING (pfx, "<float name=\"%s\" value=\"%f\"/>",
gst_props_entry_get_name (prop), val);
break; break;
} }
case GST_PROPS_FLOAT_RANGE_TYPE: case GST_PROPS_FLOAT_RANGE_TYPE:
@ -90,7 +92,8 @@ print_prop (GstPropsEntry *prop, gint pfx)
{ {
const gchar *val; const gchar *val;
gst_props_entry_get_string (prop, &val); gst_props_entry_get_string (prop, &val);
PUT_STRING (pfx, "<string name=\"%s\" value=\"%s\"/>", gst_props_entry_get_name (prop), val); PUT_STRING (pfx, "<string name=\"%s\" value=\"%s\"/>",
gst_props_entry_get_name (prop), val);
break; break;
} }
case GST_PROPS_FOURCC_TYPE: case GST_PROPS_FOURCC_TYPE:
@ -102,7 +105,8 @@ print_prop (GstPropsEntry *prop, gint pfx)
(gchar)((val >> 8) & 0xff), (gchar)((val >> 8) & 0xff),
(gchar)((val >> 16) & 0xff), (gchar)((val >> 16) & 0xff),
(gchar)((val >> 24) & 0xff)); (gchar)((val >> 24) & 0xff));
PUT_STRING (pfx, "<fourcc name=\"%s\" hexvalue=\"%08x\"/>", gst_props_entry_get_name (prop), val); PUT_STRING (pfx, "<fourcc name=\"%s\" hexvalue=\"%08x\"/>",
gst_props_entry_get_name (prop), val);
break; break;
} }
case GST_PROPS_LIST_TYPE: case GST_PROPS_LIST_TYPE:
@ -869,9 +873,9 @@ print_element_list (void)
GstURIHandler *handler; GstURIHandler *handler;
handler = GST_URI_HANDLER (feature); handler = GST_URI_HANDLER (feature);
g_print ("%s: %s: \"%s\" (%s) element \"%s\" property \"%s\"\n", plugin->name, g_print ("%s: %s: \"%s\" (%s) element \"%s\" property \"%s\"\n",
GST_PLUGIN_FEATURE_NAME (handler), handler->uri, handler->longdesc, plugin->name, GST_PLUGIN_FEATURE_NAME (handler), handler->uri,
handler->element, handler->property); handler->longdesc, handler->element, handler->property);
} }
#endif #endif
else { else {
@ -1007,8 +1011,8 @@ main (int argc, char *argv[])
} else { } else {
/* first check for help */ /* first check for help */
if (strstr (argv[1], "-help")) { if (strstr (argv[1], "-help")) {
g_print ("Usage: %s\t\t\tList all registered elements\n",argv[0]); g_print ("Usage: %s\t\t\tList all registered elements\n", argv[0]);
g_print (" %s element-name\tShow element details\n",argv[0]); g_print (" %s element-name\tShow element details\n", argv[0]);
g_print (" %s plugin-name[.so]\tShow information about plugin\n", g_print (" %s plugin-name[.so]\tShow information about plugin\n",
argv[0]); argv[0]);
return 0; return 0;
@ -1025,32 +1029,37 @@ main (int argc, char *argv[])
GstPluginFeature* feature; GstPluginFeature* feature;
/* FIXME implement other pretty print function for these */ /* FIXME implement other pretty print function for these */
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_SCHEDULER_FACTORY); feature = gst_registry_pool_find_feature (argv[1],
GST_TYPE_SCHEDULER_FACTORY);
if (feature) { if (feature) {
g_print ("%s: a scheduler\n", argv[1]); g_print ("%s: a scheduler\n", argv[1]);
return 0; return 0;
} }
#ifndef GST_DISABLE_INDEX #ifndef GST_DISABLE_INDEX
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_INDEX_FACTORY); feature = gst_registry_pool_find_feature (argv[1],
GST_TYPE_INDEX_FACTORY);
if (feature) { if (feature) {
g_print ("%s: an index\n", argv[1]); g_print ("%s: an index\n", argv[1]);
return 0; return 0;
} }
#endif #endif
#ifndef GST_DISABLE_AUTOPLUG #ifndef GST_DISABLE_AUTOPLUG
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_AUTOPLUG_FACTORY); feature = gst_registry_pool_find_feature (argv[1],
GST_TYPE_AUTOPLUG_FACTORY);
if (feature) { if (feature) {
g_print ("%s: an autoplugger\n", argv[1]); g_print ("%s: an autoplugger\n", argv[1]);
return 0; return 0;
} }
#endif #endif
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_TYPE_FACTORY); feature = gst_registry_pool_find_feature (argv[1],
GST_TYPE_TYPE_FACTORY);
if (feature) { if (feature) {
g_print ("%s: an type\n", argv[1]); g_print ("%s: an type\n", argv[1]);
return 0; return 0;
} }
#ifndef GST_DISABLE_URI #ifndef GST_DISABLE_URI
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_URI_HANDLER); feature = gst_registry_pool_find_feature (argv[1],
GST_TYPE_URI_HANDLER);
if (feature) { if (feature) {
g_print ("%s: an uri handler\n", argv[1]); g_print ("%s: an uri handler\n", argv[1]);
return 0; return 0;
@ -1070,7 +1079,6 @@ main (int argc, char *argv[])
if (plugin) { if (plugin) {
print_plugin_info (plugin); print_plugin_info (plugin);
} else { } else {
g_print("no such element or plugin '%s'\n", argv[1]); g_print("no such element or plugin '%s'\n", argv[1]);
return -1; return -1;