# Gst::Query Class Reference

A class used to perform queries on pads and elements. More...

Inherits Gst::MiniObject.

Inherited by Gst::QueryApplication, Gst::QueryBuffering, Gst::QueryConvert, Gst::QueryDuration, Gst::QueryFormats, Gst::QueryLatency, Gst::QueryPosition, Gst::QuerySeeking, and Gst::QuerySegment.

Collaboration diagram for Gst::Query:
[legend]

List of all members.

## Public Member Functions
virtual | ~Query ()
GstQuery* | gobj ()
| Provides access to the underlying C GstMiniObject.
const GstQuery* | gobj () const
| Provides access to the underlying C GstMiniObject.
GstQuery* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::RefPtr< Gst::Query > | create_writable ()
| Makes a writable query from the given query.
const Gst::Structure | get_structure () const
| Get the structure of a query.
QueryType | get_query_type () const
| Get the Gst::QueryType of the query.
bool | get_details (QueryType type, QueryTypeDefinition& def) const
| Get details about the given Gst::QueryType.
virtual Glib::RefPtr < Gst::MiniObject > | copy_vfunc () const
| Virtual function called when the Gst::Query needs to be copied.
virtual void | finalize_vfunc ()
| Virtual function called when the Gst::Query is about to be finalized.
## Static Public Member Functions
static Glib::RefPtr< Gst::Query > | wrap (GstQuery* query, bool take_copy=false)
| Wrap a GstQuery* in a C++ instance, creating an instance of a derived Gst::Query.
static QueryType | register_query_type (const Glib::ustring& nick, const Glib::ustring& description)
| Create a new GstQueryType based on the nick or return an already registered query with that nick.
static QueryType | get_query_type (const Glib::ustring& nick)
| Get the query type registered with nick.
static bool | query_types_contain (const Glib::ArrayHandle< const QueryType >& types, QueryType type)
| See if the given Gst::QueryType is inside the types query types array.
static Gst::IteratorBasic < const Gst::QueryTypeDefinition > | iterate_definitions ()
| Get a Gst::IteratorBasic of all the registered query types.

## Detailed Description

A class used to perform queries on pads and elements.

Queries can be created using the derived Gst::Query classes create() methods. Query values can be set using derived classes set() methods, and parsed using derived classes parse() methods.

New query types may also be registered to the GStreamer core using register_query_type().

The following example shows how to query the duration of a pipeline:

     Glib::RefPtr<Gst::Query> query = Gst::QueryDuration::create(Gst::FORMAT_TIME);
     bool res = pipeline->query(query);
     if(res)
     {
      gint64 duration = query.parse();
      ...
     }

## Constructor & Destructor Documentation

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

## Member Function Documentation

virtual Glib::RefPtr<Gst::MiniObject> Gst::Query::copy_vfunc | ( |  | ) | const`[virtual]`

Virtual function called when the Gst::Query needs to be copied.

Reimplemented from Gst::MiniObject.

Glib::RefPtr<Gst::Query> Gst::Query::create_writable | ( |  | ) |

Makes a writable query from the given query.

Does exactly what Gst::MiniObject::create_writable() does for the Gst::Query.

Returns:
  A Gst::Query (possibly the same pointer) that is writable.

Reimplemented from Gst::MiniObject.

virtual void Gst::Query::finalize_vfunc | ( |  | ) | `[virtual]`

Virtual function called when the Gst::Query is about to be finalized.

Reimplemented from Gst::MiniObject.

bool Gst::Query::get_details | ( | QueryType | type,
|  | QueryTypeDefinition& | def |
| ) |  |  | const

Get details about the given Gst::QueryType.

Parameters:

  | type | A Gst::QueryType.
  | def | A Gst::QueryTypeDefinition in which to store the details.

Returns:
  true if successful, false otherwise.

static QueryType Gst::Query::get_query_type | ( | const Glib::ustring & | nick | ) | `[static]`

Get the query type registered with nick.

Parameters:

  | nick | The nick of the query.

Returns:
  The query registered with nick or Gst::QUERY_NONE if the query was not registered.

QueryType Gst::Query::get_query_type | ( |  | ) | const

Get the Gst::QueryType of the query.

const Gst::Structure Gst::Query::get_structure | ( |  | ) | const

Get the structure of a query.

Returns:
  The Gst::Structure of the query. The structure is still owned by the query and will therefore be freed when the query is unreffed.

const GstQuery* Gst::Query::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GstMiniObject.

Reimplemented from Gst::MiniObject.

GstQuery* Gst::Query::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GstMiniObject.

Reimplemented from Gst::MiniObject.

GstQuery* Gst::Query::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::MiniObject.

static Gst::IteratorBasic<const Gst::QueryTypeDefinition> Gst::Query::iterate_definitions | ( |  | ) | `[static]`

Get a Gst::IteratorBasic of all the registered query types.

The definitions iterated over are read only.

Returns:
  A Gst::IteratorBasic of Gst::QueryTypeDefinition.

static bool Gst::Query::query_types_contain | ( | const Glib::ArrayHandle< const QueryType >& | types,
|  | QueryType | type |
| ) |  |  | `[static]`

See if the given Gst::QueryType is inside the types query types array.

Parameters:

  | type | The Gst::QueryType to find.

Returns:
  `true` if the type is found inside the array.

static QueryType Gst::Query::register_query_type | ( | const Glib::ustring & | nick,
|  | const Glib::ustring & | description |
| ) |  |  | `[static]`

Create a new GstQueryType based on the nick or return an already registered query with that nick.

Parameters:

  | nick | The nick of the new query.
  | description | The description of the new query.

Returns:
  A new GstQueryType or an already registered query with the same nick.

Glib::RefPtr< Gst::Query > wrap | ( | GstQuery * | query,
|  | bool | take_copy = `false` |
| ) |  |  | `[static]`

Wrap a GstQuery* in a C++ instance, creating an instance of a derived Gst::Query.

Gst::wrap() would just create a Gst::Query (rather than a derived one) because the derived Gst::Query classes do not correspond to GType types in the GStreamer API.

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/query.h