2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 //#define DEBUG_ENABLED
26 _gst_caps_initialize (void)
31 * @factory: the factory to register
33 * Register the factory.
35 * Returns: The registered capability
38 gst_caps_register (GstCapsFactory factory)
40 GstCapsFactoryEntry tag;
45 g_return_val_if_fail (factory != NULL, NULL);
49 g_return_val_if_fail (tag != NULL, NULL);
51 typeid = gst_type_find_by_mime ((gchar *)tag);
53 GstTypeFactory *factory = g_new0 (GstTypeFactory, 1);
55 factory->mime = g_strdup ((gchar *)tag);
57 factory->typefindfunc = NULL;
59 typeid = gst_type_register (factory);
62 caps = g_new0 (GstCaps, 1);
63 g_return_val_if_fail (caps != NULL, NULL);
66 caps->properties = gst_props_register (&factory[i]);
74 * @caps: the capability to dump
76 * Dumps the contents of the capabilty one the console
79 gst_caps_dump (GstCaps *caps)
81 g_return_if_fail (caps != NULL);
83 g_print("gstcaps: {\ngstcaps: mime type \"%d\"\n", caps->id);
85 gst_props_dump (caps->properties);
87 g_print("gstcaps: }\n");
92 * gst_caps_check_compatibility:
93 * @fromcaps: a capabilty
94 * @tocaps: a capabilty
96 * Checks whether two capabilities are compatible
98 * Returns: true if compatible, false otherwise
101 gst_caps_check_compatibility (GstCaps *fromcaps, GstCaps *tocaps)
103 g_return_val_if_fail (fromcaps != NULL, FALSE);
104 g_return_val_if_fail (tocaps != NULL, FALSE);
106 if (fromcaps->id != tocaps->id)
109 return gst_props_check_compatibility (fromcaps->properties, tocaps->properties);