Commit a98aef82 authored by Stefan Kost's avatar Stefan Kost

renamed GST_FLAGS macros to GST_OBJECT_FLAGS moved bitshift from macro to enum definition

Original commit message from CVS:
* check/gst/gstbin.c: (GST_START_TEST):
* docs/gst/gstreamer-sections.txt:
* gst/base/gstbasesink.c: (gst_base_sink_init):
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_get_range), (gst_base_src_check_get_range),
(gst_base_src_start), (gst_base_src_stop):
* gst/base/gstbasesrc.h:
* gst/elements/gstfakesrc.c: (gst_fake_src_set_property):
* gst/gstbin.c: (gst_bin_add_func), (gst_bin_remove_func),
(bin_element_is_sink), (reset_degree), (gst_bin_element_set_state),
(bin_bus_handler):
* gst/gstbin.h:
* gst/gstbuffer.h:
* gst/gstbus.c: (gst_bus_post), (gst_bus_set_flushing):
* gst/gstbus.h:
* gst/gstelement.c: (gst_element_is_locked_state),
(gst_element_set_locked_state), (gst_element_commit_state),
(gst_element_set_state):
* gst/gstelement.h:
* gst/gstindex.c: (gst_index_init):
* gst/gstindex.h:
* gst/gstminiobject.h:
* gst/gstobject.c: (gst_object_init), (gst_object_sink),
(gst_object_set_parent):
* gst/gstobject.h:
* gst/gstpad.c: (gst_pad_set_blocked_async), (gst_pad_is_blocked),
(gst_pad_get_caps_unlocked), (gst_pad_set_caps):
* gst/gstpad.h:
* gst/gstpadtemplate.h:
* gst/gstpipeline.c: (gst_pipeline_provide_clock_func),
(gst_pipeline_use_clock), (gst_pipeline_auto_clock):
* gst/gstpipeline.h:
* gst/indexers/gstfileindex.c: (gst_file_index_load),
(gst_file_index_commit):
* testsuite/bytestream/filepadsink.c: (gst_fp_sink_init):
* testsuite/pad/link.c: (gst_test_src_init),
(gst_test_filter_init), (gst_test_sink_init):
* testsuite/states/locked.c: (main):
renamed GST_FLAGS macros to GST_OBJECT_FLAGS
moved bitshift from macro to enum definition
parent 427aa600
2005-10-12 Stefan Kost <ensonic@users.sf.net>
* check/gst/gstbin.c: (GST_START_TEST):
* docs/gst/gstreamer-sections.txt:
* gst/base/gstbasesink.c: (gst_base_sink_init):
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_get_range), (gst_base_src_check_get_range),
(gst_base_src_start), (gst_base_src_stop):
* gst/base/gstbasesrc.h:
* gst/elements/gstfakesrc.c: (gst_fake_src_set_property):
* gst/gstbin.c: (gst_bin_add_func), (gst_bin_remove_func),
(bin_element_is_sink), (reset_degree), (gst_bin_element_set_state),
(bin_bus_handler):
* gst/gstbin.h:
* gst/gstbuffer.h:
* gst/gstbus.c: (gst_bus_post), (gst_bus_set_flushing):
* gst/gstbus.h:
* gst/gstelement.c: (gst_element_is_locked_state),
(gst_element_set_locked_state), (gst_element_commit_state),
(gst_element_set_state):
* gst/gstelement.h:
* gst/gstindex.c: (gst_index_init):
* gst/gstindex.h:
* gst/gstminiobject.h:
* gst/gstobject.c: (gst_object_init), (gst_object_sink),
(gst_object_set_parent):
* gst/gstobject.h:
* gst/gstpad.c: (gst_pad_set_blocked_async), (gst_pad_is_blocked),
(gst_pad_get_caps_unlocked), (gst_pad_set_caps):
* gst/gstpad.h:
* gst/gstpadtemplate.h:
* gst/gstpipeline.c: (gst_pipeline_provide_clock_func),
(gst_pipeline_use_clock), (gst_pipeline_auto_clock):
* gst/gstpipeline.h:
* gst/indexers/gstfileindex.c: (gst_file_index_load),
(gst_file_index_commit):
* testsuite/bytestream/filepadsink.c: (gst_fp_sink_init):
* testsuite/pad/link.c: (gst_test_src_init),
(gst_test_filter_init), (gst_test_sink_init):
* testsuite/states/locked.c: (main):
renamed GST_FLAGS macros to GST_OBJECT_FLAGS
moved bitshift from macro to enum definition
2005-10-12 Wim Taymans <wim@fluendo.com>
* gst/base/gstbasesink.c: (gst_base_sink_handle_buffer):
......@@ -154,7 +197,7 @@
* gst/parse/types.h:
config.h already included before
* tools/gst-inspect.c: (main):
sys/wait.h also doesnt exist on mingw, so change the ifdef check
sys/wait.h also doesnt exist on mingw, so change the ifdef check
check for ENABLE_NLS, not GETTEXT_PACKAGE
* tools/gst-launch.c: (main):
check for ENABLE_NLS, not GETTEXT_PACKAGE
......
......@@ -603,7 +603,7 @@ GST_START_TEST (test_children_state_change_order_semi_sink)
fail_unless (gst_element_link (identity, sink) == TRUE);
/* this is not very nice but should work just fine in this case. */
GST_FLAG_UNSET (sink, GST_ELEMENT_IS_SINK); /* <======== */
GST_OBJECT_FLAG_UNSET (sink, GST_ELEMENT_IS_SINK); /* <======== */
ret = gst_element_set_state (pipeline, GST_STATE_PLAYING);
fail_if (ret != GST_STATE_CHANGE_ASYNC, "State change to PLAYING not ASYNC");
......
......@@ -1070,10 +1070,10 @@ gst_mini_object_flags_get_type
<TITLE>GstObject</TITLE>
GstObject
GstObjectFlags
GST_FLAGS
GST_FLAG_IS_SET
GST_FLAG_SET
GST_FLAG_UNSET
GST_OBJECT_FLAGS
GST_OBJECT_FLAG_IS_SET
GST_OBJECT_FLAG_SET
GST_OBJECT_FLAG_UNSET
GST_OBJECT_NAME
GST_OBJECT_PARENT
GST_LOCK
......
......@@ -278,7 +278,7 @@ gst_base_sink_init (GstBaseSink * basesink, gpointer g_class)
basesink->sync = DEFAULT_SYNC;
GST_FLAG_SET (basesink, GST_ELEMENT_IS_SINK);
GST_OBJECT_FLAG_SET (basesink, GST_ELEMENT_IS_SINK);
}
static void
......
......@@ -217,7 +217,7 @@ gst_base_src_init (GstBaseSrc * basesrc, gpointer g_class)
basesrc->blocksize = DEFAULT_BLOCKSIZE;
basesrc->clock_id = NULL;
GST_FLAG_UNSET (basesrc, GST_BASE_SRC_STARTED);
GST_OBJECT_FLAG_UNSET (basesrc, GST_BASE_SRC_STARTED);
GST_DEBUG_OBJECT (basesrc, "init done");
}
......@@ -602,7 +602,7 @@ gst_base_src_get_range (GstPad * pad, guint64 offset, guint length,
goto flushing;
GST_UNLOCK (pad);
if (!GST_FLAG_IS_SET (src, GST_BASE_SRC_STARTED))
if (!GST_OBJECT_FLAG_IS_SET (src, GST_BASE_SRC_STARTED))
goto not_started;
if (!bclass->create)
......@@ -677,7 +677,7 @@ gst_base_src_check_get_range (GstPad * pad)
src = GST_BASE_SRC (GST_OBJECT_PARENT (pad));
if (!GST_FLAG_IS_SET (src, GST_BASE_SRC_STARTED)) {
if (!GST_OBJECT_FLAG_IS_SET (src, GST_BASE_SRC_STARTED)) {
gst_base_src_start (src);
gst_base_src_stop (src);
}
......@@ -884,7 +884,7 @@ gst_base_src_start (GstBaseSrc * basesrc)
GstBaseSrcClass *bclass;
gboolean result;
if (GST_FLAG_IS_SET (basesrc, GST_BASE_SRC_STARTED))
if (GST_OBJECT_FLAG_IS_SET (basesrc, GST_BASE_SRC_STARTED))
return TRUE;
GST_DEBUG_OBJECT (basesrc, "starting source");
......@@ -900,7 +900,7 @@ gst_base_src_start (GstBaseSrc * basesrc)
if (!result)
goto could_not_start;
GST_FLAG_SET (basesrc, GST_BASE_SRC_STARTED);
GST_OBJECT_FLAG_SET (basesrc, GST_BASE_SRC_STARTED);
/* start in the beginning */
basesrc->offset = 0;
......@@ -964,7 +964,7 @@ gst_base_src_stop (GstBaseSrc * basesrc)
GstBaseSrcClass *bclass;
gboolean result = TRUE;
if (!GST_FLAG_IS_SET (basesrc, GST_BASE_SRC_STARTED))
if (!GST_OBJECT_FLAG_IS_SET (basesrc, GST_BASE_SRC_STARTED))
return TRUE;
GST_DEBUG_OBJECT (basesrc, "stopping source");
......@@ -974,7 +974,7 @@ gst_base_src_stop (GstBaseSrc * basesrc)
result = bclass->stop (basesrc);
if (result)
GST_FLAG_UNSET (basesrc, GST_BASE_SRC_STARTED);
GST_OBJECT_FLAG_UNSET (basesrc, GST_BASE_SRC_STARTED);
return result;
}
......
......@@ -43,9 +43,9 @@ G_BEGIN_DECLS
* The #GstElement flags that a basesrc element may have.
*/
typedef enum {
GST_BASE_SRC_STARTED = GST_ELEMENT_FLAG_LAST,
GST_BASE_SRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2
GST_BASE_SRC_STARTED = (GST_ELEMENT_FLAG_LAST << 0),
/* padding */
GST_BASE_SRC_FLAG_LAST = (GST_ELEMENT_FLAG_LAST << 2)
} GstBaseSrcFlags;
typedef struct _GstBaseSrc GstBaseSrc;
......
......@@ -448,11 +448,11 @@ gst_fake_src_set_property (GObject * object, guint prop_id,
src->dump = g_value_get_boolean (value);
break;
case PROP_CAN_ACTIVATE_PUSH:
g_return_if_fail (!GST_FLAG_IS_SET (object, GST_BASE_SRC_STARTED));
g_return_if_fail (!GST_OBJECT_FLAG_IS_SET (object, GST_BASE_SRC_STARTED));
GST_BASE_SRC (src)->can_activate_push = g_value_get_boolean (value);
break;
case PROP_CAN_ACTIVATE_PULL:
g_return_if_fail (!GST_FLAG_IS_SET (object, GST_BASE_SRC_STARTED));
g_return_if_fail (!GST_OBJECT_FLAG_IS_SET (object, GST_BASE_SRC_STARTED));
src->can_activate_pull = g_value_get_boolean (value);
break;
case PROP_IS_LIVE:
......
......@@ -484,10 +484,10 @@ gst_bin_add_func (GstBin * bin, GstElement * element)
goto had_parent;
/* if we add a sink we become a sink */
if (GST_FLAG_IS_SET (element, GST_ELEMENT_IS_SINK)) {
if (GST_OBJECT_FLAG_IS_SET (element, GST_ELEMENT_IS_SINK)) {
GST_CAT_DEBUG_OBJECT (GST_CAT_PARENTAGE, bin, "element \"%s\" was sink",
elem_name);
GST_FLAG_SET (bin, GST_ELEMENT_IS_SINK);
GST_OBJECT_FLAG_SET (bin, GST_ELEMENT_IS_SINK);
}
if (gst_element_provides_clock (element)) {
GST_CAT_DEBUG_OBJECT (GST_CAT_PARENTAGE, bin,
......@@ -609,10 +609,10 @@ gst_bin_remove_func (GstBin * bin, GstElement * element)
GST_LOCK (element);
/* Check if the element is already being removed and immediately
* return */
if (G_UNLIKELY (GST_FLAG_IS_SET (element, GST_ELEMENT_UNPARENTING)))
if (G_UNLIKELY (GST_OBJECT_FLAG_IS_SET (element, GST_ELEMENT_UNPARENTING)))
goto already_removing;
GST_FLAG_SET (element, GST_ELEMENT_UNPARENTING);
GST_OBJECT_FLAG_SET (element, GST_ELEMENT_UNPARENTING);
/* grab element name so we can print it */
elem_name = g_strdup (GST_ELEMENT_NAME (element));
GST_UNLOCK (element);
......@@ -633,7 +633,7 @@ gst_bin_remove_func (GstBin * bin, GstElement * element)
bin->children_cookie++;
/* check if we removed a sink */
if (GST_FLAG_IS_SET (element, GST_ELEMENT_IS_SINK)) {
if (GST_OBJECT_FLAG_IS_SET (element, GST_ELEMENT_IS_SINK)) {
GList *other_sink;
/* check if we removed the last sink */
......@@ -641,7 +641,7 @@ gst_bin_remove_func (GstBin * bin, GstElement * element)
bin, (GCompareFunc) bin_element_is_sink);
if (!other_sink) {
/* yups, we're not a sink anymore */
GST_FLAG_UNSET (bin, GST_ELEMENT_IS_SINK);
GST_OBJECT_FLAG_UNSET (bin, GST_ELEMENT_IS_SINK);
}
}
if (gst_element_provides_clock (element)) {
......@@ -672,7 +672,7 @@ gst_bin_remove_func (GstBin * bin, GstElement * element)
gst_object_unparent (GST_OBJECT_CAST (element));
GST_LOCK (element);
GST_FLAG_UNSET (element, GST_ELEMENT_UNPARENTING);
GST_OBJECT_FLAG_UNSET (element, GST_ELEMENT_UNPARENTING);
GST_UNLOCK (element);
g_signal_emit (G_OBJECT (bin), gst_bin_signals[ELEMENT_REMOVED], 0, element);
......@@ -851,7 +851,7 @@ bin_element_is_sink (GstElement * child, GstBin * bin)
/* we lock the child here for the remainder of the function to
* get its name and flag safely. */
GST_LOCK (child);
is_sink = GST_FLAG_IS_SET (child, GST_ELEMENT_IS_SINK);
is_sink = GST_OBJECT_FLAG_IS_SET (child, GST_ELEMENT_IS_SINK);
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, bin,
"child %s %s sink", GST_OBJECT_NAME (child), is_sink ? "is" : "is not");
......@@ -1129,7 +1129,7 @@ static void
reset_degree (GstElement * element, GstBinSortIterator * bit)
{
/* sinks are added right away */
if (GST_FLAG_IS_SET (element, GST_ELEMENT_IS_SINK)) {
if (GST_OBJECT_FLAG_IS_SET (element, GST_ELEMENT_IS_SINK)) {
add_to_queue (bit, element);
} else {
/* others are marked with 0 and handled when sinks are done */
......@@ -1334,7 +1334,7 @@ gst_bin_element_set_state (GstBin * bin, GstElement * element, GstState pending)
/* peel off the locked flag */
GST_LOCK (element);
locked = GST_FLAG_IS_SET (element, GST_ELEMENT_LOCKED_STATE);
locked = GST_OBJECT_FLAG_IS_SET (element, GST_ELEMENT_LOCKED_STATE);
GST_UNLOCK (element);
/* skip locked elements */
......@@ -1620,7 +1620,7 @@ bin_bus_handler (GstBus * bus, GstMessage * message, GstBin * bin)
GST_STATE_LOCK (bin);
GST_DEBUG_OBJECT (bin, "locked");
if (!GST_FLAG_IS_SET (bin, GST_ELEMENT_CHANGING_STATE)) {
if (!GST_OBJECT_FLAG_IS_SET (bin, GST_ELEMENT_CHANGING_STATE)) {
GST_DEBUG_OBJECT (bin, "got ASYNC message, forcing recalc state");
GST_STATE_UNLOCK (bin);
......
......@@ -46,12 +46,12 @@ GST_EXPORT GType _gst_bin_type;
* Derived classes can use this as first value in a list of flags.
*
* GstBinFlags are a set of flags specific to bins. Most are set/used
* internally. They can be checked using the GST_FLAG_IS_SET () macro,
* and (un)set using GST_FLAG_SET () and GST_FLAG_UNSET ().
* internally. They can be checked using the GST_OBJECT_FLAG_IS_SET () macro,
* and (un)set using GST_OBJECT_FLAG_SET () and GST_OBJECT_FLAG_UNSET ().
*/
typedef enum {
/* padding */
GST_BIN_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 5
GST_BIN_FLAG_LAST = (GST_ELEMENT_FLAG_LAST << 5)
} GstBinFlags;
typedef struct _GstBin GstBin;
......
......@@ -191,14 +191,15 @@ typedef struct _GstBufferClass GstBufferClass;
* A set of buffer flags used to describe properties of a #GstBuffer.
*/
typedef enum {
GST_BUFFER_FLAG_READONLY = GST_MINI_OBJECT_FLAG_READONLY,
GST_BUFFER_FLAG_ORIGINAL = (GST_MINI_OBJECT_FLAG_LAST << 0), /* original data, not copied, not currently used */
GST_BUFFER_FLAG_PREROLL = (GST_MINI_OBJECT_FLAG_LAST << 1), /* sample should not be displayed */
GST_BUFFER_FLAG_DISCONT = (GST_MINI_OBJECT_FLAG_LAST << 2), /* buffer is first after discontinuity in the stream */
GST_BUFFER_FLAG_IN_CAPS = (GST_MINI_OBJECT_FLAG_LAST << 3), /* buffer is also part of caps */
GST_BUFFER_FLAG_GAP = (GST_MINI_OBJECT_FLAG_LAST << 4), /* buffer has been created to fill a gap in the stream */
GST_BUFFER_FLAG_READONLY = GST_MINI_OBJECT_FLAG_READONLY,
GST_BUFFER_FLAG_ORIGINAL = (GST_MINI_OBJECT_FLAG_LAST << 0), /* original data, not copied, not currently used */
GST_BUFFER_FLAG_PREROLL = (GST_MINI_OBJECT_FLAG_LAST << 1), /* sample should not be displayed */
GST_BUFFER_FLAG_DISCONT = (GST_MINI_OBJECT_FLAG_LAST << 2), /* buffer is first after discontinuity in the stream */
GST_BUFFER_FLAG_IN_CAPS = (GST_MINI_OBJECT_FLAG_LAST << 3), /* buffer is also part of caps */
GST_BUFFER_FLAG_GAP = (GST_MINI_OBJECT_FLAG_LAST << 4), /* buffer has been created to fill a gap in the stream */
GST_BUFFER_FLAG_DELTA_UNIT = (GST_MINI_OBJECT_FLAG_LAST << 5), /* can't be used as sync point in stream */
GST_BUFFER_FLAG_LAST = (GST_MINI_OBJECT_FLAG_LAST << 8)
/* padding */
GST_BUFFER_FLAG_LAST = (GST_MINI_OBJECT_FLAG_LAST << 8)
} GstBufferFlag;
struct _GstBuffer {
......
......@@ -302,7 +302,7 @@ gst_bus_post (GstBus * bus, GstMessage * message)
GST_LOCK (bus);
/* check if the bus is flushing */
if (GST_FLAG_IS_SET (bus, GST_BUS_FLUSHING))
if (GST_OBJECT_FLAG_IS_SET (bus, GST_BUS_FLUSHING))
goto is_flushing;
handler = bus->sync_handler;
......@@ -426,7 +426,7 @@ gst_bus_set_flushing (GstBus * bus, gboolean flushing)
GST_LOCK (bus);
if (flushing) {
GST_FLAG_SET (bus, GST_BUS_FLUSHING);
GST_OBJECT_FLAG_SET (bus, GST_BUS_FLUSHING);
GST_DEBUG_OBJECT (bus, "set bus flushing");
......@@ -434,7 +434,7 @@ gst_bus_set_flushing (GstBus * bus, gboolean flushing)
gst_message_unref (message);
} else {
GST_DEBUG_OBJECT (bus, "unset bus flushing");
GST_FLAG_UNSET (bus, GST_BUS_FLUSHING);
GST_OBJECT_FLAG_UNSET (bus, GST_BUS_FLUSHING);
}
GST_UNLOCK (bus);
......
......@@ -47,9 +47,9 @@ G_BEGIN_DECLS
* The standard flags that a bus may have.
*/
typedef enum {
GST_BUS_FLUSHING = GST_OBJECT_FLAG_LAST,
GST_BUS_FLAG_LAST = GST_OBJECT_FLAG_LAST + 1
GST_BUS_FLUSHING = (GST_OBJECT_FLAG_LAST << 0),
/* padding */
GST_BUS_FLAG_LAST = (GST_OBJECT_FLAG_LAST << 1)
} GstBusFlags;
/**
......
......@@ -1499,7 +1499,7 @@ gst_element_is_locked_state (GstElement * element)
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
GST_LOCK (element);
result = GST_FLAG_IS_SET (element, GST_ELEMENT_LOCKED_STATE);
result = GST_OBJECT_FLAG_IS_SET (element, GST_ELEMENT_LOCKED_STATE);
GST_UNLOCK (element);
return result;
......@@ -1526,7 +1526,7 @@ gst_element_set_locked_state (GstElement * element, gboolean locked_state)
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
GST_LOCK (element);
old = GST_FLAG_IS_SET (element, GST_ELEMENT_LOCKED_STATE);
old = GST_OBJECT_FLAG_IS_SET (element, GST_ELEMENT_LOCKED_STATE);
if (G_UNLIKELY (old == locked_state))
goto was_ok;
......@@ -1534,11 +1534,11 @@ gst_element_set_locked_state (GstElement * element, gboolean locked_state)
if (locked_state) {
GST_CAT_DEBUG (GST_CAT_STATES, "locking state of element %s",
GST_ELEMENT_NAME (element));
GST_FLAG_SET (element, GST_ELEMENT_LOCKED_STATE);
GST_OBJECT_FLAG_SET (element, GST_ELEMENT_LOCKED_STATE);
} else {
GST_CAT_DEBUG (GST_CAT_STATES, "unlocking state of element %s",
GST_ELEMENT_NAME (element));
GST_FLAG_UNSET (element, GST_ELEMENT_LOCKED_STATE);
GST_OBJECT_FLAG_UNSET (element, GST_ELEMENT_LOCKED_STATE);
}
GST_UNLOCK (element);
......@@ -1803,7 +1803,7 @@ gst_element_commit_state (GstElement * element)
GstState current, next;
GstMessage *message;
GST_FLAG_SET (element, GST_ELEMENT_CHANGING_STATE);
GST_OBJECT_FLAG_SET (element, GST_ELEMENT_CHANGING_STATE);
old_state = GST_STATE (element);
/* this is the state we should go to next */
......@@ -1854,7 +1854,7 @@ gst_element_commit_state (GstElement * element)
} else {
GST_STATE_BROADCAST (element);
}
GST_FLAG_UNSET (element, GST_ELEMENT_CHANGING_STATE);
GST_OBJECT_FLAG_UNSET (element, GST_ELEMENT_CHANGING_STATE);
}
return ret;
}
......@@ -1934,7 +1934,7 @@ gst_element_set_state (GstElement * element, GstState state)
gst_element_state_get_name (state));
GST_STATE_LOCK (element);
GST_FLAG_SET (element, GST_ELEMENT_CHANGING_STATE);
GST_OBJECT_FLAG_SET (element, GST_ELEMENT_CHANGING_STATE);
old_ret = GST_STATE_RETURN (element);
/* previous state change returned an error, remove all pending
......@@ -1986,7 +1986,7 @@ gst_element_set_state (GstElement * element, GstState state)
ret = gst_element_change_state (element, transition);
GST_FLAG_UNSET (element, GST_ELEMENT_CHANGING_STATE);
GST_OBJECT_FLAG_UNSET (element, GST_ELEMENT_CHANGING_STATE);
GST_STATE_UNLOCK (element);
GST_DEBUG_OBJECT (element, "returned %d", ret);
......@@ -1996,7 +1996,7 @@ gst_element_set_state (GstElement * element, GstState state)
was_busy:
{
GST_STATE_RETURN (element) = GST_STATE_CHANGE_ASYNC;
GST_FLAG_UNSET (element, GST_ELEMENT_CHANGING_STATE);
GST_OBJECT_FLAG_UNSET (element, GST_ELEMENT_CHANGING_STATE);
GST_STATE_UNLOCK (element);
GST_DEBUG_OBJECT (element, "element was busy with async state change");
......
......@@ -154,11 +154,12 @@ typedef enum /*< flags=0 >*/
*/
typedef enum
{
GST_ELEMENT_LOCKED_STATE = GST_OBJECT_FLAG_LAST,
GST_ELEMENT_IS_SINK,
GST_ELEMENT_UNPARENTING,
GST_ELEMENT_CHANGING_STATE,
GST_ELEMENT_FLAG_LAST = GST_OBJECT_FLAG_LAST + 16
GST_ELEMENT_LOCKED_STATE = (GST_OBJECT_FLAG_LAST << 0),
GST_ELEMENT_IS_SINK = (GST_OBJECT_FLAG_LAST << 1),
GST_ELEMENT_UNPARENTING = (GST_OBJECT_FLAG_LAST << 2),
GST_ELEMENT_CHANGING_STATE = (GST_OBJECT_FLAG_LAST << 3),
/* padding */
GST_ELEMENT_FLAG_LAST = (GST_OBJECT_FLAG_LAST << 16)
} GstElementFlags;
/**
......@@ -168,7 +169,7 @@ typedef enum
* Check if the element is in the loacked state and therefore will ignore state
* changes from its parent object.
*/
#define GST_ELEMENT_IS_LOCKED_STATE(obj) (GST_FLAG_IS_SET(obj,GST_ELEMENT_LOCKED_STATE))
#define GST_ELEMENT_IS_LOCKED_STATE(obj) (GST_OBJECT_FLAG_IS_SET(obj,GST_ELEMENT_LOCKED_STATE))
/**
* GST_ELEMENT_NAME:
......
......@@ -193,8 +193,8 @@ gst_index_init (GstIndex * index)
index->resolver = resolvers[index->method].resolver;
index->resolver_user_data = resolvers[index->method].user_data;
GST_FLAG_SET (index, GST_INDEX_WRITABLE);
GST_FLAG_SET (index, GST_INDEX_READABLE);
GST_OBJECT_FLAG_SET (index, GST_INDEX_WRITABLE);
GST_OBJECT_FLAG_SET (index, GST_INDEX_READABLE);
GST_DEBUG ("created new index");
}
......
......@@ -148,8 +148,8 @@ struct _GstIndexAssociation {
* Flags for an association entry.
*/
typedef enum {
GST_ASSOCIATION_FLAG_NONE = 0,
GST_ASSOCIATION_FLAG_KEY_UNIT = (1 << 0),
GST_ASSOCIATION_FLAG_NONE = 0,
GST_ASSOCIATION_FLAG_KEY_UNIT = (1 << 0),
GST_ASSOCIATION_FLAG_DELTA_UNIT = (1 << 1),
/* new flags should start here */
......@@ -292,10 +292,10 @@ typedef gboolean (*GstIndexResolver) (GstIndex *index,
* Flags for this index
*/
typedef enum {
GST_INDEX_WRITABLE = GST_OBJECT_FLAG_LAST,
GST_INDEX_READABLE,
GST_INDEX_WRITABLE = (GST_OBJECT_FLAG_LAST << 0),
GST_INDEX_READABLE = (GST_OBJECT_FLAG_LAST << 1),
GST_INDEX_FLAG_LAST = GST_OBJECT_FLAG_LAST + 8
GST_INDEX_FLAG_LAST = (GST_OBJECT_FLAG_LAST << 8)
} GstIndexFlags;
/**
......@@ -304,7 +304,7 @@ typedef enum {
*
* Check if the index can be read from
*/
#define GST_INDEX_IS_READABLE(obj) (GST_FLAG_IS_SET (obj, GST_INDEX_READABLE))
#define GST_INDEX_IS_READABLE(obj) (GST_OBJECT_FLAG_IS_SET (obj, GST_INDEX_READABLE))
/**
* GST_INDEX_IS_WRITABLE:
......@@ -312,7 +312,7 @@ typedef enum {
*
* Check if the index can be written to
*/
#define GST_INDEX_IS_WRITABLE(obj) (GST_FLAG_IS_SET (obj, GST_INDEX_WRITABLE))
#define GST_INDEX_IS_WRITABLE(obj) (GST_OBJECT_FLAG_IS_SET (obj, GST_INDEX_WRITABLE))
struct _GstIndex {
GstObject object;
......
......@@ -57,7 +57,7 @@ typedef void (*GstMiniObjectFinalizeFunction) (GstMiniObject *);
*
* This macro checks to see if the given flag is set.
*/
#define GST_MINI_OBJECT_FLAG_IS_SET(obj,flag) (GST_MINI_OBJECT_FLAGS(obj) & (flag))
#define GST_MINI_OBJECT_FLAG_IS_SET(obj,flag) (GST_MINI_OBJECT_FLAGS (obj) & (flag))
/**
* GST_MINI_OBJECT_FLAG_SET:
* @obj: MiniObject to set flag in.
......@@ -83,10 +83,20 @@ typedef void (*GstMiniObjectFinalizeFunction) (GstMiniObject *);
*/
#define GST_VALUE_HOLDS_MINI_OBJECT(value) (G_VALUE_HOLDS(value, GST_TYPE_MINI_OBJECT))
/**
* GstMiniObjectFlags:
* @GST_MINI_OBJECT_FLAG_READONLY: is the miniobject readonly or writable
* @GST_MINI_OBJECT_FLAG_STATIC:
* @GST_MINI_OBJECT_FLAG_LAST: first flag that can be used by subclasses.
*
* Flags for the padtemplate
*/
typedef enum
{
GST_MINI_OBJECT_FLAG_READONLY = (1<<0),
GST_MINI_OBJECT_FLAG_STATIC = (1<<1),
/* padding */
GST_MINI_OBJECT_FLAG_LAST = (1<<4)
} GstMiniObjectFlags;
......
......@@ -315,7 +315,7 @@ gst_object_init (GTypeInstance * instance, gpointer g_class)
PATCH_REFCOUNT (object);
object->flags = 0;
GST_FLAG_SET (object, GST_OBJECT_FLOATING);
GST_OBJECT_FLAG_SET (object, GST_OBJECT_FLOATING);
}
#ifndef GST_DISABLE_TRACE
......@@ -448,7 +448,7 @@ gst_object_sink (gpointer object)
GST_LOCK (object);
if (G_LIKELY (GST_OBJECT_IS_FLOATING (object))) {
GST_FLAG_UNSET (object, GST_OBJECT_FLOATING);
GST_OBJECT_FLAG_UNSET (object, GST_OBJECT_FLOATING);
GST_UNLOCK (object);
gst_object_unref (object);
} else {
......@@ -869,7 +869,7 @@ gst_object_set_parent (GstObject * object, GstObject * parent)
* in the floating case. */
object->parent = parent;
if (G_LIKELY (GST_OBJECT_IS_FLOATING (object))) {
GST_FLAG_UNSET (object, GST_OBJECT_FLOATING);
GST_OBJECT_FLAG_UNSET (object, GST_OBJECT_FLOATING);
GST_UNLOCK (object);
} else {
GST_UNLOCK (object);
......
......@@ -58,10 +58,10 @@ GST_EXPORT GType _gst_object_type;
*/
typedef enum
{
GST_OBJECT_DISPOSING = 0,
GST_OBJECT_FLOATING,
GST_OBJECT_FLAG_LAST = 4
GST_OBJECT_DISPOSING = (1<<0),
GST_OBJECT_FLOATING = (1<<1),
/* padding */
GST_OBJECT_FLAG_LAST = (1<<4)
} GstObjectFlags;
#ifdef GST_HAVE_GLIB_2_8
......@@ -136,37 +136,36 @@ typedef enum
/**
* GST_FLAGS:
* GST_OBJECT_FLAGS:
* @obj: Object to return flags for.
*
* This macro returns the entire set of flags for the object.
*/
#define GST_FLAGS(obj) (GST_OBJECT_CAST (obj)->flags)
/* for the flags we double-not to make them comparable to TRUE and FALSE */
#define GST_OBJECT_FLAGS(obj) (GST_OBJECT_CAST (obj)->flags)
/**
* GST_FLAG_IS_SET:
* GST_OBJECT_FLAG_IS_SET:
* @obj: Object to check for flags.
* @flag: Flag to check for, must be a single bit in guint32.
* @flag: Flag to check for
*
* This macro checks to see if the given flag is set.
*/
#define GST_FLAG_IS_SET(obj,flag) (!!(GST_FLAGS (obj) & (1<<(flag))))
#define GST_OBJECT_FLAG_IS_SET(obj,flag) (GST_OBJECT_FLAGS (obj) & (flag))
/**
* GST_FLAG_SET:
* GST_OBJECT_FLAG_SET:
* @obj: Object to set flag in.
* @flag: Flag to set, can by any number of bits in guint32.
* @flag: Flag to set
*
* This macro sets the given bits.
*/
#define GST_FLAG_SET(obj,flag) (GST_FLAGS (obj) |= (1<<(flag)))
#define GST_OBJECT_FLAG_SET(obj,flag) (GST_OBJECT_FLAGS (obj) |= (flag))
/**
* GST_FLAG_UNSET:
* GST_OBJECT_FLAG_UNSET:
* @obj: Object to unset flag in.
* @flag: Flag to set, must be a single bit in guint32.
* @flag: Flag to set
*
* This macro usets the given bits.
*/
#define GST_FLAG_UNSET(obj,flag) (GST_FLAGS (obj) &= ~(1<<(flag)))
#define GST_OBJECT_FLAG_UNSET(obj,flag) (GST_OBJECT_FLAGS (obj) &= ~(flag))
/**
......@@ -175,14 +174,14 @@ typedef enum
*
* Check if the given object is beeing destroyed.
*/
#define GST_OBJECT_IS_DISPOSING(obj) (GST_FLAG_IS_SET (obj, GST_OBJECT_DISPOSING))
#define GST_OBJECT_IS_DISPOSING(obj) (GST_OBJECT_FLAG_IS_SET (obj, GST_OBJECT_DISPOSING))
/**
* GST_OBJECT_IS_FLOATING:
* @obj:Object to check
*
* Check if the given object is floating (has no owner).
*/
#define GST_OBJECT_IS_FLOATING(obj) (GST_FLAG_IS_SET (obj, GST_OBJECT_FLOATING))
#define GST_OBJECT_IS_FLOATING(obj) (GST_OBJECT_FLAG_IS_SET (obj, GST_OBJECT_FLOATING))
typedef struct _GstObject GstObject;
typedef struct _GstObjectClass GstObjectClass;
......
......@@ -863,7 +863,7 @@ gst_pad_set_blocked_async (GstPad * pad, gboolean blocked,
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad, "blocking pad %s:%s",
GST_DEBUG_PAD_NAME (pad));
GST_FLAG_SET (pad, GST_PAD_BLOCKED);
GST_OBJECT_FLAG_SET (pad, GST_PAD_BLOCKED);
pad->block_callback = callback;
pad->block_data = user_data;
if (!callback) {
......@@ -875,7 +875,7 @@ gst_pad_set_blocked_async (GstPad * pad, gboolean blocked,
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad, "unblocking pad %s:%s",
GST_DEBUG_PAD_NAME (pad));
GST_FLAG_UNSET (pad, GST_PAD_BLOCKED);
GST_OBJECT_FLAG_UNSET (pad, GST_PAD_BLOCKED);
pad->block_callback = callback;
pad->block_data = user_data;
......@@ -943,7 +943,7 @@ gst_pad_is_blocked (GstPad * pad)
g_return_val_if_fail (GST_IS_PAD (pad), result);
GST_LOCK (pad);
result = GST_FLAG_IS_SET (pad, GST_PAD_BLOCKED);
result = GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_BLOCKED);
GST_UNLOCK (pad);
return result;
......@@ -1755,11 +1755,11 @@ gst_pad_get_caps_unlocked (GstPad * pad)
if (GST_PAD_GETCAPSFUNC (pad)) {
GST_CAT_DEBUG (GST_CAT_CAPS, "dispatching to pad getcaps function");
GST_FLAG_SET (pad, GST_PAD_IN_GETCAPS);
GST_OBJECT_FLAG_SET (pad, GST_PAD_IN_GETCAPS);
GST_UNLOCK (pad);
result = GST_PAD_GETCAPSFUNC (pad) (pad);
GST_LOCK (pad);
GST_FLAG_UNSET (pad, GST_PAD_IN_GETCAPS);
GST_OBJECT_FLAG_UNSET (pad, GST_PAD_IN_GETCAPS);
if (result == NULL) {
g_critical ("pad %s:%s returned NULL caps from getcaps function",
......@@ -2139,12 +2139,12 @@ gst_pad_set_caps (GstPad * pad, GstCaps * caps)
/* call setcaps function to configure the pad */
if (setcaps != NULL && caps) {
if (!GST_PAD_IS_IN_SETCAPS (pad)) {
GST_FLAG_SET (pad, GST_PAD_IN_SETCAPS);
GST_OBJECT_FLAG_SET (pad, GST_PAD_IN_SETCAPS);
GST_UNLOCK (pad);
if (!setcaps (pad, caps))
goto could_not_set;
GST_LOCK (pad);
GST_FLAG_UNSET (pad, GST_PAD_IN_SETCAPS);
GST_OBJECT_FLAG_UNSET (pad, GST_PAD_IN_SETCAPS);
} else {
GST_CAT_DEBUG (GST_CAT_CAPS, "pad %s:%s was dispatching",
GST_DEBUG_PAD_NAME (pad));
......@@ -2172,7 +2172,7 @@ setting_same_caps:
could_not_set:
{
GST_LOCK (pad);