paramspecs: revert gst_param_spec_is_mutable() for release

Revert the gst_param_spec_is_mutable API for this release so we can
discuss it a bit further first.
This commit is contained in:
Jan Schmidt 2009-04-16 00:02:07 +01:00
parent e778c5fd8b
commit 4c6c9c2d5b
4 changed files with 0 additions and 58 deletions

View file

@ -1541,8 +1541,6 @@ GST_PARAM_MUTABLE_PAUSED
GST_PARAM_MUTABLE_PLAYING
GST_PARAM_MUTABLE_READY
gst_param_spec_is_mutable
<SUBSECTION paramspecfraction>
GstParamSpecFraction
gst_param_spec_fraction

View file

@ -205,50 +205,3 @@ gst_param_spec_fraction (const gchar * name, const gchar * nick,
return pspec;
}
/**
* gst_param_spec_is_mutable
* @param_spec: a GParamSpec representing a property
* @element: the GstElement of the property to be modified
*
* Checks if an object property for the GstElement given in @element
* may be modified given the current state of @element. In order to
* avoid races, this function should be called with the object lock
* of @element held.
*
* <note>By the time this method returns, the state of the element might have
* changed already. Use this method only if you can control the state of the
* element between calling this method and setting the property, such as with a
* mutex.</note>
*
* Returns: TRUE if the property may be modified
*
* Since: 0.10.23
*/
gboolean
gst_param_spec_is_mutable (GParamSpec * param_spec, GstElement * element)
{
gboolean ret = TRUE;
GstState state;
if (param_spec->flags & GST_PARAM_MUTABLE_PLAYING) {
return TRUE;
}
state = GST_STATE (element);
if (param_spec->flags & GST_PARAM_MUTABLE_PAUSED) {
if (state > GST_STATE_PAUSED) {
ret = FALSE;
}
} else if (param_spec->flags & GST_PARAM_MUTABLE_READY) {
if (state > GST_STATE_READY) {
ret = FALSE;
}
} else {
if (state > GST_STATE_NULL) {
ret = FALSE;
}
}
return ret;
}

View file

@ -20,7 +20,6 @@
#ifndef __GST_PARAMSPECS_H__
#define __GST_PARAMSPECS_H__
#include <gst/gstelement.h>
#include <gst/gstvalue.h>
G_BEGIN_DECLS
@ -123,9 +122,6 @@ GParamSpec * gst_param_spec_fraction (const gchar * name,
gint default_num, gint default_denom,
GParamFlags flags);
gboolean gst_param_spec_is_mutable (GParamSpec *param_spec,
GstElement *element);
G_END_DECLS
#endif /* __GST_PARAMSPECS_H__ */

View file

@ -389,11 +389,6 @@ gst_file_src_set_property (GObject * object, guint prop_id,
src = GST_FILE_SRC (object);
if (!gst_param_spec_is_mutable (pspec, GST_ELEMENT (src))) {
GST_WARNING_OBJECT (src, "attempting to change property in wrong state");
return;
}
switch (prop_id) {
case ARG_LOCATION:
gst_file_src_set_location (src, g_value_get_string (value));