Top | ![]() |
![]() |
![]() |
![]() |
struct | GstIndex |
struct | GstIndexEntry |
struct | GstIndexGroup |
enum | GstIndexCertainty |
enum | GstIndexEntryType |
enum | GstIndexLookupMethod |
struct | GstIndexAssociation |
enum | GstAssocFlags |
#define | GST_INDEX_ID_INVALID |
enum | GstIndexResolverMethod |
enum | GstIndexFlags |
GstIndex is used to generate a stream index of one or more elements in a pipeline.
Elements will overload the set_index and get_index virtual methods in GstElement. When streaming data, the element will add index entries if it has an index set.
Each element that adds to the index will do that using a writer_id. The
writer_id is obtained from gst_index_get_writer_id()
.
The application that wants to index the stream will create a new index object
using gst_index_new()
or gst_index_factory_make()
. The index is assigned to a
specific element, a bin or the whole pipeline. This will cause indexable
elements to add entires to the index while playing.
#define GST_INDEX_NASSOCS(entry) ((entry)->data.assoc.nassocs)
Get the number of associations in the entry.
#define GST_INDEX_ASSOC_FLAGS(entry) ((entry)->data.assoc.flags)
Get the flags for this entry.
#define GST_INDEX_ASSOC_FORMAT(entry,i) ((entry)->data.assoc.assocs[(i)].format)
Get the i-th format of the entry.
#define GST_INDEX_ASSOC_VALUE(entry,i) ((entry)->data.assoc.assocs[(i)].value)
Get the i-th value of the entry.
#define GST_INDEX_FORMAT_FORMAT(entry) ((entry)->data.format.format)
Get the format of the format entry
#define GST_INDEX_FORMAT_KEY(entry) ((entry)->data.format.key)
Get the key of the format entry
#define GST_INDEX_ID_DESCRIPTION(entry) ((entry)->data.id.description)
Get the description of the id entry
gboolean (*GstIndexFilter) (GstIndex *index
,GstIndexEntry *entry
,gpointer user_data
);
Function to filter out entries in the index.
gboolean (*GstIndexResolver) (GstIndex *index
,GstObject *writer
,gchar **writer_string
,gpointer user_data
);
Function to resolve ids to writer descriptions.
#define GST_INDEX_IS_READABLE(obj) (GST_OBJECT_FLAG_IS_SET (obj, GST_INDEX_READABLE))
Check if the index can be read from
#define GST_INDEX_IS_WRITABLE(obj) (GST_OBJECT_FLAG_IS_SET (obj, GST_INDEX_WRITABLE))
Check if the index can be written to
GstIndex *
gst_index_new (void
);
Create a new dummy index object. Use gst_element_set_index()
to assign that
to an element or pipeline. This index is not storing anything, but will
still emit e.g. the “entry-added” signal.
void gst_index_commit (GstIndex *index
,gint id
);
Tell the index that the writer with the given id is done with this index and is not going to write any more entries to it.
gint
gst_index_new_group (GstIndex *index
);
Create a new group for the given index. It will be set as the current group.
gboolean gst_index_set_group (GstIndex *index
,gint groupnum
);
Set the current groupnumber to the given argument.
void gst_index_set_certainty (GstIndex *index
,GstIndexCertainty certainty
);
Set the certainty of the given index.
GstIndexCertainty
gst_index_get_certainty (GstIndex *index
);
Get the certainty of the given index.
void gst_index_set_filter (GstIndex *index
,GstIndexFilter filter
,gpointer user_data
);
Lets the app register a custom filter function so that it can select what entries should be stored in the index.
void gst_index_set_filter_full (GstIndex *index
,GstIndexFilter filter
,gpointer user_data
,GDestroyNotify user_data_destroy
);
Lets the app register a custom filter function so that it can select what entries should be stored in the index.
void gst_index_set_resolver (GstIndex *index
,GstIndexResolver resolver
,gpointer user_data
);
Lets the app register a custom function to map index ids to writer descriptions.
void gst_index_set_resolver_full (GstIndex *index
,GstIndexResolver resolver
,gpointer user_data
,GDestroyNotify user_data_destroy
);
Lets the app register a custom function to map index ids to writer descriptions.
index |
the index to register the resolver on |
|
resolver |
the resolver to register |
|
user_data |
data passed to the resolver function |
|
user_data_destroy |
destroy function for |
Since: 0.10.18
gboolean gst_index_get_writer_id (GstIndex *index
,GstObject *writer
,gint *id
);
Before entries can be added to the index, a writer should obtain a unique id. The methods to add new entries to the index require this id as an argument.
The application can implement a custom function to map the writer object to a string. That string will be used to register or look up an id in the index.
writer
's GST_OBJECT_LOCK, as the default
resolver may call functions that take the object lock as well, and
the lock is not recursive.
GstIndexEntry * gst_index_add_format (GstIndex *index
,gint id
,GstFormat format
);
Adds a format entry into the index. This function is used to map dynamic GstFormat ids to their original format key.
Free-function: gst_index_entry_free
GstIndexEntry * gst_index_add_association (GstIndex *index
,gint id
,GstAssocFlags flags
,GstFormat format
,gint64 value
,...
);
Associate given format/value pairs with each other. Be sure to pass gint64 values to this functions varargs, you might want to use a gint64 cast to be sure.
GstIndexEntry * gst_index_add_associationv (GstIndex *index
,gint id
,GstAssocFlags flags
,gint n
,const GstIndexAssociation *list
);
Associate given format/value pairs with each other.
GstIndexEntry * gst_index_add_object (GstIndex *index
,gint id
,gchar *key
,GType type
,gpointer object
);
Add the given object to the index with the given key.
This function is not yet implemented.
GstIndexEntry * gst_index_add_id (GstIndex *index
,gint id
,gchar *description
);
Add an id entry into the index.
GstIndexEntry * gst_index_get_assoc_entry (GstIndex *index
,gint id
,GstIndexLookupMethod method
,GstAssocFlags flags
,GstFormat format
,gint64 value
);
Finds the given format/value in the index
GstIndexEntry * gst_index_get_assoc_entry_full (GstIndex *index
,gint id
,GstIndexLookupMethod method
,GstAssocFlags flags
,GstFormat format
,gint64 value
,GCompareDataFunc func
,gpointer user_data
);
Finds the given format/value in the index with the given compare function and user_data.
GstIndexEntry *
gst_index_entry_copy (GstIndexEntry *entry
);
Copies an entry and returns the result.
Free-function: gst_index_entry_free
void
gst_index_entry_free (GstIndexEntry *entry
);
Free the memory used by the given entry.
gboolean gst_index_entry_assoc_map (GstIndexEntry *entry
,GstFormat format
,gint64 *value
);
Gets alternative formats associated with the indexentry.
struct GstIndexAssociation { GstFormat format; gint64 value; };
An association in an entry.
Flags for an association entry.
“resolver”
property“resolver” GstIndexResolver
Select a predefined object to string mapper.
Flags: Read / Write
Default value: GST_INDEX_RESOLVER_PATH
“entry-added”
signalvoid user_function (GstIndex *gstindex, GstIndexEntry *arg1, gpointer user_data)
Is emitted when a new entry is added to the index.
gstindex |
the object which received the signal. |
|
arg1 |
The entry added to the index. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last