From a98aef82db6f931a27b78cd598db95b3fef230a3 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Wed, 12 Oct 2005 14:28:39 +0000 Subject: [PATCH] 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 --- ChangeLog | 45 +++++++++++++++++++++++++++- check/gst/gstbin.c | 2 +- docs/gst/gstreamer-sections.txt | 8 ++--- gst/base/gstbasesink.c | 2 +- gst/base/gstbasesrc.c | 14 ++++----- gst/base/gstbasesrc.h | 6 ++-- gst/elements/gstfakesrc.c | 4 +-- gst/gstbin.c | 22 +++++++------- gst/gstbin.h | 6 ++-- gst/gstbuffer.h | 15 +++++----- gst/gstbus.c | 6 ++-- gst/gstbus.h | 6 ++-- gst/gstelement.c | 18 +++++------ gst/gstelement.h | 13 ++++---- gst/gstindex.c | 4 +-- gst/gstindex.h | 14 ++++----- gst/gstminiobject.h | 12 +++++++- gst/gstobject.c | 6 ++-- gst/gstobject.h | 35 +++++++++++----------- gst/gstpad.c | 16 +++++----- gst/gstpad.h | 25 ++++++++-------- gst/gstpadtemplate.h | 8 ++--- gst/gstpipeline.c | 6 ++-- gst/gstpipeline.h | 5 ++-- gst/indexers/gstfileindex.c | 4 +-- libs/gst/base/gstbasesink.c | 2 +- libs/gst/base/gstbasesrc.c | 14 ++++----- libs/gst/base/gstbasesrc.h | 6 ++-- plugins/elements/gstfakesrc.c | 4 +-- plugins/indexers/gstfileindex.c | 4 +-- tests/check/gst/gstbin.c | 2 +- tests/old/testsuite/bytestream/filepadsink.c | 2 +- tests/old/testsuite/pad/link.c | 6 ++-- tests/old/testsuite/states/locked.c | 8 ++--- testsuite/bytestream/filepadsink.c | 2 +- testsuite/pad/link.c | 6 ++-- testsuite/states/locked.c | 8 ++--- 37 files changed, 209 insertions(+), 157 deletions(-) diff --git a/ChangeLog b/ChangeLog index e37cbab..1d8b861 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,46 @@ +2005-10-12 Stefan Kost + + * 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 * 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 doesn´t exist on mingw, so change the ifdef check + sys/wait.h also doesn�t 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 diff --git a/check/gst/gstbin.c b/check/gst/gstbin.c index 84da78d..b0c68bd 100644 --- a/check/gst/gstbin.c +++ b/check/gst/gstbin.c @@ -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"); diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt index 7d810ea..ee2c5b2 100644 --- a/docs/gst/gstreamer-sections.txt +++ b/docs/gst/gstreamer-sections.txt @@ -1070,10 +1070,10 @@ gst_mini_object_flags_get_type GstObject 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 diff --git a/gst/base/gstbasesink.c b/gst/base/gstbasesink.c index 9877eb4..7a11f87 100644 --- a/gst/base/gstbasesink.c +++ b/gst/base/gstbasesink.c @@ -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 diff --git a/gst/base/gstbasesrc.c b/gst/base/gstbasesrc.c index 1ec7b35..86633a0 100644 --- a/gst/base/gstbasesrc.c +++ b/gst/base/gstbasesrc.c @@ -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; } diff --git a/gst/base/gstbasesrc.h b/gst/base/gstbasesrc.h index 2215331..7fa928a 100644 --- a/gst/base/gstbasesrc.h +++ b/gst/base/gstbasesrc.h @@ -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; diff --git a/gst/elements/gstfakesrc.c b/gst/elements/gstfakesrc.c index 5de6741..625533f 100644 --- a/gst/elements/gstfakesrc.c +++ b/gst/elements/gstfakesrc.c @@ -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: diff --git a/gst/gstbin.c b/gst/gstbin.c index 5739c45..ca45f9e 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -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); diff --git a/gst/gstbin.h b/gst/gstbin.h index a9555f0..4eb2b6d 100644 --- a/gst/gstbin.h +++ b/gst/gstbin.h @@ -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; diff --git a/gst/gstbuffer.h b/gst/gstbuffer.h index 4dba10d..a9da5a8 100644 --- a/gst/gstbuffer.h +++ b/gst/gstbuffer.h @@ -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 { diff --git a/gst/gstbus.c b/gst/gstbus.c index c2763ee..78c6244 100644 --- a/gst/gstbus.c +++ b/gst/gstbus.c @@ -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); diff --git a/gst/gstbus.h b/gst/gstbus.h index c571bc5..b0fdcf5 100644 --- a/gst/gstbus.h +++ b/gst/gstbus.h @@ -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; /** diff --git a/gst/gstelement.c b/gst/gstelement.c index e8bec97..dab88ac 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -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"); diff --git a/gst/gstelement.h b/gst/gstelement.h index c48b06c..e437961 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -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: diff --git a/gst/gstindex.c b/gst/gstindex.c index 35f026d..d20e108 100644 --- a/gst/gstindex.c +++ b/gst/gstindex.c @@ -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"); } diff --git a/gst/gstindex.h b/gst/gstindex.h index 22738d8..33f1ee3 100644 --- a/gst/gstindex.h +++ b/gst/gstindex.h @@ -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; diff --git a/gst/gstminiobject.h b/gst/gstminiobject.h index cf2c92a..fe2a89c 100644 --- a/gst/gstminiobject.h +++ b/gst/gstminiobject.h @@ -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; diff --git a/gst/gstobject.c b/gst/gstobject.c index 23a13cf..d9f2b3e 100644 --- a/gst/gstobject.c +++ b/gst/gstobject.c @@ -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); diff --git a/gst/gstobject.h b/gst/gstobject.h index 8e4d36a..173adeb 100644 --- a/gst/gstobject.h +++ b/gst/gstobject.h @@ -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; diff --git a/gst/gstpad.c b/gst/gstpad.c index 8db93b5..953332a 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -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); - GST_FLAG_UNSET (pad, GST_PAD_IN_SETCAPS); + GST_OBJECT_FLAG_UNSET (pad, GST_PAD_IN_SETCAPS); GST_CAT_DEBUG (GST_CAT_CAPS, "pad %s:%s, caps %" GST_PTR_FORMAT " could not be set", GST_DEBUG_PAD_NAME (pad), caps); diff --git a/gst/gstpad.h b/gst/gstpad.h index 31edaca..e0df0c0 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -295,13 +295,12 @@ typedef enum { * Pad state flags */ typedef enum { - GST_PAD_BLOCKED = GST_OBJECT_FLAG_LAST, - GST_PAD_FLUSHING, - GST_PAD_IN_GETCAPS, - GST_PAD_IN_SETCAPS, - - /* padding */ - GST_PAD_FLAG_LAST = GST_OBJECT_FLAG_LAST + 8 + GST_PAD_BLOCKED = (GST_OBJECT_FLAG_LAST << 0), + GST_PAD_FLUSHING = (GST_OBJECT_FLAG_LAST << 1), + GST_PAD_IN_GETCAPS = (GST_OBJECT_FLAG_LAST << 2), + GST_PAD_IN_SETCAPS = (GST_OBJECT_FLAG_LAST << 3), + /* padding */ + GST_PAD_FLAG_LAST = (GST_OBJECT_FLAG_LAST << 8) } GstPadFlags; /* FIXME: this awful circular dependency need to be resolved properly (see padtemplate.h) */ @@ -426,17 +425,17 @@ struct _GstPadClass { #define GST_PAD_DO_EVENT_SIGNALS(pad) (GST_PAD_CAST(pad)->do_event_signals) #define GST_PAD_IS_LINKED(pad) (GST_PAD_PEER(pad) != NULL) -#define GST_PAD_IS_BLOCKED(pad) (GST_FLAG_IS_SET (pad, GST_PAD_BLOCKED)) -#define GST_PAD_IS_FLUSHING(pad) (GST_FLAG_IS_SET (pad, GST_PAD_FLUSHING)) -#define GST_PAD_IS_IN_GETCAPS(pad) (GST_FLAG_IS_SET (pad, GST_PAD_IN_GETCAPS)) -#define GST_PAD_IS_IN_SETCAPS(pad) (GST_FLAG_IS_SET (pad, GST_PAD_IN_SETCAPS)) +#define GST_PAD_IS_BLOCKED(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_BLOCKED)) +#define GST_PAD_IS_FLUSHING(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLUSHING)) +#define GST_PAD_IS_IN_GETCAPS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_IN_GETCAPS)) +#define GST_PAD_IS_IN_SETCAPS(pad) (GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_IN_SETCAPS)) #define GST_PAD_IS_USABLE(pad) (GST_PAD_IS_LINKED (pad) && \ !GST_PAD_IS_FLUSHING(pad) && !GST_PAD_IS_FLUSHING(GST_PAD_PEER (pad))) #define GST_PAD_IS_SRC(pad) (GST_PAD_DIRECTION(pad) == GST_PAD_SRC) #define GST_PAD_IS_SINK(pad) (GST_PAD_DIRECTION(pad) == GST_PAD_SINK) -#define GST_PAD_SET_FLUSHING(pad) (GST_FLAG_SET (pad, GST_PAD_FLUSHING)) -#define GST_PAD_UNSET_FLUSHING(pad) (GST_FLAG_UNSET (pad, GST_PAD_FLUSHING)) +#define GST_PAD_SET_FLUSHING(pad) (GST_OBJECT_FLAG_SET (pad, GST_PAD_FLUSHING)) +#define GST_PAD_UNSET_FLUSHING(pad) (GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLUSHING)) #define GST_STREAM_GET_LOCK(pad) (GST_PAD_CAST(pad)->stream_rec_lock) #define GST_STREAM_LOCK(pad) (g_static_rec_mutex_lock(GST_STREAM_GET_LOCK(pad))) diff --git a/gst/gstpadtemplate.h b/gst/gstpadtemplate.h index e655e20..1059c65 100644 --- a/gst/gstpadtemplate.h +++ b/gst/gstpadtemplate.h @@ -101,9 +101,9 @@ typedef enum { * Flags for the padtemplate */ typedef enum { - GST_PAD_TEMPLATE_FIXED = GST_OBJECT_FLAG_LAST, - - GST_PAD_TEMPLATE_FLAG_LAST = GST_OBJECT_FLAG_LAST + 4 + GST_PAD_TEMPLATE_FIXED = (GST_OBJECT_FLAG_LAST << 0), + /* padding */ + GST_PAD_TEMPLATE_FLAG_LAST = (GST_OBJECT_FLAG_LAST << 4) } GstPadTemplateFlags; /** @@ -112,7 +112,7 @@ typedef enum { * * Check if the properties of the padtemplate are fixed */ -#define GST_PAD_TEMPLATE_IS_FIXED(templ) (GST_FLAG_IS_SET(templ, GST_PAD_TEMPLATE_FIXED)) +#define GST_PAD_TEMPLATE_IS_FIXED(templ) (GST_OBJECT_FLAG_IS_SET(templ, GST_PAD_TEMPLATE_FIXED)) /** * GstPadTemplate: diff --git a/gst/gstpipeline.c b/gst/gstpipeline.c index 07790af..232acc4 100644 --- a/gst/gstpipeline.c +++ b/gst/gstpipeline.c @@ -462,7 +462,7 @@ gst_pipeline_provide_clock_func (GstElement * element) /* if we have a fixed clock, use that one */ GST_LOCK (pipeline); - if (GST_FLAG_IS_SET (pipeline, GST_PIPELINE_FLAG_FIXED_CLOCK)) { + if (GST_OBJECT_FLAG_IS_SET (pipeline, GST_PIPELINE_FLAG_FIXED_CLOCK)) { clock = pipeline->fixed_clock; gst_object_ref (clock); GST_UNLOCK (pipeline); @@ -522,7 +522,7 @@ gst_pipeline_use_clock (GstPipeline * pipeline, GstClock * clock) g_return_if_fail (GST_IS_PIPELINE (pipeline)); GST_LOCK (pipeline); - GST_FLAG_SET (pipeline, GST_PIPELINE_FLAG_FIXED_CLOCK); + GST_OBJECT_FLAG_SET (pipeline, GST_PIPELINE_FLAG_FIXED_CLOCK); gst_object_replace ((GstObject **) & pipeline->fixed_clock, (GstObject *) clock); @@ -566,7 +566,7 @@ gst_pipeline_auto_clock (GstPipeline * pipeline) g_return_if_fail (GST_IS_PIPELINE (pipeline)); GST_LOCK (pipeline); - GST_FLAG_UNSET (pipeline, GST_PIPELINE_FLAG_FIXED_CLOCK); + GST_OBJECT_FLAG_UNSET (pipeline, GST_PIPELINE_FLAG_FIXED_CLOCK); gst_object_replace ((GstObject **) & pipeline->fixed_clock, NULL); GST_UNLOCK (pipeline); diff --git a/gst/gstpipeline.h b/gst/gstpipeline.h index 564de35..1251ca8 100644 --- a/gst/gstpipeline.h +++ b/gst/gstpipeline.h @@ -46,10 +46,9 @@ typedef struct _GstPipelineClass GstPipelineClass; * Pipeline flags */ typedef enum { - GST_PIPELINE_FLAG_FIXED_CLOCK = GST_BIN_FLAG_LAST, - + GST_PIPELINE_FLAG_FIXED_CLOCK = (GST_BIN_FLAG_LAST << 0), /* padding */ - GST_PIPELINE_FLAG_LAST = GST_BIN_FLAG_LAST + 4 + GST_PIPELINE_FLAG_LAST = (GST_BIN_FLAG_LAST << 4) } GstPipelineFlags; struct _GstPipeline { diff --git a/gst/indexers/gstfileindex.c b/gst/indexers/gstfileindex.c index 4789eab..9e20dbc 100644 --- a/gst/indexers/gstfileindex.c +++ b/gst/indexers/gstfileindex.c @@ -455,7 +455,7 @@ gst_file_index_load (GstFileIndex * index) xmlFreeDoc (doc); - GST_FLAG_UNSET (index, GST_INDEX_WRITABLE); + GST_OBJECT_FLAG_UNSET (index, GST_INDEX_WRITABLE); index->is_loaded = TRUE; GST_LOG_OBJECT (index, "index %s loaded OK", index->location); } @@ -589,7 +589,7 @@ gst_file_index_commit (GstIndex * _index, gint _writer_id) g_return_if_fail (index->location); g_return_if_fail (!index->is_loaded); - GST_FLAG_UNSET (index, GST_INDEX_WRITABLE); + GST_OBJECT_FLAG_UNSET (index, GST_INDEX_WRITABLE); doc = xmlNewDoc ((xmlChar *) "1.0"); doc->xmlRootNode = diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index 9877eb4..7a11f87 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -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 diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index 1ec7b35..86633a0 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -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; } diff --git a/libs/gst/base/gstbasesrc.h b/libs/gst/base/gstbasesrc.h index 2215331..7fa928a 100644 --- a/libs/gst/base/gstbasesrc.h +++ b/libs/gst/base/gstbasesrc.h @@ -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; diff --git a/plugins/elements/gstfakesrc.c b/plugins/elements/gstfakesrc.c index 5de6741..625533f 100644 --- a/plugins/elements/gstfakesrc.c +++ b/plugins/elements/gstfakesrc.c @@ -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: diff --git a/plugins/indexers/gstfileindex.c b/plugins/indexers/gstfileindex.c index 4789eab..9e20dbc 100644 --- a/plugins/indexers/gstfileindex.c +++ b/plugins/indexers/gstfileindex.c @@ -455,7 +455,7 @@ gst_file_index_load (GstFileIndex * index) xmlFreeDoc (doc); - GST_FLAG_UNSET (index, GST_INDEX_WRITABLE); + GST_OBJECT_FLAG_UNSET (index, GST_INDEX_WRITABLE); index->is_loaded = TRUE; GST_LOG_OBJECT (index, "index %s loaded OK", index->location); } @@ -589,7 +589,7 @@ gst_file_index_commit (GstIndex * _index, gint _writer_id) g_return_if_fail (index->location); g_return_if_fail (!index->is_loaded); - GST_FLAG_UNSET (index, GST_INDEX_WRITABLE); + GST_OBJECT_FLAG_UNSET (index, GST_INDEX_WRITABLE); doc = xmlNewDoc ((xmlChar *) "1.0"); doc->xmlRootNode = diff --git a/tests/check/gst/gstbin.c b/tests/check/gst/gstbin.c index 84da78d..b0c68bd 100644 --- a/tests/check/gst/gstbin.c +++ b/tests/check/gst/gstbin.c @@ -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"); diff --git a/tests/old/testsuite/bytestream/filepadsink.c b/tests/old/testsuite/bytestream/filepadsink.c index b25a63a..0b4769f 100644 --- a/tests/old/testsuite/bytestream/filepadsink.c +++ b/tests/old/testsuite/bytestream/filepadsink.c @@ -80,7 +80,7 @@ static GstStaticPadTemplate template = GST_STATIC_PAD_TEMPLATE ("sink", static void gst_fp_sink_init (GstFpSink * fp) { - GST_FLAG_SET (fp, GST_ELEMENT_EVENT_AWARE); + GST_OBJECT_FLAG_SET (fp, GST_ELEMENT_EVENT_AWARE); fp->sinkpad = GST_FILE_PAD (gst_file_pad_new (gst_static_pad_template_get (&template), diff --git a/tests/old/testsuite/pad/link.c b/tests/old/testsuite/pad/link.c index 4a7d31e..c38100f 100644 --- a/tests/old/testsuite/pad/link.c +++ b/tests/old/testsuite/pad/link.c @@ -68,7 +68,7 @@ gst_test_src_init (GstTestElement * src) } gst_element_add_pad (GST_ELEMENT (src), src->srcpad); - GST_FLAG_SET (src, GST_ELEMENT_EVENT_AWARE); + GST_OBJECT_FLAG_SET (src, GST_ELEMENT_EVENT_AWARE); } static void @@ -101,7 +101,7 @@ gst_test_filter_init (GstTestElement * filter) filter->srcpad = gst_pad_new ("src", GST_PAD_SRC); gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad); - GST_FLAG_SET (filter, GST_ELEMENT_EVENT_AWARE); + GST_OBJECT_FLAG_SET (filter, GST_ELEMENT_EVENT_AWARE); } static void @@ -129,7 +129,7 @@ gst_test_sink_init (GstTestElement * sink) } gst_element_add_pad (GST_ELEMENT (sink), sink->sinkpad); - GST_FLAG_SET (sink, GST_ELEMENT_EVENT_AWARE); + GST_OBJECT_FLAG_SET (sink, GST_ELEMENT_EVENT_AWARE); } #define parent_class src_parent_class diff --git a/tests/old/testsuite/states/locked.c b/tests/old/testsuite/states/locked.c index 899ce63..aa4a7a7 100644 --- a/tests/old/testsuite/states/locked.c +++ b/tests/old/testsuite/states/locked.c @@ -77,8 +77,8 @@ main (gint argc, gchar * argv[]) g_signal_connect (G_OBJECT (pipeline), "deep_notify", G_CALLBACK (gst_object_default_deep_notify), NULL); - GST_FLAG_SET (fakesrc2, GST_ELEMENT_LOCKED_STATE); - GST_FLAG_SET (fakesink2, GST_ELEMENT_LOCKED_STATE); + GST_OBJECT_FLAG_SET (fakesrc2, GST_ELEMENT_LOCKED_STATE); + GST_OBJECT_FLAG_SET (fakesink2, GST_ELEMENT_LOCKED_STATE); g_print ("play..\n"); gst_element_set_state (pipeline, GST_STATE_PLAYING); @@ -89,8 +89,8 @@ main (gint argc, gchar * argv[]) gst_element_set_state (pipeline, GST_STATE_READY); - GST_FLAG_UNSET (fakesrc2, GST_ELEMENT_LOCKED_STATE); - GST_FLAG_UNSET (fakesink2, GST_ELEMENT_LOCKED_STATE); + GST_OBJECT_FLAG_UNSET (fakesrc2, GST_ELEMENT_LOCKED_STATE); + GST_OBJECT_FLAG_UNSET (fakesink2, GST_ELEMENT_LOCKED_STATE); g_print ("play..\n"); gst_element_set_state (pipeline, GST_STATE_PLAYING); diff --git a/testsuite/bytestream/filepadsink.c b/testsuite/bytestream/filepadsink.c index b25a63a..0b4769f 100644 --- a/testsuite/bytestream/filepadsink.c +++ b/testsuite/bytestream/filepadsink.c @@ -80,7 +80,7 @@ static GstStaticPadTemplate template = GST_STATIC_PAD_TEMPLATE ("sink", static void gst_fp_sink_init (GstFpSink * fp) { - GST_FLAG_SET (fp, GST_ELEMENT_EVENT_AWARE); + GST_OBJECT_FLAG_SET (fp, GST_ELEMENT_EVENT_AWARE); fp->sinkpad = GST_FILE_PAD (gst_file_pad_new (gst_static_pad_template_get (&template), diff --git a/testsuite/pad/link.c b/testsuite/pad/link.c index 4a7d31e..c38100f 100644 --- a/testsuite/pad/link.c +++ b/testsuite/pad/link.c @@ -68,7 +68,7 @@ gst_test_src_init (GstTestElement * src) } gst_element_add_pad (GST_ELEMENT (src), src->srcpad); - GST_FLAG_SET (src, GST_ELEMENT_EVENT_AWARE); + GST_OBJECT_FLAG_SET (src, GST_ELEMENT_EVENT_AWARE); } static void @@ -101,7 +101,7 @@ gst_test_filter_init (GstTestElement * filter) filter->srcpad = gst_pad_new ("src", GST_PAD_SRC); gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad); - GST_FLAG_SET (filter, GST_ELEMENT_EVENT_AWARE); + GST_OBJECT_FLAG_SET (filter, GST_ELEMENT_EVENT_AWARE); } static void @@ -129,7 +129,7 @@ gst_test_sink_init (GstTestElement * sink) } gst_element_add_pad (GST_ELEMENT (sink), sink->sinkpad); - GST_FLAG_SET (sink, GST_ELEMENT_EVENT_AWARE); + GST_OBJECT_FLAG_SET (sink, GST_ELEMENT_EVENT_AWARE); } #define parent_class src_parent_class diff --git a/testsuite/states/locked.c b/testsuite/states/locked.c index 899ce63..aa4a7a7 100644 --- a/testsuite/states/locked.c +++ b/testsuite/states/locked.c @@ -77,8 +77,8 @@ main (gint argc, gchar * argv[]) g_signal_connect (G_OBJECT (pipeline), "deep_notify", G_CALLBACK (gst_object_default_deep_notify), NULL); - GST_FLAG_SET (fakesrc2, GST_ELEMENT_LOCKED_STATE); - GST_FLAG_SET (fakesink2, GST_ELEMENT_LOCKED_STATE); + GST_OBJECT_FLAG_SET (fakesrc2, GST_ELEMENT_LOCKED_STATE); + GST_OBJECT_FLAG_SET (fakesink2, GST_ELEMENT_LOCKED_STATE); g_print ("play..\n"); gst_element_set_state (pipeline, GST_STATE_PLAYING); @@ -89,8 +89,8 @@ main (gint argc, gchar * argv[]) gst_element_set_state (pipeline, GST_STATE_READY); - GST_FLAG_UNSET (fakesrc2, GST_ELEMENT_LOCKED_STATE); - GST_FLAG_UNSET (fakesink2, GST_ELEMENT_LOCKED_STATE); + GST_OBJECT_FLAG_UNSET (fakesrc2, GST_ELEMENT_LOCKED_STATE); + GST_OBJECT_FLAG_UNSET (fakesink2, GST_ELEMENT_LOCKED_STATE); g_print ("play..\n"); gst_element_set_state (pipeline, GST_STATE_PLAYING); -- 2.7.4