/* gstreamermm - a C++ wrapper for gstreamer * * Copyright 2008-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 #include #include _DEFS(gstreamermm,gst) namespace Gst { _WRAP_ENUM(ObjectFlags, GstObjectFlags) /** @defgroup GstBaseClasses gstreamermm Base Classes * Wrapped GStreamer base classes (plug-ins and other classes derrive from * these). */ /** A base class for the GStreamer object hierarchy. * Gst::Object provides a root for the object hierarchy tree filed in by the * GStreamer library. It is currently a thin wrapper on top of Glib::Object. * It is an abstract class that is not very usable on its own. * * Gst::Object gives us basic refcounting, parenting functionality and * locking. Most of the function are just extended for special GStreamer needs * and can be found under the same name in the base class of Gst::Object which * is Glib::Object (e.g. Glib::Object::reference() becomes * Gst:Object::reference(). * * In contrast to Glib::Object instances, Gst::Object adds a name property. * The functions set_name() and get_name() are used to set/get the name of the * object. * * Last reviewed on 2016-06-06 (1.8.0) * @ingroup GstBaseClasses */ class Object : public Glib::Object { _CLASS_GOBJECT(Object, GstObject, GST_OBJECT, Glib::Object, GObject) _IGNORE(gst_object_ref, gst_object_unref) _CUSTOM_CTOR_CAST public: bool is_element() const; bool is_element_factory() const; bool is_pad() const; bool is_pad_template() const; bool is_bin() const; /** Returns the entire set of flags for the object. */ _MEMBER_GET(flags, flags, guint32, guint32) //TODO: These conversions should probably be in the glibmm conversion files. #m4 _CONVERSION(`GMutex*',`Glib::Threads::Mutex*',`Glib::Threads::wrap($3)') #m4 _CONVERSION(`GMutex*',`const Glib::Threads::Mutex*',`Glib::Threads::wrap($3)') _WRAP_METHOD(bool set_name(const Glib::ustring& name), gst_object_set_name) _WRAP_METHOD(Glib::ustring get_name() const, gst_object_get_name) _WRAP_METHOD(bool set_parent(const Glib::RefPtr& parent), gst_object_set_parent) _WRAP_METHOD(Glib::RefPtr get_parent(), gst_object_get_parent) _WRAP_METHOD(Glib::RefPtr get_parent() const, gst_object_get_parent, constversion) _WRAP_METHOD(void unparent(), gst_object_unparent) _WRAP_METHOD(void set_control_rate(Gst::ClockTime control_rate), gst_object_set_control_rate) _WRAP_METHOD(Gst::ClockTime get_control_rate() const, gst_object_get_control_rate) _WRAP_METHOD(Gst::ClockTime suggest_next_sync() const, gst_object_suggest_next_sync) _WRAP_METHOD(bool sync_values(Gst::ClockTime timestamp), gst_object_sync_values) _WRAP_METHOD(void set_control_bindings_disabled(bool disabled), gst_object_set_control_bindings_disabled) _WRAP_METHOD(bool has_asctive_control_bindings() const, gst_object_has_active_control_bindings) // Ignore default signal and error callback. _IGNORE(gst_object_default_deep_notify, gst_object_default_error) #m4 _CONVERSION(`const Glib::ListHandle&', `GList*', `($3).data()') _WRAP_METHOD(static bool check_uniqueness(const Glib::ListHandle& list, const Glib::ustring& name), gst_object_check_uniqueness) _WRAP_METHOD(bool has_ancestor(const Glib::RefPtr& ancestor) const, gst_object_has_ancestor) _WRAP_METHOD(bool has_as_ancestor(const Glib::RefPtr& ancestor) const, gst_object_has_as_ancestor) _WRAP_METHOD(bool has_as_parent(const Glib::RefPtr& parent) const, gst_object_has_as_parent) _WRAP_METHOD(Glib::ustring get_path_string(), gst_object_get_path_string) _WRAP_PROPERTY("name", Glib::ustring) _WRAP_PROPERTY("parent", Glib::RefPtr) #m4 _CONVERSION(`GstObject*', `const Glib::RefPtr&', `Glib::wrap($3, true)') //TODO: Maybe GParamSpec should be wrapped in glibmm? _WRAP_SIGNAL(void deep_notify(const Glib::RefPtr& prop_object, GParamSpec* prop), "deep-notify") int get_refcount() const; }; } // namespace Gst