// Generated by gtkmmproc -- DO NOT MODIFY!


#include <gstreamermm/typefind.h>
#include <gstreamermm/private/typefind_p.h>

/* 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 <gst/gstenumtypes.h>
#include <gst/gsttypefind.h>
#include <gstreamermm/caps.h>
#include <gstreamermm/plugin.h>

namespace
{

extern "C"
{

static void TypeFind_Find_gstreamermm_callback(GstTypeFind*, void* data)
{
  Gst::TypeFind::SlotFind& slot_find = *static_cast<Gst::TypeFind::SlotFind*>(data);

#ifdef GLIBMM_EXCEPTIONS_ENABLED
  try
#endif
  {
    slot_find();
  }
#ifdef GLIBMM_EXCEPTIONS_ENABLED
  catch (...)
  {
    Glib::exception_handlers_invoke();
  }
#endif
}

static void TypeFind_Find_gstreamermm_callback_destroy(void* data)
{
  delete static_cast<Gst::TypeFind::SlotFind*>(data);
}

} // extern "C"

} // anonymous namespace

namespace Gst
{

bool TypeFind::register_slot(const Glib::RefPtr<Gst::Plugin>& plugin,
  const Glib::ustring& name, guint rank, const SlotFind& find_slot,
  const Glib::StringArrayHandle& extensions,
  const Glib::RefPtr<const Gst::Caps>& caps)
{
  SlotFind* slot_copy = new SlotFind(find_slot);
  return gst_type_find_register(Glib::unwrap(plugin), name.c_str(), rank,
    &TypeFind_Find_gstreamermm_callback,
    const_cast<gchar**>(extensions.data()), Glib::unwrap(caps), slot_copy,
    &TypeFind_Find_gstreamermm_callback_destroy);
}

bool TypeFind::register_slot(const Glib::RefPtr<Gst::Plugin>& plugin,
  const Glib::ustring& name, guint rank, const SlotFind& find_slot,
  const Glib::RefPtr<const Gst::Caps>& caps)
{
  SlotFind* slot_copy = new SlotFind(find_slot);
  return gst_type_find_register(Glib::unwrap(plugin), name.c_str(), rank,
    &TypeFind_Find_gstreamermm_callback, 0, Glib::unwrap(caps), slot_copy,
    &TypeFind_Find_gstreamermm_callback_destroy);
}

bool TypeFind::register_slot(const Glib::RefPtr<Gst::Plugin>& 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,
    const_cast<gchar**>(extensions.data()), 0, slot_copy,
    &TypeFind_Find_gstreamermm_callback_destroy);
}

bool TypeFind::register_slot(const Glib::RefPtr<Gst::Plugin>& 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, 0, 0, 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<const Gst::Caps>& caps)
{
  SlotFind* slot_copy = new SlotFind(find_slot);
  return gst_type_find_register(0, name.c_str(), rank,
    &TypeFind_Find_gstreamermm_callback,
    const_cast<gchar**>(extensions.data()), 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<const Gst::Caps>& caps)
{
  SlotFind* slot_copy = new SlotFind(find_slot);
  return gst_type_find_register(0, name.c_str(), rank,
    &TypeFind_Find_gstreamermm_callback, 0, 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(0, name.c_str(), rank,
    &TypeFind_Find_gstreamermm_callback,
    const_cast<gchar**>(extensions.data()), 0, 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(0, name.c_str(), rank,
    &TypeFind_Find_gstreamermm_callback, 0, 0, slot_copy,
    &TypeFind_Find_gstreamermm_callback_destroy);
}

} // namespace Gst

namespace
{
} // anonymous namespace

// static
GType Glib::Value<Gst::TypeFindProbability>::value_type()
{
  return gst_type_find_probability_get_type();
}


namespace Glib
{

Gst::TypeFind& wrap(GstTypeFind* object)
{
  return *reinterpret_cast<Gst::TypeFind*>(object);
}

const Gst::TypeFind& wrap(const GstTypeFind* object)
{
  return *reinterpret_cast<const Gst::TypeFind*>(object);
}

} // namespace Glib


namespace Gst
{


// static
GType TypeFind::get_type()
{
  return gst_type_find_get_type();
}

TypeFind::TypeFind()
{
  GLIBMM_INITIALIZE_STRUCT(gobject_, GstTypeFind);
}

TypeFind::TypeFind(const GstTypeFind* gobject)
{
  if(gobject)
    gobject_ = *gobject;
  else
    GLIBMM_INITIALIZE_STRUCT(gobject_, GstTypeFind);
}


Glib::ArrayHandle<guint8> TypeFind::peek(gint64 offset, guint size) const
{
  return Glib::ArrayHandle<guint8>((gst_type_find_peek(const_cast<GstTypeFind*>(gobj()), offset, size)), Glib::OWNERSHIP_NONE);
}

void TypeFind::suggest(guint probability, const Glib::RefPtr<const Gst::Caps>& caps) const
{
gst_type_find_suggest(const_cast<GstTypeFind*>(gobj()), probability, Glib::unwrap(caps)); 
}

guint64 TypeFind::get_length() const
{
  return gst_type_find_get_length(const_cast<GstTypeFind*>(gobj()));
}


} // namespace Gst


