Public Types | Public Member Functions | Protected Member Functions | Related Functions

# Gst::Index Class Reference

A class that generates a stream index of one or more elements in a pipeline. More...

Inheritance diagram for Gst::Index:
[legend]
Collaboration diagram for Gst::Index:
[legend]

List of all members.

## 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 | get_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 Glib::ArrayHandle< 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, gint64 value, IndexLookupMethod method=Gst::INDEX_LOOKUP_EXACT, AssocFlags flags=Gst::ASSOCIATION_FLAG_NONE, Format format=Gst::FORMAT_DEFAULT) 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::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.
Glib::SignalProxy1< void, const Gst::IndexEntry& > | signal_entry_added ()
| Emitted when a new entry is added to the index.
virtual bool | get_writer_id_vfunc (int& writer_id, const Glib::ustring& writer_string) const
virtual void | commit_vfunc (gint id)
virtual void | add_entry_vfunc (Gst::IndexEntry& entry)
## 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.

## Detailed Description

A class that generates a stream index of one or more elements in a pipeline.

## Member Typedef Documentation

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.

## Constructor & Destructor Documentation

virtual Gst::Index::~Index | ( | ) | `[virtual]`

Gst::Index::Index | ( | ) | `[protected]`

## Member Function Documentation

Gst::IndexEntry Gst::Index::add_association | ( | int | id,
|  | AssocFlags | flags,
|  | int | n,
|  | const Glib::ArrayHandle< const Gst::IndexAssociation >& | list
| ) |  |

Associate given format/value pairs with each other.

Parameters:

  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.

virtual void Gst::Index::add_entry_vfunc | ( | Gst::IndexEntry& | entry ) | `[virtual]`

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.

Parameters:

  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.

Gst::IndexEntry Gst::Index::add_id | ( | int | id,
|  | const Glib::ustring & | description
| ) |  |

Add an id entry into the index.

Parameters:

  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.

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.

Parameters:

  id | The writer that commited the index.

virtual void Gst::Index::commit_vfunc | ( | gint | id ) | `[virtual]`

Gst::IndexEntry Gst::Index::get_assoc_entry | ( | int | id,
|  | gint64 | value,
|  | IndexLookupMethod | method = `Gst::INDEX_LOOKUP_EXACT`,
|  | AssocFlags | flags = `Gst::ASSOCIATION_FLAG_NONE`,
|  | Format | format = `Gst::FORMAT_DEFAULT`
| ) |  | const

Finds the given format/value in the index.

Parameters:

  id | The id of the index writer.
  value | The value to find.
  method | The lookup method to use.
  flags | Flags for the entry.
  format | The format of the value.

Returns:
  The entry associated with the value or 0 if the value was not found.

IndexCertainty Gst::Index::get_certainty | ( | ) | const

Get the certainty of the given index.

Returns:
  The certainty of the index.

int Gst::Index::get_group | ( | ) | const

Get the id of the current group.

Returns:
  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.

Parameters:

  writer | The GstObject to allocate an id for.
  id | A pointer to a `int` to hold the id.

Returns:
  `true` if the writer would be mapped to an id.

virtual bool Gst::Index::get_writer_id_vfunc | ( | int & | writer_id,
|  | const Glib::ustring & | writer_string
| ) |  | const`[virtual]`

const GstIndex* Gst::Index::gobj | ( | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gst::Object.

GstIndex* Gst::Index::gobj | ( | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gst::Object.

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.

Returns:
  true if index is readable, false otherwise.

bool Gst::Index::is_writable | ( | ) | const

Check if the index can be written to.

Returns:
  true if index is writable, false otherwise.

int Gst::Index::new_group | ( | ) |

Create a new group for the given index.

It will be set as the current group.

Returns:
  The id of the newly created group.

virtual void Gst::Index::on_entry_added | ( | const Gst::IndexEntry& | entry ) | `[protected, virtual]`

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.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

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.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

void Gst::Index::set_certainty | ( | IndexCertainty | certainty ) |

Set the certainty of the given index.

Parameters:

  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.

Parameters:

  slot | The filter slot to register.

bool Gst::Index::set_group | ( | int | group_number ) |

Set the current groupnumber to the given argument.

Parameters:

  groupnum | The groupnumber to set.

Returns:
  `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.

Parameters:

  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.

Prototype:
  `void on_my_entry_added(const Gst::IndexEntry& entry)`

## Friends And Related Function Documentation

Glib::RefPtr< Gst::Index > wrap | ( | GstIndex * | object,
|  | bool | take_copy = `false`
| ) |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  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.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gstreamermm/index.h