| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | #ifndef _GSTREAMERMM_GHOSTPAD_H |
| 3 | #define _GSTREAMERMM_GHOSTPAD_H |
| 4 | |
| 5 | |
| 6 | #include <glibmm/ustring.h> |
| 7 | #include <sigc++/sigc++.h> |
| 8 | |
| 9 | /* gstreamermm - a C++ wrapper for gstreamer |
| 10 | * |
| 11 | * Copyright 2008-2016 The gstreamermm Development Team |
| 12 | * |
| 13 | * This library is free software; you can redistribute it and/or |
| 14 | * modify it under the terms of the GNU Lesser General Public |
| 15 | * License as published by the Free Software Foundation; either |
| 16 | * version 2.1 of the License, or (at your option) any later version. |
| 17 | * |
| 18 | * This library is distributed in the hope that it will be useful, |
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 21 | * Lesser General Public License for more details. |
| 22 | * |
| 23 | * You should have received a copy of the GNU Lesser General Public |
| 24 | * License along with this library; if not, write to the Free |
| 25 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 26 | */ |
| 27 | |
| 28 | #include <gstreamermm/pad.h> |
| 29 | |
| 30 | |
| 31 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 32 | using GstGhostPad = struct _GstGhostPad; |
| 33 | using GstGhostPadClass = struct _GstGhostPadClass; |
| 34 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 35 | |
| 36 | |
| 37 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 38 | namespace Gst |
| 39 | { class GhostPad_Class; } // namespace Gst |
| 40 | #endif //DOXYGEN_SHOULD_SKIP_THIS |
| 41 | |
| 42 | namespace Gst |
| 43 | { |
| 44 | |
| 45 | /** A class that represents pseudo link pads. |
| 46 | * Gst::GhostPad are useful when organizing pipelines with Gst::Bin like |
| 47 | * elements. |
| 48 | * The idea here is to create hierarchical element graphs. The bin element |
| 49 | * contains a sub-graph. Now one would like to treat the bin-element like |
| 50 | * another Gst::Element. This is where Gst::GhostPad come into play. A |
| 51 | * Gst::GhostPad acts as a proxy for another pad. Thus the bin can have sink |
| 52 | * and source ghost-pads that are associated with sink and source pads of the |
| 53 | * child elements. |
| 54 | * |
| 55 | * If the target pad is known at creation time, create() with a Gst::Pad |
| 56 | * argument is the method to use to get a ghost-pad. Otherwise one can use |
| 57 | * create() with a Gst::PadDirection argument to create the ghost-pad and use |
| 58 | * set_target() to establish the association later on. |
| 59 | * |
| 60 | * Note that Gst::GhostPad add overhead to the data processing of a pipeline. |
| 61 | * |
| 62 | * Last reviewed on 2016-06-05 (1.8.0) |
| 63 | */ |
| 64 | |
| 65 | class GhostPad : public Pad |
| 66 | { |
| 67 | |
| 68 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 69 | |
| 70 | public: |
| 71 | using CppObjectType = GhostPad; |
| 72 | using CppClassType = GhostPad_Class; |
| 73 | using BaseObjectType = GstGhostPad; |
| 74 | using BaseClassType = GstGhostPadClass; |
| 75 | |
| 76 | // noncopyable |
| 77 | GhostPad(const GhostPad&) = delete; |
| 78 | GhostPad& operator=(const GhostPad&) = delete; |
| 79 | |
| 80 | private: friend class GhostPad_Class; |
| 81 | static CppClassType ghostpad_class_; |
| 82 | |
| 83 | protected: |
| 84 | explicit GhostPad(const Glib::ConstructParams& construct_params); |
| 85 | explicit GhostPad(GstGhostPad* castitem); |
| 86 | |
| 87 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 88 | |
| 89 | public: |
| 90 | |
| 91 | GhostPad(GhostPad&& src) noexcept; |
| 92 | GhostPad& operator=(GhostPad&& src) noexcept; |
| 93 | |
| 94 | ~GhostPad() noexcept override; |
| 95 | |
| 96 | /** Get the GType for this class, for use with the underlying GObject type system. |
| 97 | */ |
| 98 | static GType get_type() G_GNUC_CONST; |
| 99 | |
| 100 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 101 | |
| 102 | |
| 103 | static GType get_base_type() G_GNUC_CONST; |
| 104 | #endif |
| 105 | |
| 106 | ///Provides access to the underlying C GObject. |
| 107 | GstGhostPad* gobj() { return reinterpret_cast<GstGhostPad*>(gobject_); } |
| 108 | |
| 109 | ///Provides access to the underlying C GObject. |
| 110 | const GstGhostPad* gobj() const { return reinterpret_cast<GstGhostPad*>(gobject_); } |
| 111 | |
| 112 | ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. |
| 113 | GstGhostPad* gobj_copy(); |
| 114 | |
| 115 | private: |
| 116 | |
| 117 | |
| 118 | protected: |
| 119 | /** Creates a Gst::GhostPad from a target pad. |
| 120 | * @param target The target pad. |
| 121 | * @param name The name of the Gst::GhostPad. |
| 122 | * |
| 123 | * @throw std::runtime_error if Gst::GhostPad construction fails. |
| 124 | */ |
| 125 | GhostPad(const Glib::RefPtr<Gst::Pad>& target, const Glib::ustring& name); |
| 126 | |
| 127 | /** Creates a Gst::GhostPad with a specified name and direction. |
| 128 | * @param direction The direction of the Gst::GhostPad. |
| 129 | * @param name The name of the Gst::GhostPad. |
| 130 | * |
| 131 | * @throw std::runtime_error if Gst::GhostPad construction fails. |
| 132 | */ |
| 133 | GhostPad(PadDirection direction, const Glib::ustring& name); |
| 134 | |
| 135 | /** Creates a Gst::GhostPad from a target pad and a pad template. |
| 136 | * @param target The target pad. |
| 137 | * @param templ The pad template. |
| 138 | * @param name The name of the Gst::GhostPad. |
| 139 | * |
| 140 | * @throw std::runtime_error if Gst::GhostPad construction fails. |
| 141 | */ |
| 142 | GhostPad(const Glib::RefPtr<Gst::Pad>& target, |
| 143 | const Glib::RefPtr<Gst::PadTemplate>& templ, const Glib::ustring& name); |
| 144 | |
| 145 | /** Creates a Gst::GhostPad from a pad template. |
| 146 | * @param templ The pad template. |
| 147 | * @param name The name of the Gst::GhostPad. |
| 148 | * |
| 149 | * @throw std::runtime_error if Gst::GhostPad construction fails. |
| 150 | */ |
| 151 | GhostPad(const Glib::RefPtr<Gst::PadTemplate>& templ, |
| 152 | const Glib::ustring& name); |
| 153 | |
| 154 | |
| 155 | public: |
| 156 | /** Create a new Gst::GhostPad with @a target as the target. The direction |
| 157 | * will be taken from the target pad. @a target must be unlinked. |
| 158 | * |
| 159 | * @param target The pad to ghost. |
| 160 | * @param name The (optional) name of the new pad. |
| 161 | * @return A new Gst::GhostPad, or an empty RefPtr in case of an error. |
| 162 | * @throw std::runtime_error if Gst::GhostPad construction fails. |
| 163 | */ |
| 164 | |
| 165 | static Glib::RefPtr<GhostPad> create(const Glib::RefPtr<Gst::Pad>& target, const Glib::ustring& name = Glib::ustring()); |
| 166 | |
| 167 | |
| 168 | /** Create a new Gst::GhostPad without a target with the given direction. A |
| 169 | * target can be set on the Gst::GhostPad later with the set_target() |
| 170 | * function. |
| 171 | * |
| 172 | * The created Gst::GhostPad will not have a padtemplate. |
| 173 | * |
| 174 | * @param dir The direction of the Gst::GhostPad. |
| 175 | * @param name The (optional) name of the new Gst::GhostPad. |
| 176 | * @return A new Gst::GhostPad, or an empty RefPtr in case of an error. |
| 177 | * @throw std::runtime_error if Gst::GhostPad construction fails. |
| 178 | */ |
| 179 | |
| 180 | static Glib::RefPtr<GhostPad> create(PadDirection dir, const Glib::ustring& name = Glib::ustring()); |
| 181 | |
| 182 | |
| 183 | /** Create a new Gst::GhostPad with @a target as the target. The direction |
| 184 | * will be taken from the target pad. The template used on the Gst::GhostPad |
| 185 | * will be template. |
| 186 | * |
| 187 | * @param target The pad to ghost. |
| 188 | * @param templ The Gst::PadTemplate to use on the Gst::GhostPad. |
| 189 | * @param name The (optional) name of the new Gst::GhostPad. |
| 190 | * @return A new Gst::GhostPad, or an empty RefPtr in case of an error. |
| 191 | * @throw std::runtime_error if Gst::GhostPad construction fails. |
| 192 | */ |
| 193 | |
| 194 | static Glib::RefPtr<GhostPad> create(const Glib::RefPtr<Gst::Pad>& target, const Glib::RefPtr<Gst::PadTemplate>& templ, const Glib::ustring& name = Glib::ustring()); |
| 195 | |
| 196 | |
| 197 | /** Create a new Gst::GhostPad based on @a templ, without setting a target. |
| 198 | * The direction will be taken from @a templ. |
| 199 | * |
| 200 | * @param templ The Gst::PadTemplate to create the Gst::GhostPad from. |
| 201 | * @param name The (optional) name of the new Gst::GhostPad. |
| 202 | * @return A new Gst::GhostPad, or an empty RefPtr in case of an error. |
| 203 | * @throw std::runtime_error if Gst::GhostPad construction fails. |
| 204 | */ |
| 205 | |
| 206 | static Glib::RefPtr<GhostPad> create(const Glib::RefPtr<Gst::PadTemplate>& templ, const Glib::ustring& name = Glib::ustring()); |
| 207 | |
| 208 | |
| 209 | /** Set the new target of the ghostpad @a gpad. Any existing target |
| 210 | * is unlinked and links to the new target are established. if @a newtarget is |
| 211 | * <tt>nullptr</tt> the target will be cleared. |
| 212 | * |
| 213 | * @param newtarget The new pad target. |
| 214 | * @return <tt>true</tt> if the new target could be set. This function |
| 215 | * can return <tt>false</tt> when the internal pads could not be linked. |
| 216 | */ |
| 217 | bool set_target(const Glib::RefPtr<Gst::Pad>& newtarget); |
| 218 | |
| 219 | |
| 220 | /** Get the target pad of @a gpad. Unref target pad after usage. |
| 221 | * |
| 222 | * @return The target Gst::Pad, can be |
| 223 | * <tt>nullptr</tt> if the ghostpad has no target set. Unref target pad after |
| 224 | * usage. |
| 225 | */ |
| 226 | Glib::RefPtr<Gst::Pad> get_target(); |
| 227 | |
| 228 | /** Get the target pad of @a gpad. Unref target pad after usage. |
| 229 | * |
| 230 | * @return The target Gst::Pad, can be |
| 231 | * <tt>nullptr</tt> if the ghostpad has no target set. Unref target pad after |
| 232 | * usage. |
| 233 | */ |
| 234 | Glib::RefPtr<const Gst::Pad> get_target() const; |
| 235 | |
| 236 | |
| 237 | public: |
| 238 | |
| 239 | public: |
| 240 | //C++ methods used to invoke GTK+ virtual functions: |
| 241 | |
| 242 | protected: |
| 243 | //GTK+ Virtual Functions (override these to change behaviour): |
| 244 | |
| 245 | //Default Signal Handlers:: |
| 246 | |
| 247 | |
| 248 | }; |
| 249 | |
| 250 | } // namespace Gst |
| 251 | |
| 252 | |
| 253 | namespace Glib |
| 254 | { |
| 255 | /** A Glib::wrap() method for this object. |
| 256 | * |
| 257 | * @param object The C instance. |
| 258 | * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. |
| 259 | * @result A C++ instance that wraps this C instance. |
| 260 | * |
| 261 | * @relates Gst::GhostPad |
| 262 | */ |
| 263 | Glib::RefPtr<Gst::GhostPad> wrap(GstGhostPad* object, bool take_copy = false); |
| 264 | } |
| 265 | |
| 266 | |
| 267 | #endif /* _GSTREAMERMM_GHOSTPAD_H */ |
| 268 |