Next: , Previous: GstIndexFactory, Up: Top


18 GstIndex

Generate indexes on objects

18.1 Overview

GstIndex is used to generate a stream index of one or more elements in a pipeline.

18.2 Usage

— Class: <gst-index>

This <gobject> class defines the following properties:

resolver
Select a predefined object to string mapper
— Signal on <gst-index>: entry-added (arg0 <gst-index-entry>)

Is emitted when a new entry is added to the index.

— Function: gst-index-new   (ret <gst-index>)

Create a new tileindex object

ret
a new index object
— Function: gst-index-commit (self <gst-index>) (id int)
— Method: commit

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.

index
the index to commit
id
the writer that commited the index
— Function: gst-index-get-group (self <gst-index>)   (ret int)
— Method: get-group

Get the id of the current group.

index
the index to get the current group from
ret
the id of the current group.
— Function: gst-index-new-group (self <gst-index>)   (ret int)
— Method: new-group

Create a new group for the given index. It will be set as the current group.

index
the index to create the new group in
ret
the id of the newly created group.
— Function: gst-index-set-group (self <gst-index>) (groupnum int)   (ret bool)
— Method: set-group

Set the current groupnumber to the given argument.

index
the index to set the new group in
groupnum
the groupnumber to set
ret
TRUE if the operation succeeded, FALSE if the group did not exist.
— Function: gst-index-set-certainty (self <gst-index>) (certainty <gst-index-certainty>)
— Method: set-certainty

Set the certainty of the given index.

index
the index to set the certainty on
certainty
the certainty to set
— Function: gst-index-get-certainty (self <gst-index>)   (ret <gst-index-certainty>)
— Method: get-certainty

Get the certainty of the given index.

index
the index to get the certainty of
ret
the certainty of the index.
— Function: gst-index-set-filter-full (self <gst-index>) (filter <gst-index-filter>) (user_data <gpointer>) (user_data_destroy <g-destroy-notify>)
— Method: set-filter-full

Lets the app register a custom filter function so that it can select what entries should be stored in the index.

index
the index to register the filter on
filter
the filter to register
user-data
data passed to the filter function
user-data-destroy
function to call when user-data is unset
— Function: gst-index-get-writer-id (self <gst-index>) (writer <gst-object>)   (ret bool) (id int)
— Method: get-writer-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.

index
the index to get a unique write id for
writer
the GstObject to allocate an id for
id
a pointer to a gint to hold the id
ret
TRUE if the writer would be mapped to an id.
— Function: gst-index-add-format (self <gst-index>) (id int) (format <gst-format>)   (ret <gst-index-entry*>)
— Method: add-format

Adds a format entry into the index. This function is used to map dynamic GstFormat ids to their original format key.

index
the index to add the entry to
id
the id of the index writer
format
the format to add to the index
ret
a pointer to the newly added entry in the index.
— Function: gst-index-add-associationv (self <gst-index>) (id int) (flags <gst-assoc-flags>) (int) (list <gst-index-association*>)   (ret <gst-index-entry*>)
— Method: add-associationv

Associate given format/value pairs with each other.

index
the index to add the entry to
id
the id of the index writer
flags
optinal flags for this entry
n
number of associations
list
list of associations
ret
a pointer to the newly added entry in the index.
— Function: gst-index-add-object (self <gst-index>) (id int) (key mchars) (type <gtype>) (object <gpointer>)   (ret <gst-index-entry*>)
— Method: add-object

Add the given object to the index with the given key.

This function is not yet implemented.

index
the index to add the object to
id
the id of the index writer
key
a key for the object
type
the GType of the object
object
a pointer to the object to add
ret
a pointer to the newly added entry in the index.
— Function: gst-index-add-id (self <gst-index>) (id int) (description mchars)   (ret <gst-index-entry*>)
— Method: add-id

Add an id entry into the index.

index
the index to add the entry to
id
the id of the index writer
description
the description of the index writer
ret
a pointer to the newly added entry in the index.
— Function: gst-index-get-assoc-entry (self <gst-index>) (id int) (method <gst-index-lookup-method>) (flags <gst-assoc-flags>) (format <gst-format>) (value int64)   (ret <gst-index-entry*>)
— Method: get-assoc-entry

Finds the given format/value in the index

index
the index to search
id
the id of the index writer
method
The lookup method to use
flags
Flags for the entry
format
the format of the value
value
the value to find
ret
the entry associated with the value or NULL if the value was not found.
— Function: gst-index-get-assoc-entry-full (self <gst-index>) (id int) (method <gst-index-lookup-method>) (flags <gst-assoc-flags>) (format <gst-format>) (value int64) (func <g-compare-data-func>) (user_data <gpointer>)   (ret <gst-index-entry*>)
— Method: get-assoc-entry-full

Finds the given format/value in the index with the given compare function and user_data.

index
the index to search
id
the id of the index writer
method
The lookup method to use
flags
Flags for the entry
format
the format of the value
value
the value to find
func
the function used to compare entries
user-data
user data passed to the compare function
ret
the entry associated with the value or NULL if the value was not found.
— Function: gst-index-entry-assoc-map (self <gst-index-entry*>) (format <gst-format>)   (ret bool) (value int64)

Gets alternative formats associated with the indexentry.

entry
the index to search
format
the format of the value the find
value
a pointer to store the value
ret
TRUE if there was a value associated with the given format.