| 1 |
/* gstreamermm - a C++ wrapper for gstreamer |
| 2 |
* |
| 3 |
* Copyright 2009 The gstreamermm Development Team |
| 4 |
* |
| 5 |
* This library is free software; you can redistribute it and/or |
| 6 |
* modify it under the terms of the GNU Lesser General Public |
| 7 |
* License as published by the Free Software Foundation; either |
| 8 |
* version 2.1 of the License, or (at your option) any later version. |
| 9 |
* |
| 10 |
* This library is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
* Lesser General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU Lesser General Public |
| 16 |
* License along with this library; if not, write to the Free |
| 17 |
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 18 |
*/ |
| 19 |
|
| 20 |
#include <gst/gst.h> |
| 21 |
#include <gstreamermm/caps.h> |
| 22 |
#include <gstreamermm/plugin.h> |
| 23 |
|
| 24 |
namespace |
| 25 |
{ |
| 26 |
|
| 27 |
extern "C" |
| 28 |
{ |
| 29 |
|
| 30 |
static void TypeFind_Find_gstreamermm_callback(GstTypeFind*, void* data) |
| 31 |
{ |
| 32 |
Gst::TypeFind::SlotFind& slot_find = *static_cast<Gst::TypeFind::SlotFind*>(data); |
| 33 |
|
| 34 |
try |
| 35 |
{ |
| 36 |
slot_find(); |
| 37 |
} |
| 38 |
catch (...) |
| 39 |
{ |
| 40 |
Glib::exception_handlers_invoke(); |
| 41 |
} |
| 42 |
} |
| 43 |
|
| 44 |
static void TypeFind_Find_gstreamermm_callback_destroy(void* data) |
| 45 |
{ |
| 46 |
delete static_cast<Gst::TypeFind::SlotFind*>(data); |
| 47 |
} |
| 48 |
|
| 49 |
} // extern "C" |
| 50 |
|
| 51 |
} // anonymous namespace |
| 52 |
|
| 53 |
namespace Gst |
| 54 |
{ |
| 55 |
|
| 56 |
bool TypeFind::register_slot(const Glib::RefPtr<Gst::Plugin>& plugin, |
| 57 |
const Glib::ustring& name, guint rank, const SlotFind& find_slot, |
| 58 |
const Glib::StringArrayHandle& extensions, |
| 59 |
const Glib::RefPtr<const Gst::Caps>& caps) |
| 60 |
{ |
| 61 |
SlotFind* slot_copy = new SlotFind(find_slot); |
| 62 |
return gst_type_find_register(Glib::unwrap(plugin), name.c_str(), rank, |
| 63 |
&TypeFind_Find_gstreamermm_callback, |
| 64 |
(gchar*)extensions.data(), const_cast<GstCaps*>(Glib::unwrap(caps)), slot_copy, |
| 65 |
&TypeFind_Find_gstreamermm_callback_destroy); |
| 66 |
} |
| 67 |
|
| 68 |
bool TypeFind::register_slot(const Glib::RefPtr<Gst::Plugin>& plugin, |
| 69 |
const Glib::ustring& name, guint rank, const SlotFind& find_slot, |
| 70 |
const Glib::RefPtr<const Gst::Caps>& caps) |
| 71 |
{ |
| 72 |
SlotFind* slot_copy = new SlotFind(find_slot); |
| 73 |
return gst_type_find_register(Glib::unwrap(plugin), name.c_str(), rank, |
| 74 |
&TypeFind_Find_gstreamermm_callback, nullptr, const_cast<GstCaps*>(Glib::unwrap(caps)), slot_copy, |
| 75 |
&TypeFind_Find_gstreamermm_callback_destroy); |
| 76 |
} |
| 77 |
|
| 78 |
bool TypeFind::register_slot(const Glib::RefPtr<Gst::Plugin>& plugin, |
| 79 |
const Glib::ustring& name, guint rank, const SlotFind& find_slot, |
| 80 |
const Glib::StringArrayHandle& extensions) |
| 81 |
{ |
| 82 |
SlotFind* slot_copy = new SlotFind(find_slot); |
| 83 |
return gst_type_find_register(Glib::unwrap(plugin), name.c_str(), rank, |
| 84 |
&TypeFind_Find_gstreamermm_callback, |
| 85 |
(gchar*)extensions.data(), nullptr, slot_copy, |
| 86 |
&TypeFind_Find_gstreamermm_callback_destroy); |
| 87 |
} |
| 88 |
|
| 89 |
bool TypeFind::register_slot(const Glib::RefPtr<Gst::Plugin>& plugin, |
| 90 |
const Glib::ustring& name, guint rank, const SlotFind& find_slot) |
| 91 |
{ |
| 92 |
SlotFind* slot_copy = new SlotFind(find_slot); |
| 93 |
return gst_type_find_register(Glib::unwrap(plugin), name.c_str(), rank, |
| 94 |
&TypeFind_Find_gstreamermm_callback, nullptr, nullptr, slot_copy, |
| 95 |
&TypeFind_Find_gstreamermm_callback_destroy); |
| 96 |
} |
| 97 |
|
| 98 |
bool TypeFind::register_slot(const Glib::ustring& name, guint rank, |
| 99 |
const SlotFind& find_slot, const Glib::StringArrayHandle& extensions, |
| 100 |
const Glib::RefPtr<const Gst::Caps>& caps) |
| 101 |
{ |
| 102 |
SlotFind* slot_copy = new SlotFind(find_slot); |
| 103 |
return gst_type_find_register(nullptr, name.c_str(), rank, |
| 104 |
&TypeFind_Find_gstreamermm_callback, |
| 105 |
(gchar*)extensions.data(), const_cast<GstCaps*>(Glib::unwrap(caps)), slot_copy, |
| 106 |
&TypeFind_Find_gstreamermm_callback_destroy); |
| 107 |
} |
| 108 |
|
| 109 |
bool TypeFind::register_slot(const Glib::ustring& name, guint rank, |
| 110 |
const SlotFind& find_slot, const Glib::RefPtr<const Gst::Caps>& caps) |
| 111 |
{ |
| 112 |
SlotFind* slot_copy = new SlotFind(find_slot); |
| 113 |
return gst_type_find_register(nullptr, name.c_str(), rank, |
| 114 |
&TypeFind_Find_gstreamermm_callback, nullptr, const_cast<GstCaps*>(Glib::unwrap(caps)), slot_copy, |
| 115 |
&TypeFind_Find_gstreamermm_callback_destroy); |
| 116 |
} |
| 117 |
|
| 118 |
bool TypeFind::register_slot(const Glib::ustring& name, guint rank, |
| 119 |
const SlotFind& find_slot, const Glib::StringArrayHandle& extensions) |
| 120 |
{ |
| 121 |
SlotFind* slot_copy = new SlotFind(find_slot); |
| 122 |
return gst_type_find_register(nullptr, name.c_str(), rank, |
| 123 |
&TypeFind_Find_gstreamermm_callback, |
| 124 |
(gchar*)extensions.data(), nullptr, slot_copy, |
| 125 |
&TypeFind_Find_gstreamermm_callback_destroy); |
| 126 |
} |
| 127 |
|
| 128 |
bool TypeFind::register_slot(const Glib::ustring& name, guint rank, |
| 129 |
const SlotFind& find_slot) |
| 130 |
{ |
| 131 |
SlotFind* slot_copy = new SlotFind(find_slot); |
| 132 |
return gst_type_find_register(nullptr, name.c_str(), rank, |
| 133 |
&TypeFind_Find_gstreamermm_callback, nullptr, nullptr, slot_copy, |
| 134 |
&TypeFind_Find_gstreamermm_callback_destroy); |
| 135 |
} |
| 136 |
|
| 137 |
} // namespace Gst |