/* gstreamermm - a C++ wrapper for gstreamer * * Copyright 2011-2016 The gstreamermm Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include _DEFS(gstreamermm,gst) namespace Gst { class DiscovererInfo; class Element; /** 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) */ class Discoverer : public Glib::Object { _CLASS_GOBJECT(Discoverer, GstDiscoverer, GST_DISCOVERER, Glib::Object, GObject) protected: explicit Discoverer(ClockTime timeout); public: _WRAP_METHOD_DOCS_ONLY(gst_discoverer_new, errthrow) _WRAP_CREATE(ClockTime timeout) _WRAP_METHOD(void start(), gst_discoverer_start) _WRAP_METHOD(void stop(), gst_discoverer_stop) _WRAP_METHOD(Glib::RefPtr discover_uri(const Glib::ustring& uri), gst_discoverer_discover_uri, errthrow) _WRAP_METHOD(bool discover_uri_async(const Glib::ustring& uri), gst_discoverer_discover_uri_async) _WRAP_PROPERTY("timeout", guint64) #m4 _CONVERSION(`GstDiscovererInfo*', `const Glib::RefPtr&', `Glib::wrap($3,true)') #m4 _CONVERSION(`const GError*', `const Glib::Error&', `Glib::Error(const_cast($3), true)') _WRAP_SIGNAL(void discovered(const Glib::RefPtr& info, const Glib::Error& error), "discovered") _WRAP_SIGNAL(void finished(), "finished") _WRAP_SIGNAL(void starting(), "starting") #m4 _CONVERSION(`GstElement*', `const Glib::RefPtr&', `Glib::wrap($3,true)') _WRAP_SIGNAL(void source_setup(const Glib::RefPtr& source), "source_setup") }; } //namespace Gst