element: add indexable flag
authorWim Taymans <wim.taymans@collabora.co.uk>
Mon, 28 Nov 2011 17:12:34 +0000 (18:12 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Mon, 28 Nov 2011 17:13:27 +0000 (18:13 +0100)
Remove the is_indexable method check and use an element flag to check if the
element can use an index.

gst/gstelement.c
gst/gstelement.h
tools/gst-inspect.c
win32/common/libgstreamer.def

index 086a160..ce5275f 100644 (file)
@@ -549,28 +549,6 @@ gst_element_get_start_time (GstElement * element)
 }
 
 /**
- * gst_element_is_indexable:
- * @element: a #GstElement.
- *
- * Queries if the element can be indexed.
- *
- * Returns: TRUE if the element can be indexed.
- *
- * MT safe.
- */
-gboolean
-gst_element_is_indexable (GstElement * element)
-{
-  gboolean result;
-
-  g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
-
-  result = (GST_ELEMENT_GET_CLASS (element)->set_index != NULL);
-
-  return result;
-}
-
-/**
  * gst_element_set_index:
  * @element: a #GstElement.
  * @index: (transfer none): a #GstIndex.
index 396eced..43a064b 100644 (file)
@@ -320,6 +320,9 @@ typedef enum /*< flags=0 >*/
  * @GST_ELEMENT_FLAG_LOCKED_STATE: ignore state changes from parent
  * @GST_ELEMENT_FLAG_SINK: the element is a sink
  * @GST_ELEMENT_FLAG_SOURCE: the element is a source. Since 0.10.31
+ * @GST_ELEMENT_FLAG_PROVIDE_CLOCK: the element can provide a clock
+ * @GST_ELEMENT_FLAG_REQUIRE_CLOCK: the element requires a clock
+ * @GST_ELEMENT_FLAG_INDEXABLE: the element can use an index
  * @GST_ELEMENT_FLAG_LAST: offset to define more flags
  *
  * The standard flags that an element may have.
@@ -332,6 +335,7 @@ typedef enum
   GST_ELEMENT_FLAG_SOURCE         = (GST_OBJECT_FLAG_LAST << 3),
   GST_ELEMENT_FLAG_PROVIDE_CLOCK  = (GST_OBJECT_FLAG_LAST << 4),
   GST_ELEMENT_FLAG_REQUIRE_CLOCK  = (GST_OBJECT_FLAG_LAST << 5),
+  GST_ELEMENT_FLAG_INDEXABLE      = (GST_OBJECT_FLAG_LAST << 6),
   /* padding */
   GST_ELEMENT_FLAG_LAST           = (GST_OBJECT_FLAG_LAST << 16)
 } GstElementFlags;
@@ -736,7 +740,6 @@ void                    gst_element_set_start_time      (GstElement *element, Gs
 GstClockTime            gst_element_get_start_time      (GstElement *element);
 
 /* indexes */
-gboolean                gst_element_is_indexable        (GstElement *element);
 void                    gst_element_set_index           (GstElement *element, GstIndex *index);
 GstIndex*               gst_element_get_index           (GstElement *element);
 
index 89d9685..a932a05 100644 (file)
@@ -696,7 +696,7 @@ print_clocking_info (GstElement * element)
 static void
 print_index_info (GstElement * element)
 {
-  if (gst_element_is_indexable (element)) {
+  if (GST_OBJECT_FLAG_IS_SET (element, GST_ELEMENT_FLAG_INDEXABLE)) {
     n_print ("\n");
     n_print ("Indexing capabilities:\n");
     n_print ("  element can do indexing\n");
index 9b59285..4677626 100644 (file)
@@ -352,7 +352,6 @@ EXPORTS
        gst_element_get_state
        gst_element_get_static_pad
        gst_element_get_type
-       gst_element_is_indexable
        gst_element_is_locked_state
        gst_element_iterate_pads
        gst_element_iterate_sink_pads