mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
element: add indexable flag
Remove the is_indexable method check and use an element flag to check if the element can use an index.
This commit is contained in:
parent
42a380a175
commit
1754ee91ad
4 changed files with 5 additions and 25 deletions
|
@ -548,28 +548,6 @@ gst_element_get_start_time (GstElement * element)
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue