| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | |
| 3 | |
| 4 | #include <glibmm.h> |
| 5 | |
| 6 | #include <gstreamermm/capsfeatures.h> |
| 7 | #include <gstreamermm/private/capsfeatures_p.h> |
| 8 | |
| 9 | |
| 10 | /* gstreamermm - a C++ wrapper for gstreamer |
| 11 | * |
| 12 | * Copyright 2014-2016 The gstreamermm Development Team |
| 13 | * |
| 14 | * This library is free software; you can redistribute it and/or |
| 15 | * modify it under the terms of the GNU Lesser General Public |
| 16 | * License as published by the Free Software Foundation; either |
| 17 | * version 2.1 of the License, or (at your option) any later version. |
| 18 | * |
| 19 | * This library is distributed in the hope that it will be useful, |
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 22 | * Lesser General Public License for more details. |
| 23 | * |
| 24 | * You should have received a copy of the GNU Lesser General Public |
| 25 | * License along with this library; if not, write to the Free |
| 26 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 27 | */ |
| 28 | |
| 29 | namespace Gst |
| 30 | { |
| 31 | CapsFeatures::CapsFeatures(std::initializer_list<Glib::ustring> features) |
| 32 | : CapsFeatures() |
| 33 | { |
| 34 | for (auto feature : features) |
| 35 | { |
| 36 | gst_caps_features_add(gobject_, feature.c_str()); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | Glib::ustring CapsFeatures::memory_system_memory() |
| 41 | { |
| 42 | return GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY; |
| 43 | } |
| 44 | |
| 45 | } |
| 46 | |
| 47 | namespace |
| 48 | { |
| 49 | } // anonymous namespace |
| 50 | |
| 51 | |
| 52 | namespace Glib |
| 53 | { |
| 54 | |
| 55 | Gst::CapsFeatures wrap(GstCapsFeatures* object, bool take_copy) |
| 56 | { |
| 57 | return Gst::CapsFeatures(object, take_copy); |
| 58 | } |
| 59 | |
| 60 | } // namespace Glib |
| 61 | |
| 62 | |
| 63 | namespace Gst |
| 64 | { |
| 65 | |
| 66 | |
| 67 | // static |
| 68 | GType CapsFeatures::get_type() |
| 69 | { |
| 70 | return gst_caps_features_get_type(); |
| 71 | } |
| 72 | |
| 73 | CapsFeatures::CapsFeatures() |
| 74 | : |
| 75 | gobject_ (gst_caps_features_new_empty()) |
| 76 | {} |
| 77 | |
| 78 | CapsFeatures::CapsFeatures(const CapsFeatures& other) |
| 79 | : |
| 80 | gobject_ ((other.gobject_) ? gst_caps_features_copy(other.gobject_) : nullptr) |
| 81 | {} |
| 82 | |
| 83 | CapsFeatures::CapsFeatures(CapsFeatures&& other) noexcept |
| 84 | : |
| 85 | gobject_(other.gobject_) |
| 86 | { |
| 87 | other.gobject_ = nullptr; |
| 88 | } |
| 89 | |
| 90 | CapsFeatures& CapsFeatures::operator=(CapsFeatures&& other) noexcept |
| 91 | { |
| 92 | CapsFeatures temp (other); |
| 93 | swap(temp); |
| 94 | return *this; |
| 95 | } |
| 96 | |
| 97 | CapsFeatures::CapsFeatures(GstCapsFeatures* gobject, bool make_a_copy) |
| 98 | : |
| 99 | // For BoxedType wrappers, make_a_copy is true by default. The static |
| 100 | // BoxedType wrappers must always take a copy, thus make_a_copy = true |
| 101 | // ensures identical behaviour if the default argument is used. |
| 102 | gobject_ ((make_a_copy && gobject) ? gst_caps_features_copy(gobject) : gobject) |
| 103 | {} |
| 104 | |
| 105 | CapsFeatures& CapsFeatures::operator=(const CapsFeatures& other) |
| 106 | { |
| 107 | CapsFeatures temp (other); |
| 108 | swap(temp); |
| 109 | return *this; |
| 110 | } |
| 111 | |
| 112 | CapsFeatures::~CapsFeatures() noexcept |
| 113 | { |
| 114 | if(gobject_) |
| 115 | gst_caps_features_free(gobject_); |
| 116 | } |
| 117 | |
| 118 | void CapsFeatures::swap(CapsFeatures& other) noexcept |
| 119 | { |
| 120 | std::swap(gobject_, other.gobject_); |
| 121 | } |
| 122 | |
| 123 | GstCapsFeatures* CapsFeatures::gobj_copy() const |
| 124 | { |
| 125 | return gst_caps_features_copy(gobject_); |
| 126 | } |
| 127 | |
| 128 | |
| 129 | Gst::CapsFeatures CapsFeatures::create_any() |
| 130 | { |
| 131 | return CapsFeatures(gst_caps_features_new_any(), false); |
| 132 | } |
| 133 | |
| 134 | Gst::CapsFeatures CapsFeatures::create_from_string(const Glib::ustring& features) |
| 135 | { |
| 136 | return CapsFeatures(gst_caps_features_from_string(features.c_str()), false); |
| 137 | } |
| 138 | |
| 139 | Glib::ustring CapsFeatures::to_string() const |
| 140 | { |
| 141 | return Glib::convert_return_gchar_ptr_to_ustring(gst_caps_features_to_string(const_cast<GstCapsFeatures*>(gobj()))); |
| 142 | } |
| 143 | |
| 144 | bool CapsFeatures::set_parent_refcount(gint * refcount) |
| 145 | { |
| 146 | return gst_caps_features_set_parent_refcount(gobj(), refcount); |
| 147 | } |
| 148 | |
| 149 | bool CapsFeatures::is_equal(const Gst::CapsFeatures& features2) const |
| 150 | { |
| 151 | return gst_caps_features_is_equal(const_cast<GstCapsFeatures*>(gobj()), features2.gobj()); |
| 152 | } |
| 153 | |
| 154 | bool CapsFeatures::is_any() const |
| 155 | { |
| 156 | return gst_caps_features_is_any(const_cast<GstCapsFeatures*>(gobj())); |
| 157 | } |
| 158 | |
| 159 | bool CapsFeatures::contains(const Glib::ustring& feature) const |
| 160 | { |
| 161 | return gst_caps_features_contains(const_cast<GstCapsFeatures*>(gobj()), feature.c_str()); |
| 162 | } |
| 163 | |
| 164 | bool CapsFeatures::contains(GQuark feature) const |
| 165 | { |
| 166 | return gst_caps_features_contains_id(const_cast<GstCapsFeatures*>(gobj()), feature); |
| 167 | } |
| 168 | |
| 169 | guint CapsFeatures::get_size() const |
| 170 | { |
| 171 | return gst_caps_features_get_size(const_cast<GstCapsFeatures*>(gobj())); |
| 172 | } |
| 173 | |
| 174 | Glib::ustring CapsFeatures::get_nth(guint i) const |
| 175 | { |
| 176 | return Glib::convert_const_gchar_ptr_to_ustring(gst_caps_features_get_nth(const_cast<GstCapsFeatures*>(gobj()), i)); |
| 177 | } |
| 178 | |
| 179 | GQuark CapsFeatures::get_nth_id(guint i) const |
| 180 | { |
| 181 | return gst_caps_features_get_nth_id(const_cast<GstCapsFeatures*>(gobj()), i); |
| 182 | } |
| 183 | |
| 184 | void CapsFeatures::add(const Glib::ustring& feature) |
| 185 | { |
| 186 | gst_caps_features_add(gobj(), feature.c_str()); |
| 187 | } |
| 188 | |
| 189 | void CapsFeatures::add(GQuark feature) |
| 190 | { |
| 191 | gst_caps_features_add_id(gobj(), feature); |
| 192 | } |
| 193 | |
| 194 | void CapsFeatures::remove(const Glib::ustring& feature) |
| 195 | { |
| 196 | gst_caps_features_remove(gobj(), feature.c_str()); |
| 197 | } |
| 198 | |
| 199 | void CapsFeatures::remove(GQuark feature) |
| 200 | { |
| 201 | gst_caps_features_remove_id(gobj(), feature); |
| 202 | } |
| 203 | |
| 204 | |
| 205 | } // namespace Gst |
| 206 | |
| 207 |