| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | |
| 3 | |
| 4 | #include <glibmm.h> |
| 5 | |
| 6 | #include <gstreamermm/registry.h> |
| 7 | #include <gstreamermm/private/registry_p.h> |
| 8 | |
| 9 | |
| 10 | /* gstreamermm - a C++ wrapper for gstreamer |
| 11 | * |
| 12 | * Copyright 2008 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 | #include <gst/gst.h> |
| 30 | #include <gstreamermm/pluginfeature.h> |
| 31 | #include <gstreamermm/plugin.h> |
| 32 | |
| 33 | |
| 34 | namespace |
| 35 | { |
| 36 | |
| 37 | extern "C" |
| 38 | { |
| 39 | |
| 40 | static gboolean Registry_Plugin_Filter_gstreamermm_callback(GstPlugin* plugin, void* data) |
| 41 | { |
| 42 | Gst::Plugin::SlotFilter* the_slot = static_cast<Gst::Plugin::SlotFilter*>(data); |
| 43 | |
| 44 | try |
| 45 | { |
| 46 | bool result = (*the_slot)(Glib::wrap(plugin, true)); |
| 47 | return result; |
| 48 | } |
| 49 | catch(...) |
| 50 | { |
| 51 | Glib::exception_handlers_invoke(); |
| 52 | } |
| 53 | |
| 54 | return false; |
| 55 | } |
| 56 | |
| 57 | static gboolean Registry_PluginFeature_Filter_gstreamermm_callback(GstPluginFeature* feature, void* data) |
| 58 | { |
| 59 | Gst::PluginFeature::SlotFilter* the_slot = static_cast<Gst::PluginFeature::SlotFilter*>(data); |
| 60 | |
| 61 | try |
| 62 | { |
| 63 | bool result = (*the_slot)(Glib::wrap(feature, true)); |
| 64 | return result; |
| 65 | } |
| 66 | catch(...) |
| 67 | { |
| 68 | Glib::exception_handlers_invoke(); |
| 69 | } |
| 70 | |
| 71 | return false; |
| 72 | } |
| 73 | |
| 74 | } // extern "C" |
| 75 | |
| 76 | } // anonymous namespace |
| 77 | |
| 78 | namespace Gst |
| 79 | { |
| 80 | |
| 81 | Glib::ListHandle< Glib::RefPtr<Gst::Plugin> > |
| 82 | Registry::get_plugin_list(const Plugin::SlotFilter& filter, bool first) |
| 83 | { |
| 84 | GList* list = gst_registry_plugin_filter(gobj(), |
| 85 | &Registry_Plugin_Filter_gstreamermm_callback, first, |
| 86 | const_cast<Plugin::SlotFilter*>(&filter)); |
| 87 | |
| 88 | return Glib::ListHandle< Glib::RefPtr<Gst::Plugin> >(list, |
| 89 | Glib::OWNERSHIP_DEEP); |
| 90 | } |
| 91 | |
| 92 | Glib::ListHandle< Glib::RefPtr<const Gst::Plugin> > |
| 93 | Registry::get_plugin_list(const Plugin::SlotFilter& filter, bool first) const |
| 94 | { |
| 95 | GList* list = gst_registry_plugin_filter(const_cast<GstRegistry*>(gobj()), |
| 96 | &Registry_Plugin_Filter_gstreamermm_callback, first, |
| 97 | const_cast<Plugin::SlotFilter*>(&filter)); |
| 98 | |
| 99 | return Glib::ListHandle< Glib::RefPtr<const Gst::Plugin> >(list, |
| 100 | Glib::OWNERSHIP_DEEP); |
| 101 | } |
| 102 | |
| 103 | Glib::ListHandle< Glib::RefPtr<Gst::PluginFeature> > |
| 104 | Registry::get_feature_list(const PluginFeature::SlotFilter& filter, bool first) |
| 105 | { |
| 106 | GList* list = gst_registry_feature_filter(gobj(), |
| 107 | &Registry_PluginFeature_Filter_gstreamermm_callback, first, |
| 108 | const_cast<PluginFeature::SlotFilter*>(&filter)); |
| 109 | |
| 110 | return Glib::ListHandle< Glib::RefPtr<Gst::PluginFeature> >(list, |
| 111 | Glib::OWNERSHIP_DEEP); |
| 112 | } |
| 113 | |
| 114 | Glib::ListHandle< Glib::RefPtr<const Gst::PluginFeature> > |
| 115 | Registry::get_feature_list(const PluginFeature::SlotFilter& filter, |
| 116 | bool first) const |
| 117 | { |
| 118 | GList* list = gst_registry_feature_filter(const_cast<GstRegistry*>(gobj()), |
| 119 | &Registry_PluginFeature_Filter_gstreamermm_callback, first, |
| 120 | const_cast<PluginFeature::SlotFilter*>(&filter)); |
| 121 | |
| 122 | return Glib::ListHandle< Glib::RefPtr<const Gst::PluginFeature> >(list, |
| 123 | Glib::OWNERSHIP_DEEP); |
| 124 | } |
| 125 | |
| 126 | Glib::RefPtr<Gst::Registry> |
| 127 | Registry::get() |
| 128 | { |
| 129 | return Glib::wrap(gst_registry_get(), true); |
| 130 | } |
| 131 | |
| 132 | void Registry::add_feature(const Glib::RefPtr<Gst::PluginFeature>& feature) |
| 133 | { |
| 134 | feature->reference(); |
| 135 | gst_registry_add_feature(gobj(), feature->gobj()); |
| 136 | } |
| 137 | |
| 138 | void Registry::add_plugin(const Glib::RefPtr<Gst::Plugin>& plugin) |
| 139 | { |
| 140 | plugin->reference(); |
| 141 | gst_registry_add_plugin(gobj(), plugin->gobj()); |
| 142 | } |
| 143 | |
| 144 | |
| 145 | } //namespace Gst |
| 146 | |
| 147 | namespace |
| 148 | { |
| 149 | } // anonymous namespace |
| 150 | |
| 151 | |
| 152 | namespace Glib |
| 153 | { |
| 154 | |
| 155 | Glib::RefPtr<Gst::Registry> wrap(GstRegistry* object, bool take_copy) |
| 156 | { |
| 157 | return Glib::RefPtr<Gst::Registry>( dynamic_cast<Gst::Registry*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); |
| 158 | //We use dynamic_cast<> in case of multiple inheritance. |
| 159 | } |
| 160 | |
| 161 | } /* namespace Glib */ |
| 162 | |
| 163 | |
| 164 | namespace Gst |
| 165 | { |
| 166 | |
| 167 | |
| 168 | /* The *_Class implementation: */ |
| 169 | |
| 170 | const Glib::Class& Registry_Class::init() |
| 171 | { |
| 172 | if(!gtype_) // create the GType if necessary |
| 173 | { |
| 174 | // Glib::Class has to know the class init function to clone custom types. |
| 175 | class_init_func_ = &Registry_Class::class_init_function; |
| 176 | |
| 177 | // This is actually just optimized away, apparently with no harm. |
| 178 | // Make sure that the parent type has been created. |
| 179 | //CppClassParent::CppObjectType::get_type(); |
| 180 | |
| 181 | // Create the wrapper type, with the same class/instance size as the base type. |
| 182 | register_derived_type(gst_registry_get_type()); |
| 183 | |
| 184 | // Add derived versions of interfaces, if the C type implements any interfaces: |
| 185 | |
| 186 | } |
| 187 | |
| 188 | return *this; |
| 189 | } |
| 190 | |
| 191 | |
| 192 | void Registry_Class::class_init_function(void* g_class, void* class_data) |
| 193 | { |
| 194 | const auto klass = static_cast<BaseClassType*>(g_class); |
| 195 | CppClassParent::class_init_function(klass, class_data); |
| 196 | |
| 197 | |
| 198 | } |
| 199 | |
| 200 | |
| 201 | Glib::ObjectBase* Registry_Class::wrap_new(GObject* object) |
| 202 | { |
| 203 | return new Registry((GstRegistry*)object); |
| 204 | } |
| 205 | |
| 206 | |
| 207 | /* The implementation: */ |
| 208 | |
| 209 | GstRegistry* Registry::gobj_copy() |
| 210 | { |
| 211 | reference(); |
| 212 | return gobj(); |
| 213 | } |
| 214 | |
| 215 | Registry::Registry(const Glib::ConstructParams& construct_params) |
| 216 | : |
| 217 | Gst::Object(construct_params) |
| 218 | { |
| 219 | |
| 220 | } |
| 221 | |
| 222 | Registry::Registry(GstRegistry* castitem) |
| 223 | : |
| 224 | Gst::Object((GstObject*)(castitem)) |
| 225 | {} |
| 226 | |
| 227 | |
| 228 | Registry::Registry(Registry&& src) noexcept |
| 229 | : Gst::Object(std::move(src)) |
| 230 | {} |
| 231 | |
| 232 | Registry& Registry::operator=(Registry&& src) noexcept |
| 233 | { |
| 234 | Gst::Object::operator=(std::move(src)); |
| 235 | return *this; |
| 236 | } |
| 237 | |
| 238 | |
| 239 | Registry::~Registry() noexcept |
| 240 | {} |
| 241 | |
| 242 | |
| 243 | Registry::CppClassType Registry::registry_class_; // initialize static member |
| 244 | |
| 245 | GType Registry::get_type() |
| 246 | { |
| 247 | return registry_class_.init().get_type(); |
| 248 | } |
| 249 | |
| 250 | |
| 251 | GType Registry::get_base_type() |
| 252 | { |
| 253 | return gst_registry_get_type(); |
| 254 | } |
| 255 | |
| 256 | |
| 257 | Glib::ListHandle< Glib::RefPtr<Gst::PluginFeature> > Registry::get_feature_list(GType type) |
| 258 | { |
| 259 | return Glib::ListHandle< Glib::RefPtr<Gst::PluginFeature> >(gst_registry_get_feature_list(gobj(), type), Glib::OWNERSHIP_DEEP); |
| 260 | } |
| 261 | |
| 262 | Glib::ListHandle< Glib::RefPtr<const Gst::PluginFeature> > Registry::get_feature_list(GType type) const |
| 263 | { |
| 264 | return Glib::ListHandle< Glib::RefPtr<const Gst::PluginFeature> >(gst_registry_get_feature_list(const_cast<GstRegistry*>(gobj()), type), Glib::OWNERSHIP_DEEP); |
| 265 | } |
| 266 | |
| 267 | guint32 Registry::get_feature_list_cookie() const |
| 268 | { |
| 269 | return gst_registry_get_feature_list_cookie(const_cast<GstRegistry*>(gobj())); |
| 270 | } |
| 271 | |
| 272 | Glib::ListHandle< Glib::RefPtr<Gst::PluginFeature> > Registry::get_feature_list(const Glib::ustring& name) |
| 273 | { |
| 274 | return Glib::ListHandle< Glib::RefPtr<Gst::PluginFeature> >(gst_registry_get_feature_list_by_plugin(gobj(), name.c_str()), Glib::OWNERSHIP_DEEP); |
| 275 | } |
| 276 | |
| 277 | Glib::ListHandle< Glib::RefPtr<const Gst::PluginFeature> > Registry::get_feature_list(const Glib::ustring& name) const |
| 278 | { |
| 279 | return Glib::ListHandle< Glib::RefPtr<const Gst::PluginFeature> >(gst_registry_get_feature_list_by_plugin(const_cast<GstRegistry*>(gobj()), name.c_str()), Glib::OWNERSHIP_DEEP); |
| 280 | } |
| 281 | |
| 282 | Glib::ListHandle< Glib::RefPtr<Gst::Plugin> > Registry::get_plugin_list() |
| 283 | { |
| 284 | return Glib::ListHandle< Glib::RefPtr<Gst::Plugin> >(gst_registry_get_plugin_list(gobj()), Glib::OWNERSHIP_DEEP); |
| 285 | } |
| 286 | |
| 287 | Glib::ListHandle< Glib::RefPtr<const Gst::Plugin> > Registry::get_plugin_list() const |
| 288 | { |
| 289 | return Glib::ListHandle< Glib::RefPtr<const Gst::Plugin> >(gst_registry_get_plugin_list(const_cast<GstRegistry*>(gobj())), Glib::OWNERSHIP_DEEP); |
| 290 | } |
| 291 | |
| 292 | void Registry::remove_plugin(const Glib::RefPtr<Gst::Plugin>& plugin) |
| 293 | { |
| 294 | gst_registry_remove_plugin(gobj(), Glib::unwrap(plugin)); |
| 295 | } |
| 296 | |
| 297 | bool Registry::add_plugin(Glib::RefPtr<Gst::Plugin>&& plugin) |
| 298 | { |
| 299 | return gst_registry_add_plugin(gobj(), (plugin) ? plugin.release()->gobj() : nullptr); |
| 300 | } |
| 301 | |
| 302 | Glib::RefPtr<Gst::Plugin> Registry::find_plugin(const Glib::ustring& name) |
| 303 | { |
| 304 | return Glib::wrap(gst_registry_find_plugin(gobj(), name.c_str())); |
| 305 | } |
| 306 | |
| 307 | Glib::RefPtr<const Gst::Plugin> Registry::find_plugin(const Glib::ustring& name) const |
| 308 | { |
| 309 | return const_cast<Registry*>(this)->find_plugin(name); |
| 310 | } |
| 311 | |
| 312 | Glib::RefPtr<Gst::PluginFeature> Registry::find_feature(const Glib::ustring& name, GType type) |
| 313 | { |
| 314 | return Glib::wrap(gst_registry_find_feature(gobj(), name.c_str(), type)); |
| 315 | } |
| 316 | |
| 317 | Glib::RefPtr<const Gst::PluginFeature> Registry::find_feature(const Glib::ustring& name, GType type) const |
| 318 | { |
| 319 | return const_cast<Registry*>(this)->find_feature(name, type); |
| 320 | } |
| 321 | |
| 322 | Glib::RefPtr<Gst::PluginFeature> Registry::lookup_feature(const Glib::ustring& name) |
| 323 | { |
| 324 | return Glib::wrap(gst_registry_lookup_feature(gobj(), name.c_str())); |
| 325 | } |
| 326 | |
| 327 | Glib::RefPtr<const Gst::PluginFeature> Registry::lookup_feature(const Glib::ustring& name) const |
| 328 | { |
| 329 | return const_cast<Registry*>(this)->lookup_feature(name); |
| 330 | } |
| 331 | |
| 332 | bool Registry::scan_path(const Glib::ustring& path) |
| 333 | { |
| 334 | return gst_registry_scan_path(gobj(), path.c_str()); |
| 335 | } |
| 336 | |
| 337 | Glib::RefPtr<Gst::Plugin> Registry::lookup(const Glib::ustring& filename) |
| 338 | { |
| 339 | return Glib::wrap(gst_registry_lookup(gobj(), filename.c_str())); |
| 340 | } |
| 341 | |
| 342 | Glib::RefPtr<const Gst::Plugin> Registry::lookup(const Glib::ustring& filename) const |
| 343 | { |
| 344 | return const_cast<Registry*>(this)->lookup(filename); |
| 345 | } |
| 346 | |
| 347 | void Registry::remove_feature(const Glib::RefPtr<Gst::PluginFeature>& feature) |
| 348 | { |
| 349 | gst_registry_remove_feature(gobj(), Glib::unwrap(feature)); |
| 350 | } |
| 351 | |
| 352 | void Registry::add_feature(Glib::RefPtr<Gst::PluginFeature>&& feature) |
| 353 | { |
| 354 | gst_registry_add_feature(gobj(), (feature) ? feature.release()->gobj() : nullptr); |
| 355 | } |
| 356 | |
| 357 | bool Registry::check_feature_version(const Glib::ustring& feature_name, guint min_major, guint min_minor, guint min_micro) |
| 358 | { |
| 359 | return gst_registry_check_feature_version(gobj(), feature_name.c_str(), min_major, min_minor, min_micro); |
| 360 | } |
| 361 | |
| 362 | |
| 363 | } // namespace Gst |
| 364 | |
| 365 |