Gst::Query Class Reference

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

`#include <gstreamermm/query.h>`

Inheritance diagram for Gst::Query:
[legend]

## Public Member Functions

void | reference () const
| Increment the reference count for this object. More...
void | unreference () const
| Decrement the reference count for this object. More...
GstQuery* | gobj ()
| Provides access to the underlying C instance. More...
const GstQuery* | gobj () const
| Provides access to the underlying C instance. More...
GstQuery* | gobj_copy () const
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
| Query ()=delete
| Query (const Query&)=delete
Query& | operator= (const Query&)=delete
Glib::RefPtr< Gst::Query > | create_writable ()
| Makes a writable query from the given query. More...
Gst::Structure | get_structure () const
| Get the structure of a query. More...
QueryType | get_query_type () const
| Get the Gst::QueryType of the query. More...
Glib::RefPtr< Gst::Query > | copy ()
| Copies the given query using the copy function of the parent Gst::Structure. More...
Public Member Functions inherited from Gst::MiniObject
void | reference () const
| Increment the reference count for this object. More...
void | unreference () const
| Decrement the reference count for this object. More...
GstMiniObject* | gobj ()
| Provides access to the underlying C instance. More...
const GstMiniObject* | gobj () const
| Provides access to the underlying C instance. More...
GstMiniObject* | gobj_copy () const
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
| MiniObject ()=delete
| MiniObject (const MiniObject&)=delete
MiniObject& | operator= (const MiniObject&)=delete
| ~MiniObject ()
guint | get_flags () const
void | set_flags (const guint& value)
gint | get_refcount () const
gint | get_lockstate () const
bool | lock (LockFlags flags)
| Lock the mini-object with the specified access mode in flags. More...
void | unlock (LockFlags flags)
| Unlock the mini-object with the specified access mode in flags. More...
bool | is_writable () const
| If mini_object has the LOCKABLE flag set, check if the current EXCLUSIVE lock on object is the only one, this means that changes to the object will not be visible to any other object. More...
Glib::RefPtr< MiniObject > | create_writable ()
| Checks if a mini-object is writable. More...
void | set_qdata (GQuark quark, QuarkData* data)
| This sets an opaque, named pointer on a miniobject. More...
QuarkData* | get_qdata (GQuark quark) const
| This function gets back user data pointers stored via set_qdata(). More...
QuarkData* | steal_qdata (GQuark quark)
| This function gets back user data pointers stored via set_qdata() and removes the data from object without invoking its destroy() function (if any was set). More...
void | add_finalize_notifier (const SlotFinalizer& slot)
| Adds notifier when mini object is finalized. More...
void | remove_finalize_notifier ()
| Remove finalize notifier. More...

## Static Public Member Functions

static Glib::RefPtr< Gst::Query > | create_buffering (Gst::Format format)
| Constructs a new query object for querying the buffering status of a stream. More...
static Glib::RefPtr< Gst::Query > | create_allocation (Glib::RefPtr< Gst::Caps > caps, bool need_pool)
| Constructs a new query object for querying the allocation properties. More...
static Glib::RefPtr< Gst::Query > | create_uri ()
| Constructs a new query URI query object. More...
static Glib::RefPtr< Gst::Query > | create_scheduling ()
| Constructs a new query object for querying the scheduling properties. More...
static Glib::RefPtr< Gst::Query > | create_drain ()
| Constructs a new query object for querying the drain state. More...
static Glib::RefPtr< Gst::Query > | create_custom (Gst::QueryType type, const Gst::Structure& structure)
| Constructs a new custom query object. More...
static Glib::RefPtr< Gst::Query > | create_convert (Gst::Format format, gint64 value, Gst::Format dest_format)
| Constructs a new convert query object. More...
static Glib::RefPtr< Gst::Query > | create_position (Gst::Format format)
| Constructs a new query stream position query object. More...
static Glib::RefPtr< Gst::Query > | create_duration (Gst::Format format)
| Constructs a new stream duration query object to query in the given format. More...
static Glib::RefPtr< Gst::Query > | create_latency ()
| Constructs a new latency query object. More...
static Glib::RefPtr< Gst::Query > | create_seeking (Gst::Format format)
| Constructs a new query object for querying seeking properties of the stream. More...
static Glib::RefPtr< Gst::Query > | create_formats ()
| Constructs a new query object for querying formats of the stream. More...
static Glib::RefPtr< Gst::Query > | create_segment (Gst::Format format)
| Constructs a new segment query object. More...
static Glib::RefPtr< Gst::Query > | create_caps (Glib::RefPtr< Gst::Caps > filter)
| Constructs a new query object for querying the caps. More...
static Glib::RefPtr< Gst::Query > | create_accept_caps (Glib::RefPtr< Gst::Caps > filter)
| Constructs a new query object for querying if filter are accepted. More...

## Protected Member Functions

void | operator delete (void*, std::size_t)
Protected Member Functions inherited from Gst::MiniObject
void | operator delete (void*, std::size_t)

## Static Protected Member Functions

template<class QueryType >
static Glib::RefPtr< QueryType > | wrap (GstQuery* query, bool take_copy=false)

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr< Gst::Query > | wrap (GstQuery* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...
Related Functions inherited from Gst::MiniObject
Glib::RefPtr< Gst::MiniObject > | wrap (GstMiniObject* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Additional Inherited Members

Public Types inherited from Gst::MiniObject
typedef sigc::slot< void > | SlotFinalizer

## Detailed Description

A class used to perform queries on pads and elements.

Queries can be performed on pads (gst_pad_query()) and elements (gst_element_query()). Please note that some queries might need a running pipeline to work.

Queries can be created using the gst_query_new_*() functions. Query values can be set using gst_query_set_*(), and parsed using gst_query_parse_*() helpers.

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 = Glib::RefPtr<Gst::QueryDuration>::cast_dynamic(query)->parse();
...
}

## Constructor & Destructor Documentation

## Query() [1/2]

Gst::Query::Query | ( |  | ) |

delete

## Query() [2/2]

Gst::Query::Query | ( | const Query& |  | ) |

delete

## Member Function Documentation

## copy()

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

Copies the given query using the copy function of the parent Gst::Structure.

Free-function: gst_query_unref

Returns
  A new copy of q.

## create_accept_caps()

static Glib::RefPtr<Gst::Query> Gst::Query::create_accept_caps | ( | Glib::RefPtr< Gst::Caps > | filter | ) |

static

Constructs a new query object for querying if filter are accepted.

Free-function: gst_query_unref

Parameters

  filter | A fixed Gst::Caps.

Returns
  A new Gst::Query.

## create_allocation()

static Glib::RefPtr<Gst::Query> Gst::Query::create_allocation | ( | Glib::RefPtr< Gst::Caps > | caps,
|  | bool | need_pool
| ) |  |

static

Constructs a new query object for querying the allocation properties.

Free-function: gst_query_unref

Parameters

  caps | The negotiated caps.
  need_pool | Return a pool.

Returns
  A new Gst::Query.

## create_buffering()

static Glib::RefPtr<Gst::Query> Gst::Query::create_buffering | ( | Gst::Format | format | ) |

static

Constructs a new query object for querying the buffering status of a stream.

Free-function: gst_query_unref

Parameters

  format | The default Gst::Format for the new query.

Returns
  A new Gst::Query.

## create_caps()

static Glib::RefPtr<Gst::Query> Gst::Query::create_caps | ( | Glib::RefPtr< Gst::Caps > | filter | ) |

static

Constructs a new query object for querying the caps.

The CAPS query should return the allowable caps for a pad in the context of the element's state, its link to other elements, and the devices or files it has opened. These caps must be a subset of the pad template caps. In the `nullptr` state with no links, the CAPS query should ideally return the same caps as the pad template. In rare circumstances, an object property can affect the caps returned by the CAPS query, but this is discouraged.

For most filters, the caps returned by CAPS query is directly affected by the allowed caps on other pads. For demuxers and decoders, the caps returned by the srcpad's getcaps function is directly related to the stream data. Again, the CAPS query should return the most specific caps it reasonably can, since this helps with autoplugging.

The filter is used to restrict the result caps, only the caps matching filter should be returned from the CAPS query. Specifying a filter might greatly reduce the amount of processing an element needs to do.

Free-function: gst_query_unref

Parameters

  filter | A filter.

Returns
  A new Gst::Query.

## create_convert()

static Glib::RefPtr<Gst::Query> Gst::Query::create_convert | ( | Gst::Format | format,
|  | gint64 | value,
|  | Gst::Format | dest_format
| ) |  |

static

Constructs a new convert query object.

Use unref() when done with it. A convert query is used to ask for a conversion between one format and another.

Free-function: gst_query_unref

Parameters

  format | The source Gst::Format for the new query.
  value | The value to convert.
  dest_format | The target Gst::Format.

Returns
  A Gst::Query.

## create_custom()

static Glib::RefPtr<Gst::Query> Gst::Query::create_custom | ( | Gst::QueryType | type,
|  | const Gst::Structure& | structure
| ) |  |

static

Constructs a new custom query object.

Use unref() when done with it.

Free-function: gst_query_unref

Parameters

  type | The query type.
  structure | A structure for the query.

Returns
  A new Gst::Query.

## create_drain()

static Glib::RefPtr<Gst::Query> Gst::Query::create_drain | ( |  | ) |

static

Constructs a new query object for querying the drain state.

Free-function: gst_query_unref

Returns
  A new Gst::Query.

## create_duration()

static Glib::RefPtr<Gst::Query> Gst::Query::create_duration | ( | Gst::Format | format | ) |

static

Constructs a new stream duration query object to query in the given format.

Use unref() when done with it. A duration query will give the total length of the stream.

Free-function: gst_query_unref

Parameters

  format | The Gst::Format for this duration query.

Returns
  A new Gst::Query.

## create_formats()

static Glib::RefPtr<Gst::Query> Gst::Query::create_formats | ( |  | ) |

static

Constructs a new query object for querying formats of the stream.

Free-function: gst_query_unref

Returns
  A new Gst::Query.

## create_latency()

static Glib::RefPtr<Gst::Query> Gst::Query::create_latency | ( |  | ) |

static

Constructs a new latency query object.

Use unref() when done with it. A latency query is usually performed by sinks to compensate for additional latency introduced by elements in the pipeline.

Free-function: gst_query_unref

Returns
  A Gst::Query.

## create_position()

static Glib::RefPtr<Gst::Query> Gst::Query::create_position | ( | Gst::Format | format | ) |

static

Constructs a new query stream position query object.

Use unref() when done with it. A position query is used to query the current position of playback in the streams, in some format.

Free-function: gst_query_unref

Parameters

  format | The default Gst::Format for the new query.

Returns
  A new Gst::Query.

## create_scheduling()

static Glib::RefPtr<Gst::Query> Gst::Query::create_scheduling | ( |  | ) |

static

Constructs a new query object for querying the scheduling properties.

Free-function: gst_query_unref

Returns
  A new Gst::Query.

## create_seeking()

static Glib::RefPtr<Gst::Query> Gst::Query::create_seeking | ( | Gst::Format | format | ) |

static

Constructs a new query object for querying seeking properties of the stream.

Free-function: gst_query_unref

Parameters

  format | The default Gst::Format for the new query.

Returns
  A new Gst::Query.

## create_segment()

static Glib::RefPtr<Gst::Query> Gst::Query::create_segment | ( | Gst::Format | format | ) |

static

Constructs a new segment query object.

Use unref() when done with it. A segment query is used to discover information about the currently configured segment for playback.

Free-function: gst_query_unref

Parameters

  format | The Gst::Format for the new query.

Returns
  A new Gst::Query.

## create_uri()

static Glib::RefPtr<Gst::Query> Gst::Query::create_uri | ( |  | ) |

static

Constructs a new query URI query object.

Use unref() when done with it. An URI query is used to query the current URI that is used by the source or sink.

Free-function: gst_query_unref

Returns
  A new Gst::Query.

## create_writable()

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

Makes a writable query from the given query.

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

## get_query_type()

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

Get the Gst::QueryType of the query.

## get_structure()

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.

## gobj() [1/2]

GstQuery* Gst::Query::gobj | ( |  | ) |

Provides access to the underlying C instance.

## gobj() [2/2]

const GstQuery* Gst::Query::gobj | ( |  | ) | const

Provides access to the underlying C instance.

## gobj_copy()

GstQuery* Gst::Query::gobj_copy | ( |  | ) | const

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

## operator delete()

void Gst::Query::operator delete | ( | void * | ,
|  | std::size_t |
| ) |  |

protected

## operator=()

Query& Gst::Query::operator= | ( | const Query& |  | ) |

delete

## reference()

void Gst::Query::reference | ( |  | ) | const

Increment the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

## unreference()

void Gst::Query::unreference | ( |  | ) | const

Decrement the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

## wrap()

template <class QueryType >

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

inline static protected

## Friends And Related Function Documentation

## wrap()

Glib::RefPtr< Gst::Query > wrap | ( | GstQuery * | 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.