/* gstreamermm - a C++ wrapper for gstreamer * * Copyright 2009 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 namespace { extern "C" { static void TypeFind_Find_gstreamermm_callback(GstTypeFind*, void* data) { Gst::TypeFind::SlotFind& slot_find = *static_cast(data); try { slot_find(); } catch (...) { Glib::exception_handlers_invoke(); } } static void TypeFind_Find_gstreamermm_callback_destroy(void* data) { delete static_cast(data); } } // extern "C" } // anonymous namespace namespace Gst { bool TypeFind::register_slot(const Glib::RefPtr& plugin, const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::StringArrayHandle& extensions, const Glib::RefPtr& caps) { SlotFind* slot_copy = new SlotFind(find_slot); return gst_type_find_register(Glib::unwrap(plugin), name.c_str(), rank, &TypeFind_Find_gstreamermm_callback, (gchar*)extensions.data(), const_cast(Glib::unwrap(caps)), slot_copy, &TypeFind_Find_gstreamermm_callback_destroy); } bool TypeFind::register_slot(const Glib::RefPtr& plugin, const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::RefPtr& caps) { SlotFind* slot_copy = new SlotFind(find_slot); return gst_type_find_register(Glib::unwrap(plugin), name.c_str(), rank, &TypeFind_Find_gstreamermm_callback, nullptr, const_cast(Glib::unwrap(caps)), slot_copy, &TypeFind_Find_gstreamermm_callback_destroy); } bool TypeFind::register_slot(const Glib::RefPtr& plugin, const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::StringArrayHandle& extensions) { SlotFind* slot_copy = new SlotFind(find_slot); return gst_type_find_register(Glib::unwrap(plugin), name.c_str(), rank, &TypeFind_Find_gstreamermm_callback, (gchar*)extensions.data(), nullptr, slot_copy, &TypeFind_Find_gstreamermm_callback_destroy); } bool TypeFind::register_slot(const Glib::RefPtr& plugin, const Glib::ustring& name, guint rank, const SlotFind& find_slot) { SlotFind* slot_copy = new SlotFind(find_slot); return gst_type_find_register(Glib::unwrap(plugin), name.c_str(), rank, &TypeFind_Find_gstreamermm_callback, nullptr, nullptr, slot_copy, &TypeFind_Find_gstreamermm_callback_destroy); } bool TypeFind::register_slot(const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::StringArrayHandle& extensions, const Glib::RefPtr& caps) { SlotFind* slot_copy = new SlotFind(find_slot); return gst_type_find_register(nullptr, name.c_str(), rank, &TypeFind_Find_gstreamermm_callback, (gchar*)extensions.data(), const_cast(Glib::unwrap(caps)), slot_copy, &TypeFind_Find_gstreamermm_callback_destroy); } bool TypeFind::register_slot(const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::RefPtr& caps) { SlotFind* slot_copy = new SlotFind(find_slot); return gst_type_find_register(nullptr, name.c_str(), rank, &TypeFind_Find_gstreamermm_callback, nullptr, const_cast(Glib::unwrap(caps)), slot_copy, &TypeFind_Find_gstreamermm_callback_destroy); } bool TypeFind::register_slot(const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::StringArrayHandle& extensions) { SlotFind* slot_copy = new SlotFind(find_slot); return gst_type_find_register(nullptr, name.c_str(), rank, &TypeFind_Find_gstreamermm_callback, (gchar*)extensions.data(), nullptr, slot_copy, &TypeFind_Find_gstreamermm_callback_destroy); } bool TypeFind::register_slot(const Glib::ustring& name, guint rank, const SlotFind& find_slot) { SlotFind* slot_copy = new SlotFind(find_slot); return gst_type_find_register(nullptr, name.c_str(), rank, &TypeFind_Find_gstreamermm_callback, nullptr, nullptr, slot_copy, &TypeFind_Find_gstreamermm_callback_destroy); } } // namespace Gst