source: trunk/third/gstreamer/testsuite/caps/fixed.c @ 21005

Revision 21005, 2.4 KB checked in by ghudson, 20 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r21004, which included commits to RCS files with non-trunk default branches.
Line 
1/* GStreamer
2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3 *
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.
8 *
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.
13 *
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.
18 */
19
20#include <gst/gst.h>
21
22gint
23main (gint argc, gchar * argv[])
24{
25#if 0
26  GstCaps *caps;
27
28  gst_init (&argc, &argv);
29
30  caps = GST_CAPS_NEW ("testcaps", "unknown/unknown", NULL);
31
32  /* newly crrated caps without props is fixed */
33  g_assert (GST_CAPS_IS_FIXED (caps));
34
35  entry = gst_props_entry_new ("foo", GST_PROPS_INT (5));
36  /* this entry is fixed */
37  g_assert (gst_props_entry_is_fixed (entry));
38
39  props = gst_props_empty_new ();
40  /* props are fixed when created */
41  g_assert (GST_PROPS_IS_FIXED (props));
42
43  gst_props_add_entry (props, entry);
44  /* props should still be fixed */
45  g_assert (GST_PROPS_IS_FIXED (props));
46
47  gst_caps_set_props (caps, props);
48  /* caps should still be fixed */
49  g_assert (GST_CAPS_IS_FIXED (caps));
50
51  entry = gst_props_entry_new ("bar", GST_PROPS_INT_RANGE (1, 5));
52  /* this entry is variable */
53  g_assert (!gst_props_entry_is_fixed (entry));
54
55  gst_props_add_entry (props, entry);
56  /* props should be variable now */
57  g_assert (!GST_PROPS_IS_FIXED (props));
58  /* caps too */
59  g_assert (!GST_CAPS_IS_FIXED (caps));
60
61  gst_props_remove_entry_by_name (props, "bar");
62  /* props should be fixed again now */
63  g_assert (GST_PROPS_IS_FIXED (props));
64  /* caps too */
65  g_assert (GST_CAPS_IS_FIXED (caps));
66
67  gst_props_set (props, "foo", GST_PROPS_INT_RANGE (1, 5));
68  /* props should be variable again now */
69  g_assert (!GST_PROPS_IS_FIXED (props));
70  /* caps too */
71  g_assert (!GST_CAPS_IS_FIXED (caps));
72
73  gst_props_set (props, "foo", GST_PROPS_INT (5));
74  /* props should be fixed again now */
75  g_assert (GST_PROPS_IS_FIXED (props));
76  /* caps too */
77  g_assert (GST_CAPS_IS_FIXED (caps));
78
79#endif
80
81  return 0;
82}
Note: See TracBrowser for help on using the repository browser.