![]() |
![]() |
![]() |
GStreamer 0.10 Core Reference Manual | ![]() |
---|---|---|---|---|
#include <gst/gst.h> GstIndex; GstIndexEntry; GstIndexGroup; enum GstIndexCertainty; enum GstIndexEntryType; enum GstIndexLookupMethod; #define GST_INDEX_NASSOCS (entry) #define GST_INDEX_ASSOC_FLAGS (entry) #define GST_INDEX_ASSOC_FORMAT (entry,i) #define GST_INDEX_ASSOC_VALUE (entry,i) GstIndexAssociation; enum GstAssocFlags; #define GST_INDEX_FORMAT_FORMAT (entry) #define GST_INDEX_FORMAT_KEY (entry) #define GST_INDEX_ID_INVALID #define GST_INDEX_ID_DESCRIPTION (entry) gboolean (*GstIndexFilter) (GstIndex *index, GstIndexEntry *entry, gpointer user_data); enum GstIndexResolverMethod; gboolean (*GstIndexResolver) (GstIndex *index, GstObject *writer, gchar **writer_string, gpointer user_data); enum GstIndexFlags; #define GST_INDEX_IS_READABLE (obj) #define GST_INDEX_IS_WRITABLE (obj) GstIndex* gst_index_new (void); void gst_index_commit (GstIndex *index, gint id); gint gst_index_get_group (GstIndex *index); gint gst_index_new_group (GstIndex *index); gboolean gst_index_set_group (GstIndex *index, gint groupnum); void gst_index_set_certainty (GstIndex *index, GstIndexCertainty certainty); GstIndexCertainty gst_index_get_certainty (GstIndex *index); void gst_index_set_filter (GstIndex *index, GstIndexFilter filter, gpointer user_data); void gst_index_set_filter_full (GstIndex *index, GstIndexFilter filter, gpointer user_data, GDestroyNotify user_data_destroy); void gst_index_set_resolver (GstIndex *index, GstIndexResolver resolver, gpointer user_data); gboolean gst_index_get_writer_id (GstIndex *index, GstObject *writer, gint *id); GstIndexEntry* gst_index_add_format (GstIndex *index, gint id, GstFormat format); GstIndexEntry* gst_index_add_association (GstIndex *index, gint id, GstAssocFlags flags, GstFormat format, gint64 value, ...); GstIndexEntry* gst_index_add_associationv (GstIndex *index, gint id, GstAssocFlags flags, gint n, const GstIndexAssociation *list); GstIndexEntry* gst_index_add_object (GstIndex *index, gint id, gchar *key, GType type, gpointer object); GstIndexEntry* gst_index_add_id (GstIndex *index, gint id, gchar *description); GstIndexEntry* gst_index_get_assoc_entry (GstIndex *index, gint id, GstIndexLookupMethod method, GstAssocFlags flags, GstFormat format, gint64 value); GstIndexEntry* gst_index_get_assoc_entry_full (GstIndex *index, gint id, GstIndexLookupMethod method, GstAssocFlags flags, GstFormat format, gint64 value, GCompareDataFunc func, gpointer user_data); GstIndexEntry* gst_index_entry_copy (GstIndexEntry *entry); void gst_index_entry_free (GstIndexEntry *entry); gboolean gst_index_entry_assoc_map (GstIndexEntry *entry, GstFormat format, gint64 *value);
"entry-added" void user_function (GstIndex *gstindex, GstIndexEntry *arg1, gpointer user_data) : Run last
typedef enum { GST_INDEX_UNKNOWN, GST_INDEX_CERTAIN, GST_INDEX_FUZZY } GstIndexCertainty;
The certainty of a group in the index.
GST_INDEX_UNKNOWN
GST_INDEX_UNKNOWN
accuracy is not known
accuracy is not known
GST_INDEX_CERTAIN
GST_INDEX_CERTAIN
accuracy is perfect
accuracy is perfect
GST_INDEX_FUZZY
GST_INDEX_FUZZY
accuracy is fuzzy
accuracy is fuzzy
GST_INDEX_UNKNOWN |
accuracy is not known |
GST_INDEX_CERTAIN |
accuracy is perfect |
GST_INDEX_FUZZY |
accuracy is fuzzy |
typedef enum { GST_INDEX_ENTRY_ID, GST_INDEX_ENTRY_ASSOCIATION, GST_INDEX_ENTRY_OBJECT, GST_INDEX_ENTRY_FORMAT } GstIndexEntryType;
The different types of entries in the index.
GST_INDEX_ENTRY_ID
GST_INDEX_ENTRY_ID
This entry is an id that maps an index id to its owner object
This entry is an id that maps an index id to its owner object
GST_INDEX_ENTRY_ASSOCIATION
GST_INDEX_ENTRY_ASSOCIATION
This entry is an association between formats
This entry is an association between formats
GST_INDEX_ENTRY_OBJECT
GST_INDEX_ENTRY_OBJECT
An object
An object
GST_INDEX_ENTRY_FORMAT
GST_INDEX_ENTRY_FORMAT
A format definition
A format definition
typedef enum { GST_INDEX_LOOKUP_EXACT, GST_INDEX_LOOKUP_BEFORE, GST_INDEX_LOOKUP_AFTER } GstIndexLookupMethod;
Specify the method to find an index entry in the index.
GST_INDEX_LOOKUP_EXACT
GST_INDEX_LOOKUP_EXACT
There has to be an exact indexentry with the given format/value
There has to be an exact indexentry with the given format/value
GST_INDEX_LOOKUP_BEFORE
GST_INDEX_LOOKUP_BEFORE
The exact entry or the one before it
The exact entry or the one before it
GST_INDEX_LOOKUP_AFTER
GST_INDEX_LOOKUP_AFTER
The exact entry or the one after it
The exact entry or the one after it
#define GST_INDEX_NASSOCS(entry) ((entry)->data.assoc.nassocs)
Get the number of associations in the entry.
entry
:entry
The entry to query
The entry to query
entry : |
The entry to query |
#define GST_INDEX_ASSOC_FLAGS(entry) ((entry)->data.assoc.flags)
Get the flags for this entry.
entry
:entry
The entry to query
The entry to query
entry : |
The entry to query |
#define GST_INDEX_ASSOC_FORMAT(entry,i) ((entry)->data.assoc.assocs[(i)].format)
Get the i-th format of the entry.
entry
:entry
The entry to query
The entry to query
i
:i
The format index
The format index
entry : |
The entry to query |
i : |
The format index |
#define GST_INDEX_ASSOC_VALUE(entry,i) ((entry)->data.assoc.assocs[(i)].value)
Get the i-th value of the entry.
entry
:entry
The entry to query
The entry to query
i
:i
The value index
The value index
entry : |
The entry to query |
i : |
The value index |
typedef struct { GstFormat format; gint64 value; } GstIndexAssociation;
An association in an entry.
typedef enum { GST_ASSOCIATION_FLAG_NONE = 0, GST_ASSOCIATION_FLAG_KEY_UNIT = (1 << 0), GST_ASSOCIATION_FLAG_DELTA_UNIT = (1 << 1), /* new flags should start here */ GST_ASSOCIATION_FLAG_LAST = (1 << 8) } GstAssocFlags;
Flags for an association entry.
GST_ASSOCIATION_FLAG_NONE
GST_ASSOCIATION_FLAG_NONE
no extra flags
no extra flags
GST_ASSOCIATION_FLAG_KEY_UNIT
GST_ASSOCIATION_FLAG_KEY_UNIT
the entry marks a key unit, a key unit is one
that marks a place where one can randomly seek to.
the entry marks a key unit, a key unit is one
that marks a place where one can randomly seek to.
GST_ASSOCIATION_FLAG_DELTA_UNIT
GST_ASSOCIATION_FLAG_DELTA_UNIT
the entry marks a delta unit, a delta unit
is one that marks a place where one can relatively seek to.
the entry marks a delta unit, a delta unit
is one that marks a place where one can relatively seek to.
GST_ASSOCIATION_FLAG_LAST
GST_ASSOCIATION_FLAG_LAST
extra user defined flags should start here.
extra user defined flags should start here.
#define GST_INDEX_FORMAT_FORMAT(entry) ((entry)->data.format.format)
Get the format of the format entry
entry
:entry
The entry to query
The entry to query
entry : |
The entry to query |
#define GST_INDEX_FORMAT_KEY(entry) ((entry)->data.format.key)
Get the key of the format entry
entry
:entry
The entry to query
The entry to query
entry : |
The entry to query |
#define GST_INDEX_ID_DESCRIPTION(entry) ((entry)->data.id.description)
Get the description of the id entry
entry
:entry
The entry to query
The entry to query
entry : |
The entry to query |
gboolean (*GstIndexFilter) (GstIndex *index, GstIndexEntry *entry, gpointer user_data);
Function to filter out entries in the index.
index
:index
The index being queried
The index being queried
entry
:entry
The entry to be added.
The entry to be added.
user_data
:user_data
User data passed to the function.
User data passed to the function.
Returns :Returns This function should return TRUE
if the entry is to be added
to the index, FALSE
otherwise.
This function should return TRUE
if the entry is to be added
to the index, FALSE
otherwise.
TRUE
TRUE
FALSE
FALSE
index : |
The index being queried |
entry : |
The entry to be added. |
user_data : |
User data passed to the function. |
Returns : | This function should return TRUE if the entry is to be added
to the index, FALSE otherwise.
|
typedef enum { GST_INDEX_RESOLVER_CUSTOM, GST_INDEX_RESOLVER_GTYPE, GST_INDEX_RESOLVER_PATH } GstIndexResolverMethod;
The method used to resolve index writers
GST_INDEX_RESOLVER_CUSTOM
GST_INDEX_RESOLVER_CUSTOM
Use a custom resolver
Use a custom resolver
GST_INDEX_RESOLVER_GTYPE
GST_INDEX_RESOLVER_GTYPE
Resolve based on the GType of the object
Resolve based on the GType of the object
GST_INDEX_RESOLVER_PATH
GST_INDEX_RESOLVER_PATH
Resolve on the path in graph
Resolve on the path in graph
GST_INDEX_RESOLVER_CUSTOM |
Use a custom resolver |
GST_INDEX_RESOLVER_GTYPE |
Resolve based on the GType of the object |
GST_INDEX_RESOLVER_PATH |
Resolve on the path in graph |
gboolean (*GstIndexResolver) (GstIndex *index, GstObject *writer, gchar **writer_string, gpointer user_data);
Function to resolve ids to writer descriptions.
index
:index
the index being queried.
the index being queried.
writer
:writer
The object that wants to write
The object that wants to write
writer_string
:writer_string
A description of the writer.
A description of the writer.
user_data
:user_data
user_data as registered
user_data as registered
Returns :Returns TRUE
if an id could be assigned to the writer.
TRUE
if an id could be assigned to the writer.
TRUE
TRUE
index : |
the index being queried. |
writer : |
The object that wants to write |
writer_string : |
A description of the writer. |
user_data : |
user_data as registered |
Returns : | TRUE if an id could be assigned to the writer.
|
typedef enum { 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) } GstIndexFlags;
Flags for this index
GST_INDEX_WRITABLE
GST_INDEX_WRITABLE
The index is writable
The index is writable
GST_INDEX_READABLE
GST_INDEX_READABLE
The index is readable
The index is readable
GST_INDEX_FLAG_LAST
GST_INDEX_FLAG_LAST
First flag that can be used by subclasses
First flag that can be used by subclasses
GST_INDEX_WRITABLE |
The index is writable |
GST_INDEX_READABLE |
The index is readable |
GST_INDEX_FLAG_LAST |
First flag that can be used by subclasses |
#define GST_INDEX_IS_READABLE(obj) (GST_OBJECT_FLAG_IS_SET (obj, GST_INDEX_READABLE))
Check if the index can be read from
obj
:obj
The index to check
The index to check
obj : |
The index to check |
#define GST_INDEX_IS_WRITABLE(obj) (GST_OBJECT_FLAG_IS_SET (obj, GST_INDEX_WRITABLE))
Check if the index can be written to
obj
:obj
The index to check
The index to check
obj : |
The index to check |
GstIndex* gst_index_new (void);
Create a new tileindex object
Returns : | a new index object |
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.
index
:index
the index to commit
the index to commit
id
:id
the writer that commited the index
the writer that commited the index
index : |
the index to commit |
id : |
the writer that commited the index |
gint gst_index_get_group (GstIndex *index);
Get the id of the current group.
index
:index
the index to get the current group from
the index to get the current group from
Returns :Returns the id of the current group.
the id of the current group.
index : |
the index to get the current group from |
Returns : | the id of the current group. |
gint gst_index_new_group (GstIndex *index);
Create a new group for the given index. It will be set as the current group.
index
:index
the index to create the new group in
the index to create the new group in
Returns :Returns the id of the newly created group.
the id of the newly created group.
index : |
the index to create the new group in |
Returns : | the id of the newly created group. |
gboolean gst_index_set_group (GstIndex *index, gint groupnum);
Set the current groupnumber to the given argument.
index
:index
the index to set the new group in
the index to set the new group in
groupnum
:groupnum
the groupnumber to set
the groupnumber to set
Returns :Returns TRUE if the operation succeeded, FALSE if the group
did not exist.
TRUE if the operation succeeded, FALSE if the group
did not exist.
index : |
the index to set the new group in |
groupnum : |
the groupnumber to set |
Returns : | TRUE if the operation succeeded, FALSE if the group did not exist. |
void gst_index_set_certainty (GstIndex *index, GstIndexCertainty certainty);
Set the certainty of the given index.
index
:index
the index to set the certainty on
the index to set the certainty on
certainty
:certainty
the certainty to set
the certainty to set
index : |
the index to set the certainty on |
certainty : |
the certainty to set |
GstIndexCertainty gst_index_get_certainty (GstIndex *index);
Get the certainty of the given index.
index
:index
the index to get the certainty of
the index to get the certainty of
Returns :Returns the certainty of the index.
the certainty of the index.
index : |
the index to get the certainty of |
Returns : | the certainty of the 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.
index
:index
the index to register the filter on
the index to register the filter on
filter
:filter
the filter to register
the filter to register
user_data
:user_data
data passed to the filter function
data passed to the filter function
index : |
the index to register the filter on |
filter : |
the filter to register |
user_data : |
data passed to the filter function |
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.
index
:index
the index to register the filter on
the index to register the filter on
filter
:filter
the filter to register
the filter to register
user_data
:user_data
data passed to the filter function
data passed to the filter function
user_data_destroy
:user_data_destroy
function to call when user_data
is unset
function to call when user_data
is unset
user_data
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
|
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.
index
:index
the index to register the resolver on
the index to register the resolver on
resolver
:resolver
the resolver to register
the resolver to register
user_data
:user_data
data passed to the resolver function
data passed to the resolver function
index : |
the index to register the resolver on |
resolver : |
the resolver to register |
user_data : |
data passed to the resolver function |
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.
index
:index
the index to get a unique write id for
the index to get a unique write id for
writer
:writer
the GstObject to allocate an id for
the GstObject to allocate an id for
id
:id
a pointer to a gint to hold the id
a pointer to a gint to hold the id
Returns :Returns TRUE if the writer would be mapped to an id.
TRUE if the writer would be mapped to an id.
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 |
Returns : | TRUE if the writer would be mapped to an id. |
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.
index
:index
the index to add the entry to
the index to add the entry to
id
:id
the id of the index writer
the id of the index writer
format
:format
the format to add to the index
the format to add to the index
Returns :Returns a pointer to the newly added entry in the index.
a pointer to the newly added entry in the index.
index : |
the index to add the entry to |
id : |
the id of the index writer |
format : |
the format to add to the index |
Returns : | a pointer to the newly added entry in the index. |
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.
index
:index
the index to add the entry to
the index to add the entry to
id
:id
the id of the index writer
the id of the index writer
flags
:flags
optinal flags for this entry
optinal flags for this entry
format
:format
the format of the value
the format of the value
value
:value
the value
the value
...
:...
other format/value pairs or 0 to end the list
other format/value pairs or 0 to end the list
Returns :Returns a pointer to the newly added entry in the index.
a pointer to the newly added entry in the index.
index : |
the index to add the entry to |
id : |
the id of the index writer |
flags : |
optinal flags for this entry |
format : |
the format of the value |
value : |
the value |
... : |
other format/value pairs or 0 to end the list |
Returns : | a pointer to the newly added entry in the index. |
GstIndexEntry* gst_index_add_associationv (GstIndex *index, gint id, GstAssocFlags flags, gint n, const GstIndexAssociation *list);
Associate given format/value pairs with each other.
index
:index
the index to add the entry to
the index to add the entry to
id
:id
the id of the index writer
the id of the index writer
flags
:flags
optinal flags for this entry
optinal flags for this entry
n
:n
number of associations
number of associations
list
:list
list of associations
list of associations
Returns :Returns a pointer to the newly added entry in the index.
a pointer to the newly added entry in the index.
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 |
Returns : | a pointer to the newly added entry in the index. |
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.
index
:index
the index to add the object to
the index to add the object to
id
:id
the id of the index writer
the id of the index writer
key
:key
a key for the object
a key for the object
type
:type
the GType of the object
the GType of the object
object
:object
a pointer to the object to add
a pointer to the object to add
Returns :Returns a pointer to the newly added entry in the index.
a pointer to the newly added entry in the index.
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 |
Returns : | a pointer to the newly added entry in the index. |
GstIndexEntry* gst_index_add_id (GstIndex *index, gint id, gchar *description);
Add an id entry into the index.
index
:index
the index to add the entry to
the index to add the entry to
id
:id
the id of the index writer
the id of the index writer
description
:description
the description of the index writer
the description of the index writer
Returns :Returns a pointer to the newly added entry in the index.
a pointer to the newly added entry in the index.
index : |
the index to add the entry to |
id : |
the id of the index writer |
description : |
the description of the index writer |
Returns : | a pointer to the newly added entry in 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
index
:index
the index to search
the index to search
id
:id
the id of the index writer
the id of the index writer
method
:method
The lookup method to use
The lookup method to use
flags
:flags
Flags for the entry
Flags for the entry
format
:format
the format of the value
the format of the value
value
:value
the value to find
the value to find
Returns :Returns the entry associated with the value or NULL if the
value was not found.
the entry associated with the value or NULL if the
value was not found.
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 |
Returns : | the entry associated with the value or NULL if the value was not found. |
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.
index
:index
the index to search
the index to search
id
:id
the id of the index writer
the id of the index writer
method
:method
The lookup method to use
The lookup method to use
flags
:flags
Flags for the entry
Flags for the entry
format
:format
the format of the value
the format of the value
value
:value
the value to find
the value to find
func
:func
the function used to compare entries
the function used to compare entries
user_data
:user_data
user data passed to the compare function
user data passed to the compare function
Returns :Returns the entry associated with the value or NULL if the
value was not found.
the entry associated with the value or NULL if the
value was not found.
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 |
Returns : | the entry associated with the value or NULL if the value was not found. |
GstIndexEntry* gst_index_entry_copy (GstIndexEntry *entry);
Copies an entry and returns the result.
entry
:entry
the entry to copy
the entry to copy
Returns :Returns a newly allocated GstIndexEntry.
a newly allocated GstIndexEntry.
GstIndexEntryGstIndexEntry
entry : |
the entry to copy |
Returns : | a newly allocated GstIndexEntry. |
void gst_index_entry_free (GstIndexEntry *entry);
Free the memory used by the given entry.
entry
:entry
the entry to free
the entry to free
entry : |
the entry to free |
gboolean gst_index_entry_assoc_map (GstIndexEntry *entry, GstFormat format, gint64 *value);
Gets alternative formats associated with the indexentry.
entry
:entry
the index to search
the index to search
format
:format
the format of the value the find
the format of the value the find
value
:value
a pointer to store the value
a pointer to store the value
Returns :Returns TRUE if there was a value associated with the given
format.
TRUE if there was a value associated with the given
format.
entry : |
the index to search |
format : |
the format of the value the find |
value : |
a pointer to store the value |
Returns : | TRUE if there was a value associated with the given format. |
resolver
" property"resolver" GstIndexResolver : Read / Write
Select a predefined object to string mapper.
Default value: GST_INDEX_RESOLVER_PATH
void user_function (GstIndex *gstindex, GstIndexEntry *arg1, gpointer user_data) : Run last
Is emitted when a new entry is added to the index.
gstindex
:gstindex
the object which received the signal.
the object which received the signal.
arg1
:arg1
The entry added to the index.
The entry added to the index.
user_data
:user_data
user data set when the signal handler was connected.user data set when the signal handler was connected.
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. |