| 1 |
/* gstreamermm - a C++ wrapper for gstreamer |
| 2 |
* |
| 3 |
* Copyright 2008-2016 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/structure.h> |
| 22 |
_PINCLUDE(gstreamermm/private/object_p.h) |
| 23 |
|
| 24 |
namespace |
| 25 |
{ |
| 26 |
|
| 27 |
extern "C" |
| 28 |
{ |
| 29 |
|
| 30 |
gboolean Plugin_Init_gstreamermm_callback(GstPlugin* plugin, void* data) |
| 31 |
{ |
| 32 |
Gst::Plugin::SlotInit* the_slot = static_cast<Gst::Plugin::SlotInit*>(data); |
| 33 |
bool result = false; |
| 34 |
|
| 35 |
try |
| 36 |
{ |
| 37 |
result = (*the_slot)(Glib::wrap(plugin, true)); |
| 38 |
delete the_slot; |
| 39 |
return result; |
| 40 |
} |
| 41 |
catch(...) |
| 42 |
{ |
| 43 |
Glib::exception_handlers_invoke(); |
| 44 |
} |
| 45 |
|
| 46 |
return false; |
| 47 |
} |
| 48 |
|
| 49 |
} // extern "C" |
| 50 |
|
| 51 |
} // anonymous namespace |
| 52 |
|
| 53 |
namespace Gst |
| 54 |
{ |
| 55 |
|
| 56 |
bool Plugin::register_static(int major_version, int minor_version, |
| 57 |
const Glib::ustring& name, const Glib::ustring& description, |
| 58 |
const SlotInit& init_slot, const Glib::ustring& version, |
| 59 |
const Glib::ustring& license, const Glib::ustring& source, |
| 60 |
const Glib::ustring& package, const Glib::ustring& origin) |
| 61 |
{ |
| 62 |
SlotInit* slot_copy = new SlotInit(init_slot); |
| 63 |
|
| 64 |
return gst_plugin_register_static_full(major_version, minor_version, |
| 65 |
name.c_str(), const_cast<char*>(description.c_str()), |
| 66 |
&Plugin_Init_gstreamermm_callback, version.c_str(), license.c_str(), |
| 67 |
source.c_str(), package.c_str(), origin.c_str(), slot_copy); |
| 68 |
} |
| 69 |
|
| 70 |
} //namespace Gst |