gstreamermm: Gst::Discoverer Class Reference

gstreamermm 1.8.0

Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gst::Discoverer Class Reference

Discoverer - Utility for discovering information on URIs. More...

`#include <gstreamermm/discoverer.h>`

Inheritance diagram for Gst::Discoverer:
[legend]

## Public Member Functions
| Discoverer (Discoverer&& src) noexcept
Discoverer& | operator= (Discoverer&& src) noexcept
| ~Discoverer () noexcept override
GstDiscoverer* | gobj ()
| Provides access to the underlying C GObject. More...
const GstDiscoverer* | gobj () const
| Provides access to the underlying C GObject. More...
GstDiscoverer* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
void | start ()
| Allow asynchronous discovering of URIs to take place. More...
void | stop ()
| Stop the discovery of any pending URIs and clears the list of pending URIS (if any). More...
Glib::RefPtr< Gst::DiscovererInfo > | discover_uri (const Glib::ustring& uri)
| Synchronously discovers the given uri. More...
bool | discover_uri_async (const Glib::ustring& uri)
| Appends the given uri to the list of URIs to discoverer. More...
Glib::PropertyProxy< guint64 > | property_timeout ()
| Timeout. More...
Glib::PropertyProxy_ReadOnly< guint64 > | property_timeout () const
| Timeout. More...
Glib::SignalProxy< void, const Glib::RefPtr< Gst::DiscovererInfo >&, const Glib::Error&> | signal_discovered ()
Glib::SignalProxy< void > | signal_finished ()
Glib::SignalProxy< void > | signal_starting ()
Glib::SignalProxy< void, const Glib::RefPtr< Gst::Element >&> | signal_source_setup ()
Public Member Functions inherited from Glib::Object
| Object (const Object &)=delete
Object & | operator= (const Object &)=delete
| Object (Object &&src) noexcept
Object & | operator= (Object &&src) noexcept
void * | get_data (const QueryQuark &key)
void | set_data (const Quark &key, void *data)
void | set_data (const Quark &key, void *data, DestroyNotify notify)
void | remove_data (const QueryQuark &quark)
void * | steal_data (const QueryQuark &quark)
Glib::RefPtr< Glib::Object > | wrap (GObject *object, bool take_copy=false)
Public Member Functions inherited from Glib::ObjectBase
| ObjectBase (const ObjectBase &)=delete
ObjectBase & | operator= (const ObjectBase &)=delete
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value)
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const
void | set_property (const Glib::ustring &property_name, const PropertyType &value)
void | get_property (const Glib::ustring &property_name, PropertyType &value) const
void | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void > &slot)
void | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void > &&slot)
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, const sigc::slot< void > &slot)
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, sigc::slot< void > &&slot)
void | freeze_notify ()
void | thaw_notify ()
virtual void | reference () const
virtual void | unreference () const
GObject * | gobj ()
const GObject * | gobj () const
GObject * | gobj_copy () const
Public Member Functions inherited from sigc::trackable
| trackable () noexcept
| trackable (const trackable &src) noexcept
| trackable (trackable &&src)
| ~trackable ()
void | add_destroy_notify_callback (void *data, func_destroy_notify func) const
void | notify_callbacks ()
trackable & | operator= (const trackable &src)
trackable & | operator= (trackable &&src)
void | remove_destroy_notify_callback (void *data) const

## Static Public Member Functions
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
static Glib::RefPtr< Discoverer > | create (ClockTime timeout)
| Creates a new Gst::Discoverer with the provided timeout. More...

## Protected Member Functions
| Discoverer (ClockTime timeout)
virtual void | on_discovered (const Glib::RefPtr< Gst::DiscovererInfo >& info, const Glib::Error& error)
| This is a default handler for the signal signal_discovered(). More...
virtual void | on_finished ()
| This is a default handler for the signal signal_finished(). More...
virtual void | on_starting ()
| This is a default handler for the signal signal_starting(). More...
virtual void | on_source_setup (const Glib::RefPtr< Gst::Element >& source)
| This is a default handler for the signal signal_source_setup(). More...
Protected Member Functions inherited from Glib::Object
| Object ()
| Object (const Glib::ConstructParams &construct_params)
| Object (GObject *castitem)
| ~Object () noexceptoverride
Protected Member Functions inherited from Glib::ObjectBase
| ObjectBase ()
| ObjectBase (const char *custom_type_name)
| ObjectBase (const std::type_info &custom_type_info)
| ObjectBase (ObjectBase &&src) noexcept
ObjectBase & | operator= (ObjectBase &&src) noexcept
virtual | ~ObjectBase () noexcept=0
void | initialize (GObject *castitem)
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper)

## Related Functions
(Note that these are not member functions.)
Glib::RefPtr< Gst::Discoverer > | wrap (GstDiscoverer* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Additional Inherited Members
Public Types inherited from Glib::Object
typedef void(*)(gpointer data | DestroyNotify)
Public Types inherited from sigc::trackable
typedef internal::func_destroy_notify | func_destroy_notify

## Detailed Description

Discoverer - Utility for discovering information on URIs.

The Discoverer is a utility object which allows to get as much information as possible from one or many URIs.

It provides two APIs, allowing usage in blocking or non-blocking mode.

The blocking mode just requires calling discover_uri() with the URI one wishes to discover.

The non-blocking mode requires a running Glib::MainLoop iterating a Glib::MainContext, where one connects to the various signals, appends the URIs to be processed (through discover_uri_async()) and then asks for the discovery to begin (through start()). By default this will use the GLib default main context unless you have set a custom context using Glib::MainContext::push_thread_default().

All the information is returned in a DiscovererInfo structure.

Last reviewed on 2016-05-18 (1.8.0)

## Constructor & Destructor Documentation

## § Discoverer() [1/2]

Gst::Discoverer::Discoverer | ( | Discoverer&& | src | ) |
| noexcept

## § ~Discoverer()

Gst::Discoverer::~Discoverer | ( |  | ) |
| overridenoexcept

## § Discoverer() [2/2]

Gst::Discoverer::Discoverer | ( | ClockTime | timeout | ) |
| explicitprotected

## Member Function Documentation

## § create()

static Glib::RefPtr<Discoverer> Gst::Discoverer::create | ( | ClockTime | timeout | ) |
| static

Creates a new Gst::Discoverer with the provided timeout.

Parameters

  timeout | Timeout per file, in nanoseconds. Allowed are values between one second (Gst::SECOND) and one hour (3600* Gst::SECOND).
  err | A pointer to a Error. can be `nullptr`.

Returns
  The new Gst::Discoverer. If an error occurred when creating the discoverer, err will be set accordingly and `nullptr` will be returned. If err is set, the caller must free it when no longer needed using Glib::error_free().

## § discover_uri()

Glib::RefPtr<Gst::DiscovererInfo> Gst::Discoverer::discover_uri | ( | const Glib::ustring & | uri | ) |

Synchronously discovers the given uri.

Parameters

  uri | The URI to run on.
  If | an error occurred, this field will be filled in.

Returns
  The result of the scanning. Can be `nullptr` if an error occurred.

## § discover_uri_async()

bool Gst::Discoverer::discover_uri_async | ( | const Glib::ustring & | uri | ) |

Appends the given uri to the list of URIs to discoverer.

The actual discovery of the uri will only take place if start() has been called.

Parameters

  uri | The URI to add.

Returns
  `true` if the uri was successfully appended to the list of pending uris, else `false`.

## § get_type()

static GType Gst::Discoverer::get_type | ( |  | ) |
| static

Get the GType for this class, for use with the underlying GObject type system.

## § gobj() [1/2]

GstDiscoverer* Gst::Discoverer::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

## § gobj() [2/2]

const GstDiscoverer* Gst::Discoverer::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

## § gobj_copy()

GstDiscoverer* Gst::Discoverer::gobj_copy | ( |  | ) |

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

## § on_discovered()

virtual void Gst::Discoverer::on_discovered | ( | const Glib::RefPtr< Gst::DiscovererInfo >& | info,
|  | const Glib::Error & | error
| ) |  |
| protectedvirtual

This is a default handler for the signal signal_discovered().

## § on_finished()

virtual void Gst::Discoverer::on_finished | ( |  | ) |
| protectedvirtual

This is a default handler for the signal signal_finished().

## § on_source_setup()

virtual void Gst::Discoverer::on_source_setup | ( | const Glib::RefPtr< Gst::Element >& | source | ) |
| protectedvirtual

This is a default handler for the signal signal_source_setup().

## § on_starting()

virtual void Gst::Discoverer::on_starting | ( |  | ) |
| protectedvirtual

This is a default handler for the signal signal_starting().

## § operator=()

Discoverer& Gst::Discoverer::operator= | ( | Discoverer&& | src | ) |
| noexcept

## § property_timeout() [1/2]

Glib::PropertyProxy< guint64 > Gst::Discoverer::property_timeout | ( |  | ) |

Timeout.

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

## § property_timeout() [2/2]

Glib::PropertyProxy_ReadOnly< guint64 > Gst::Discoverer::property_timeout | ( |  | ) | const

Timeout.

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

## § signal_discovered()

Glib::SignalProxy< void,const Glib::RefPtr<Gst::DiscovererInfo>&,const Glib::Error& > Gst::Discoverer::signal_discovered | ( |  | ) |

Slot Prototype:
  `void on_my_discovered(const Glib::RefPtr<Gst::DiscovererInfo>& info, const Glib::Error& error)`

Will be emitted in async mode when all information on a URI could be discovered, or an error occurred.

When an error occurs, info might still contain some partial information, depending on the circumstances of the error.

Parameters

  info | The results Gst::DiscovererInfo.

## § signal_finished()

Glib::SignalProxy< void > Gst::Discoverer::signal_finished | ( |  | ) |

Slot Prototype:
  `void on_my_finished()`

Will be emitted in async mode when all pending URIs have been processed.

## § signal_source_setup()

Glib::SignalProxy< void,const Glib::RefPtr<Gst::Element>& > Gst::Discoverer::signal_source_setup | ( |  | ) |

Slot Prototype:
  `void on_my_source_setup(const Glib::RefPtr<Gst::Element>& source)`

This signal is emitted after the source element has been created for, so the URI being discovered, so it can be configured by setting additional properties (e.g. set a proxy server for an http source, or set the device and read speed for an audio cd source).

This signal is usually emitted from the context of a GStreamer streaming thread.

Parameters

  source | Source element.

## § signal_starting()

Glib::SignalProxy< void > Gst::Discoverer::signal_starting | ( |  | ) |

Slot Prototype:
  `void on_my_starting()`

Will be emitted when the discover starts analyzing the pending URIs

## § start()

void Gst::Discoverer::start | ( |  | ) |

Allow asynchronous discovering of URIs to take place.

A MainLoop must be available for Gst::Discoverer to properly work in asynchronous mode.

## § stop()

void Gst::Discoverer::stop | ( |  | ) |

Stop the discovery of any pending URIs and clears the list of pending URIS (if any).

## Friends And Related Function Documentation

## § wrap()

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