]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gstreamer0-10.git/commitdiff
gst/elements/gstcapsfilter.c: Allow NULL as possible value for filter_caps property...
authorDavid Schleef <ds@schleef.org>
Thu, 16 Jun 2005 17:50:16 +0000 (17:50 +0000)
committerDavid Schleef <ds@schleef.org>
Thu, 16 Jun 2005 17:50:16 +0000 (17:50 +0000)
Original commit message from CVS:
* gst/elements/gstcapsfilter.c: (gst_capsfilter_class_init),
(gst_capsfilter_set_property): Allow NULL as possible value
for filter_caps property, indicating GST_CAPS_ANY.

ChangeLog
gst/elements/gstcapsfilter.c
plugins/elements/gstcapsfilter.c

index 10a426ed8a88549f246a2b1c9a7c34b6a09b86b7..e2f80f1b0a3e8c6a1d87adfd24e65acc2c6e9336 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-06-16  David Schleef  <ds@schleef.org>
+
+       * gst/elements/gstcapsfilter.c: (gst_capsfilter_class_init),
+       (gst_capsfilter_set_property): Allow NULL as possible value
+       for filter_caps property, indicating GST_CAPS_ANY.
+
 2005-06-09  Thomas Vander Stichele  <thomas at apestaart dot org>
 
        * gstreamer.spec.in:
index d478588f1ccec3d2e848d3869458292eea5fd44e..3ba28da132ff46032fd9cca1857766afa02f0d53 100644 (file)
@@ -145,7 +145,7 @@ gst_capsfilter_class_init (GstCapsFilterClass * klass)
 
   g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_FILTER_CAPS,
       g_param_spec_boxed ("filter_caps", _("Filter caps"),
-          _("Caps to use to filter the possible allowed formats"),
+          _("Restrict the possible allowed formats"),
           GST_TYPE_CAPS, G_PARAM_READWRITE));
 }
 
@@ -207,11 +207,15 @@ gst_capsfilter_set_property (GObject * object, guint prop_id,
   switch (prop_id) {
     case PROP_FILTER_CAPS:{
       GstCaps *new_caps = gst_caps_copy (gst_value_get_caps (value));
+      GstCaps *old_caps;
 
-      g_return_if_fail (new_caps != NULL);
+      if (new_caps == NULL) {
+        new_caps = gst_caps_new_any ();
+      }
 
-      gst_caps_unref (capsfilter->filter_caps);
+      old_caps = capsfilter->filter_caps;
       capsfilter->filter_caps = new_caps;
+      gst_caps_unref (old_caps);
 
       /* FIXME: Need to activate these caps on the pads */
       break;
index d478588f1ccec3d2e848d3869458292eea5fd44e..3ba28da132ff46032fd9cca1857766afa02f0d53 100644 (file)
@@ -145,7 +145,7 @@ gst_capsfilter_class_init (GstCapsFilterClass * klass)
 
   g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_FILTER_CAPS,
       g_param_spec_boxed ("filter_caps", _("Filter caps"),
-          _("Caps to use to filter the possible allowed formats"),
+          _("Restrict the possible allowed formats"),
           GST_TYPE_CAPS, G_PARAM_READWRITE));
 }
 
@@ -207,11 +207,15 @@ gst_capsfilter_set_property (GObject * object, guint prop_id,
   switch (prop_id) {
     case PROP_FILTER_CAPS:{
       GstCaps *new_caps = gst_caps_copy (gst_value_get_caps (value));
+      GstCaps *old_caps;
 
-      g_return_if_fail (new_caps != NULL);
+      if (new_caps == NULL) {
+        new_caps = gst_caps_new_any ();
+      }
 
-      gst_caps_unref (capsfilter->filter_caps);
+      old_caps = capsfilter->filter_caps;
       capsfilter->filter_caps = new_caps;
+      gst_caps_unref (old_caps);
 
       /* FIXME: Need to activate these caps on the pads */
       break;