#include <index.h>
Public Types | |
typedef sigc::slot< bool, const Glib::RefPtr<Gst::Index> &, Gst::IndexEntry > | SlotFilter |
For example, bool on_filter(const Glib::RefPtr<Gst::Index>& index, Gst::IndexEntry entry);. | |
typedef sigc::slot< bool, const Glib::RefPtr<Gst::Index> &, const Glib::RefPtr <Gst::Object> &, Glib::ustring& > | SlotResolver |
For example, bool on_resolve(const Glib::RefPtr<Gst::Object>& writer, Glib::ustring& writer_string);. | |
Public Member Functions | |
virtual | ~Index () |
GstIndex* | gobj () |
Provides access to the underlying C GObject. | |
const GstIndex* | gobj () const |
Provides access to the underlying C GObject. | |
GstIndex* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
bool | is_readable () const |
Check if the index can be read from. | |
bool | is_writable () const |
Check if the index can be written to. | |
void | commit (int 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. | |
int | get_group () const |
Get the id of the current group. | |
int | new_group () |
Create a new group for the given index. | |
bool | set_group (int group_number) |
Set the current groupnumber to the given argument. | |
void | set_certainty (IndexCertainty certainty) |
Set the certainty of the given index. | |
IndexCertainty | set_certainty () const |
Get the certainty of the given index. | |
bool | get_writer_id (const Glib::RefPtr<Gst::Object>& writer, int& id) const |
Before entries can be added to the index, a writer should obtain a unique id. | |
Gst::IndexEntry | add_format (int id, Format format) |
Adds a format entry into the index. | |
Gst::IndexEntry | add_association (int id, AssocFlags flags, int n, const Gst::IndexAssociation& list) |
Associate given format/value pairs with each other. | |
Gst::IndexEntry | add_id (int id, const Glib::ustring& description) |
Add an id entry into the index. | |
Gst::IndexEntry | get_assoc_entry (int id, IndexLookupMethod method, AssocFlags flags, Format format, gint64 value) const |
Finds the given format/value in the index. | |
void | set_filter (const SlotFilter& slot) |
Lets the app register a custom filter slot so that it can select what entries should be stored in the index. | |
void | set_resolver (const SlotResolver& slot) |
Lets the app register a custom slot to map index ids to writer descriptions. | |
Glib::SignalProxy1< void, const Gst::IndexEntry& > | signal_entry_added () |
Emitted when a new entry is added to the index. | |
Glib::PropertyProxy <Gst::Index::SlotResolver> | property_resolver () |
Select a predefined object to string mapper. | |
Glib::PropertyProxy_ReadOnly <Gst::Index::SlotResolver> | property_resolver () const |
Select a predefined object to string mapper. | |
Protected Member Functions | |
Index () | |
virtual void | on_entry_added (const Gst::IndexEntry& entry) |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr<Gst::Index> | wrap (GstIndex* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
typedef sigc::slot<bool, const Glib::RefPtr<Gst::Index>&, Gst::IndexEntry> Gst::Index::SlotFilter |
For example, bool on_filter(const Glib::RefPtr<Gst::Index>& index, Gst::IndexEntry entry);.
The filter function should return true if the entry is to be added to the index, false otherwise.
typedef sigc::slot<bool, const Glib::RefPtr<Gst::Index>&, const Glib::RefPtr<Gst::Object>&, Glib::ustring&> Gst::Index::SlotResolver |
For example, bool on_resolve(const Glib::RefPtr<Gst::Object>& writer, Glib::ustring& writer_string);.
The resolve function should return true if an id could be assigned to writer.
virtual Gst::Index::~Index | ( | ) | [virtual] |
Gst::Index::Index | ( | ) | [protected] |
Gst::IndexEntry Gst::Index::add_association | ( | int | id, | |
AssocFlags | flags, | |||
int | n, | |||
const Gst::IndexAssociation& | list | |||
) |
Associate given format/value pairs with each other.
id | The id of the index writer. | |
flags | Optinal flags for this entry. | |
n | Number of associations. | |
list | List of associations. |
Gst::IndexEntry Gst::Index::add_format | ( | int | id, | |
Format | format | |||
) |
Adds a format entry into the index.
This function is used to map dynamic GstFormat ids to their original format key.
id | The id of the index writer. | |
format | The format to add to the index. |
Gst::IndexEntry Gst::Index::add_id | ( | int | id, | |
const Glib::ustring & | description | |||
) |
Add an id entry into the index.
id | The id of the index writer. | |
description | The description of the index writer. |
void Gst::Index::commit | ( | int | 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.
id | The writer that commited the index. |
Gst::IndexEntry Gst::Index::get_assoc_entry | ( | int | id, | |
IndexLookupMethod | method, | |||
AssocFlags | flags, | |||
Format | format, | |||
gint64 | value | |||
) | const |
Finds the given format/value in the index.
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. |
0
if the value was not found. int Gst::Index::get_group | ( | ) | const |
Get the id of the current group.
bool Gst::Index::get_writer_id | ( | const Glib::RefPtr<Gst::Object>& | writer, | |
int & | id | |||
) | const |
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 | The GstObject to allocate an id for. | |
id | A pointer to a int to hold the id. |
true
if the writer would be mapped to an id. const GstIndex* Gst::Index::gobj | ( | ) | const [inline] |
GstIndex* Gst::Index::gobj | ( | ) | [inline] |
GstIndex* Gst::Index::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Reimplemented from Gst::Object.
bool Gst::Index::is_readable | ( | ) | const |
Check if the index can be read from.
bool Gst::Index::is_writable | ( | ) | const |
Check if the index can be written to.
int Gst::Index::new_group | ( | ) |
Create a new group for the given index.
It will be set as the current group.
virtual void Gst::Index::on_entry_added | ( | const Gst::IndexEntry& | entry | ) | [protected, virtual] |
Glib::PropertyProxy_ReadOnly<Gst::Index::SlotResolver> Gst::Index::property_resolver | ( | ) | const |
Select a predefined object to string mapper.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Gst::Index::SlotResolver> Gst::Index::property_resolver | ( | ) |
Select a predefined object to string mapper.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
IndexCertainty Gst::Index::set_certainty | ( | ) | const |
Get the certainty of the given index.
void Gst::Index::set_certainty | ( | IndexCertainty | certainty | ) |
Set the certainty of the given index.
certainty | The certainty to set. |
void Gst::Index::set_filter | ( | const SlotFilter& | slot | ) |
Lets the app register a custom filter slot so that it can select what entries should be stored in the index.
slot | The filter slot to register. |
bool Gst::Index::set_group | ( | int | group_number | ) |
Set the current groupnumber to the given argument.
groupnum | The groupnumber to set. |
true
if the operation succeeded, false
if the group did not exist. void Gst::Index::set_resolver | ( | const SlotResolver& | slot | ) |
Lets the app register a custom slot to map index ids to writer descriptions.
slot | The resolver slot to register. |
Glib::SignalProxy1<void,const Gst::IndexEntry&> Gst::Index::signal_entry_added | ( | ) |
Emitted when a new entry is added to the index.
void on_my_entry_added(const Gst::IndexEntry& entry)
Glib::RefPtr<Gst::Index> wrap | ( | GstIndex * | object, | |
bool | take_copy = false | |||
) | [related] |
A Glib::wrap() method for this object.
object | The C instance. | |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |