| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | #ifndef _GSTREAMERMM_CAPSFEATURES_H |
| 3 | #define _GSTREAMERMM_CAPSFEATURES_H |
| 4 | |
| 5 | |
| 6 | #include <glibmm/ustring.h> |
| 7 | #include <sigc++/sigc++.h> |
| 8 | |
| 9 | /* gstreamermm - a C++ wrapper for gstreamer |
| 10 | * |
| 11 | * Copyright 2014-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 <gst/gst.h> |
| 29 | |
| 30 | |
| 31 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 32 | extern "C" { typedef struct _GstCapsFeatures GstCapsFeatures; } |
| 33 | #endif |
| 34 | |
| 35 | namespace Gst |
| 36 | { |
| 37 | |
| 38 | /** |
| 39 | * A set of features in caps |
| 40 | * |
| 41 | * Gst::CapsFeatures can optionally be set on a Gst::Caps to add requirements |
| 42 | * for additional features for a specific Gst::Structure. Caps structures with |
| 43 | * the same name but with a non-equal set of caps features are not compatible. |
| 44 | * If a pad supports multiple sets of features it has to add multiple equal |
| 45 | * structures with different feature sets to the caps. |
| 46 | * |
| 47 | * Empty Gst::CapsFeatures are equivalent with the Gst::CapsFeatures that only |
| 48 | * contain Gst::CapsFeatures::memory_system_memory(). ANY Gst::CapsFeatures as |
| 49 | * created by Gst::CapsFeatures::create_any() are equal to any other Gst::CapsFeatures |
| 50 | * and can be used to specify that any Gst::CapsFeatures would be supported, e.g. |
| 51 | * for elements that don't touch buffer memory. Gst::Caps with ANY Gst::CapsFeatures |
| 52 | * are considered non-fixed and during negotiation some Gst::CapsFeatures have |
| 53 | * to be selected. |
| 54 | * |
| 55 | * Examples for caps features would be the requirement of a specific Gst::Memory |
| 56 | * types or the requirement of having a specific Gst::Meta on the buffer. Features |
| 57 | * are given as a string of the format "memory:GstMemoryTypeName" or |
| 58 | * "meta:GstMetaAPIName". |
| 59 | * |
| 60 | * Last reviewed on 2016-05-16 (1.8.0) |
| 61 | * |
| 62 | * Since: 1.2 |
| 63 | */ |
| 64 | class CapsFeatures |
| 65 | { |
| 66 | public: |
| 67 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 68 | using CppObjectType = CapsFeatures; |
| 69 | using BaseObjectType = GstCapsFeatures; |
| 70 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 71 | |
| 72 | /** Get the GType for this class, for use with the underlying GObject type system. |
| 73 | */ |
| 74 | static GType get_type() G_GNUC_CONST; |
| 75 | |
| 76 | CapsFeatures(); |
| 77 | |
| 78 | explicit CapsFeatures(GstCapsFeatures* gobject, bool make_a_copy = true); |
| 79 | |
| 80 | CapsFeatures(const CapsFeatures& other); |
| 81 | CapsFeatures& operator=(const CapsFeatures& other); |
| 82 | |
| 83 | CapsFeatures(CapsFeatures&& other) noexcept; |
| 84 | CapsFeatures& operator=(CapsFeatures&& other) noexcept; |
| 85 | |
| 86 | ~CapsFeatures() noexcept; |
| 87 | |
| 88 | void swap(CapsFeatures& other) noexcept; |
| 89 | |
| 90 | ///Provides access to the underlying C instance. |
| 91 | GstCapsFeatures* gobj() { return gobject_; } |
| 92 | |
| 93 | ///Provides access to the underlying C instance. |
| 94 | const GstCapsFeatures* gobj() const { return gobject_; } |
| 95 | |
| 96 | ///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs. |
| 97 | GstCapsFeatures* gobj_copy() const; |
| 98 | |
| 99 | protected: |
| 100 | GstCapsFeatures* gobject_; |
| 101 | |
| 102 | private: |
| 103 | |
| 104 | |
| 105 | public: |
| 106 | /** |
| 107 | * Creates a new Gst::CapsFeatures with the given features. |
| 108 | * |
| 109 | * @param features name of features to set. |
| 110 | */ |
| 111 | explicit CapsFeatures(std::initializer_list<Glib::ustring> features); |
| 112 | |
| 113 | |
| 114 | /** Creates a new, ANY Gst::CapsFeatures. This will be equal |
| 115 | * to any other Gst::CapsFeatures but caps with these are |
| 116 | * unfixed. |
| 117 | * |
| 118 | * Free-function: gst_caps_features_free |
| 119 | * |
| 120 | * @return A new, ANY Gst::CapsFeatures. |
| 121 | */ |
| 122 | static Gst::CapsFeatures create_any(); |
| 123 | |
| 124 | |
| 125 | /** Creates a Gst::CapsFeatures from a string representation. |
| 126 | * |
| 127 | * Free-function: gst_caps_features_free |
| 128 | * |
| 129 | * @param features A string representation of a Gst::CapsFeatures. |
| 130 | * @return A new Gst::CapsFeatures or |
| 131 | * <tt>nullptr</tt> when the string could not be parsed. Free with |
| 132 | * free() after use. |
| 133 | */ |
| 134 | static Gst::CapsFeatures create_from_string(const Glib::ustring& features); |
| 135 | |
| 136 | |
| 137 | /** Converts @a features to a human-readable string representation. |
| 138 | * |
| 139 | * For debugging purposes its easier to do something like this: |
| 140 | * |
| 141 | * [C example ellipted] |
| 142 | * This prints the features in human readable form. |
| 143 | * |
| 144 | * @return A pointer to string allocated by Glib::malloc(). |
| 145 | */ |
| 146 | Glib::ustring to_string() const; |
| 147 | |
| 148 | |
| 149 | /** Sets the parent_refcount field of Gst::CapsFeatures. This field is used to |
| 150 | * determine whether a caps features is mutable or not. This function should only be |
| 151 | * called by code implementing parent objects of Gst::CapsFeatures, as described in |
| 152 | * the MT Refcounting section of the design documents. |
| 153 | * |
| 154 | * @param refcount A pointer to the parent's refcount. |
| 155 | * @return <tt>true</tt> if the parent refcount could be set. |
| 156 | */ |
| 157 | bool set_parent_refcount(gint * refcount); |
| 158 | |
| 159 | |
| 160 | /** Check if @a features1 and @a features2 are equal. |
| 161 | * |
| 162 | * @param features2 A Gst::CapsFeatures. |
| 163 | * @return <tt>true</tt> if @a features1 and @a features2 are equal. |
| 164 | */ |
| 165 | bool is_equal(const Gst::CapsFeatures& features2) const; |
| 166 | |
| 167 | |
| 168 | /** Check if @a features is Gst::CAPS_FEATURES_ANY. |
| 169 | * |
| 170 | * @return <tt>true</tt> if @a features is Gst::CAPS_FEATURES_ANY. |
| 171 | */ |
| 172 | bool is_any() const; |
| 173 | |
| 174 | |
| 175 | /** Check if @a features contains @a feature. |
| 176 | * |
| 177 | * @param feature A feature. |
| 178 | * @return <tt>true</tt> if @a features contains @a feature. |
| 179 | */ |
| 180 | bool contains(const Glib::ustring& feature) const; |
| 181 | |
| 182 | |
| 183 | /** Check if @a features contains @a feature. |
| 184 | * |
| 185 | * @param feature A feature. |
| 186 | * @return <tt>true</tt> if @a features contains @a feature. |
| 187 | */ |
| 188 | bool contains(GQuark feature) const; |
| 189 | |
| 190 | |
| 191 | /** Returns the number of features in @a features. |
| 192 | * |
| 193 | * @return The number of features in @a features. |
| 194 | */ |
| 195 | guint get_size() const; |
| 196 | |
| 197 | |
| 198 | /** Returns the @a i-th feature of @a features. |
| 199 | * |
| 200 | * @param i Index of the feature. |
| 201 | * @return The @a i-th feature of @a features. |
| 202 | */ |
| 203 | Glib::ustring get_nth(guint i) const; |
| 204 | |
| 205 | |
| 206 | /** Returns the @a i-th feature of @a features. |
| 207 | * |
| 208 | * @param i Index of the feature. |
| 209 | * @return The @a i-th feature of @a features. |
| 210 | */ |
| 211 | GQuark get_nth_id(guint i) const; |
| 212 | |
| 213 | |
| 214 | /** Adds @a feature to @a features. |
| 215 | * |
| 216 | * @param feature A feature. |
| 217 | */ |
| 218 | void add(const Glib::ustring& feature); |
| 219 | |
| 220 | |
| 221 | /** Adds @a feature to @a features. |
| 222 | * |
| 223 | * @param feature A feature. |
| 224 | */ |
| 225 | void add(GQuark feature); |
| 226 | |
| 227 | |
| 228 | /** Removes @a feature from @a features. |
| 229 | * |
| 230 | * @param feature A feature. |
| 231 | */ |
| 232 | void remove(const Glib::ustring& feature); |
| 233 | |
| 234 | |
| 235 | /** Removes @a feature from @a features. |
| 236 | * |
| 237 | * @param feature A feature. |
| 238 | */ |
| 239 | void remove(GQuark feature); |
| 240 | |
| 241 | /** Constant for system memory feature name. |
| 242 | */ |
| 243 | static Glib::ustring memory_system_memory(); |
| 244 | |
| 245 | |
| 246 | }; |
| 247 | |
| 248 | } |
| 249 | |
| 250 | |
| 251 | namespace Gst |
| 252 | { |
| 253 | |
| 254 | /** @relates Gst::CapsFeatures |
| 255 | * @param lhs The left-hand side |
| 256 | * @param rhs The right-hand side |
| 257 | */ |
| 258 | inline void swap(CapsFeatures& lhs, CapsFeatures& rhs) noexcept |
| 259 | { lhs.swap(rhs); } |
| 260 | |
| 261 | } // namespace Gst |
| 262 | |
| 263 | namespace Glib |
| 264 | { |
| 265 | |
| 266 | /** A Glib::wrap() method for this object. |
| 267 | * |
| 268 | * @param object The C instance. |
| 269 | * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. |
| 270 | * @result A C++ instance that wraps this C instance. |
| 271 | * |
| 272 | * @relates Gst::CapsFeatures |
| 273 | */ |
| 274 | Gst::CapsFeatures wrap(GstCapsFeatures* object, bool take_copy = false); |
| 275 | |
| 276 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 277 | template <> |
| 278 | class Value<Gst::CapsFeatures> : public Glib::Value_Boxed<Gst::CapsFeatures> |
| 279 | {}; |
| 280 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 281 | |
| 282 | } // namespace Glib |
| 283 | |
| 284 | |
| 285 | #endif /* _GSTREAMERMM_CAPSFEATURES_H */ |
| 286 |