// Generated by gmmproc 2.39.93 -- DO NOT MODIFY!


#include <glibmm.h>

#include <gstreamermm/appsink.h>
#include <gstreamermm/private/appsink_p.h>


// Generated by generate_plugin_gmmproc_file. Don't edit this file.


extern "C"
{

GType gst_app_sink_gstreamermm_get_type()
{
  static GType type = 0;
  GstElementFactory* factory = 0;
  GstPluginFeature* feature = 0;

  if(!type)
  {
    factory = gst_element_factory_find("appsink");
    // Make sure that the feature is actually loaded:
    if(factory)
    {
      feature =
        gst_plugin_feature_load(GST_PLUGIN_FEATURE(factory));

      g_object_unref(factory);
      factory = GST_ELEMENT_FACTORY(feature);
      type = gst_element_factory_get_element_type(factory);
      g_object_unref(factory);

      // Register the new type with wrapping system
      Glib::wrap_register(type, &Gst::AppSink_Class::wrap_new);
    }
  }

  return type;
}

} // extern "C"

namespace Gst
{

AppSink::AppSink()
: // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Gst::BaseSink(Glib::ConstructParams(appsink_class_.init(), "name",static_cast<char*>(0), static_cast<char*>(0)))
{}

AppSink::AppSink(const Glib::ustring& name)
: // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Gst::BaseSink(Glib::ConstructParams(appsink_class_.init(), "name",name.c_str(), static_cast<char*>(0)))
{}

Glib::RefPtr<Gst::Sample> AppSink::pull_preroll()
{
  GstSample* result;
  g_signal_emit_by_name(gobj(), "pull-preroll", &result, static_cast<void*>(0));
  return Glib::wrap(result);
}

Glib::RefPtr<Gst::Sample> AppSink::pull_sample()
{
  GstSample* result;
  g_signal_emit_by_name(gobj(), "pull-sample", &result, static_cast<void*>(0));
  return Glib::wrap(result);
}

}
namespace Glib
{

Glib::RefPtr<Gst::AppSink> wrap(GstAppSink* object, bool take_copy)
{
  static bool registered_wrap_new = false;
  if(!registered_wrap_new)
  {
    // Call get *_get_type() function which does the registration.
    gst_app_sink_gstreamermm_get_type();
    registered_wrap_new = true;
  }

  return Glib::RefPtr<Gst::AppSink>( dynamic_cast<Gst::AppSink*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
}

}

namespace
{


static const Glib::SignalProxyInfo AppSink_signal_eos_info =
{
  "eos",
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
};


static GstFlowReturn AppSink_signal_new_preroll_callback(GstAppSink* self, void* data)
{
  using namespace Gst;
  typedef sigc::slot< Gst::FlowReturn > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        return ((GstFlowReturn)((*static_cast<SlotType*>(slot))()));
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }

  typedef GstFlowReturn RType;
  return RType();
}

static GstFlowReturn AppSink_signal_new_preroll_notify_callback(GstAppSink* self,  void* data)
{
  using namespace Gst;
  typedef sigc::slot< void > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))();
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }

  typedef GstFlowReturn RType;
  return RType();
}

static const Glib::SignalProxyInfo AppSink_signal_new_preroll_info =
{
  "new-preroll",
  (GCallback) &AppSink_signal_new_preroll_callback,
  (GCallback) &AppSink_signal_new_preroll_notify_callback
};


static GstFlowReturn AppSink_signal_new_sample_callback(GstAppSink* self, void* data)
{
  using namespace Gst;
  typedef sigc::slot< Gst::FlowReturn > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        return ((GstFlowReturn)((*static_cast<SlotType*>(slot))()));
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }

  typedef GstFlowReturn RType;
  return RType();
}

static GstFlowReturn AppSink_signal_new_sample_notify_callback(GstAppSink* self,  void* data)
{
  using namespace Gst;
  typedef sigc::slot< void > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))();
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }

  typedef GstFlowReturn RType;
  return RType();
}

static const Glib::SignalProxyInfo AppSink_signal_new_sample_info =
{
  "new-sample",
  (GCallback) &AppSink_signal_new_sample_callback,
  (GCallback) &AppSink_signal_new_sample_notify_callback
};


static GstSample* AppSink_signal_pull_preroll_callback(GstAppSink* self, void* data)
{
  using namespace Gst;
  typedef sigc::slot< Glib::RefPtr<Gst::Sample> > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        return ((*static_cast<SlotType*>(slot))())->gobj_copy();
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }

  typedef GstSample* RType;
  return RType();
}

static GstSample* AppSink_signal_pull_preroll_notify_callback(GstAppSink* self,  void* data)
{
  using namespace Gst;
  typedef sigc::slot< void > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))();
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }

  typedef GstSample* RType;
  return RType();
}

static const Glib::SignalProxyInfo AppSink_signal_pull_preroll_info =
{
  "pull-preroll",
  (GCallback) &AppSink_signal_pull_preroll_callback,
  (GCallback) &AppSink_signal_pull_preroll_notify_callback
};


static GstSample* AppSink_signal_pull_sample_callback(GstAppSink* self, void* data)
{
  using namespace Gst;
  typedef sigc::slot< Glib::RefPtr<Gst::Sample> > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        return ((*static_cast<SlotType*>(slot))())->gobj_copy();
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }

  typedef GstSample* RType;
  return RType();
}

static GstSample* AppSink_signal_pull_sample_notify_callback(GstAppSink* self,  void* data)
{
  using namespace Gst;
  typedef sigc::slot< void > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))();
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }

  typedef GstSample* RType;
  return RType();
}

static const Glib::SignalProxyInfo AppSink_signal_pull_sample_info =
{
  "pull-sample",
  (GCallback) &AppSink_signal_pull_sample_callback,
  (GCallback) &AppSink_signal_pull_sample_notify_callback
};


} // anonymous namespace


namespace Gst
{


/* The *_Class implementation: */

const Glib::Class& AppSink_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Class has to know the class init function to clone custom types.
    class_init_func_ = &AppSink_Class::class_init_function;

    // This is actually just optimized away, apparently with no harm.
    // Make sure that the parent type has been created.
    //CppClassParent::CppObjectType::get_type();

    // Create the wrapper type, with the same class/instance size as the base type.
    register_derived_type(gst_app_sink_gstreamermm_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:
  Gst::URIHandler::add_interface(get_type());

  }

  return *this;
}


void AppSink_Class::class_init_function(void* g_class, void* class_data)
{
  BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
  CppClassParent::class_init_function(klass, class_data);


}


Glib::ObjectBase* AppSink_Class::wrap_new(GObject* object)
{
  return new AppSink((GstAppSink*)object);
}


/* The implementation: */

GstAppSink* AppSink::gobj_copy()
{
  reference();
  return gobj();
}

AppSink::AppSink(const Glib::ConstructParams& construct_params)
:
  Gst::BaseSink(construct_params)
{

}

AppSink::AppSink(GstAppSink* castitem)
:
  Gst::BaseSink((GstBaseSink*)(castitem))
{}


AppSink::~AppSink()
{}


AppSink::CppClassType AppSink::appsink_class_; // initialize static member

GType AppSink::get_type()
{
  return appsink_class_.init().get_type();
}


GType AppSink::get_base_type()
{
  return gst_app_sink_gstreamermm_get_type();
}


Glib::RefPtr<AppSink> AppSink::create()
{
  return Glib::RefPtr<AppSink>( new AppSink() );
}

Glib::RefPtr<AppSink> AppSink::create(const Glib::ustring& name)
{
  return Glib::RefPtr<AppSink>( new AppSink(name) );
}


Glib::SignalProxy0< void > AppSink::signal_eos()
{
  return Glib::SignalProxy0< void >(this, &AppSink_signal_eos_info);
}


Glib::SignalProxy0< Gst::FlowReturn > AppSink::signal_new_preroll()
{
  return Glib::SignalProxy0< Gst::FlowReturn >(this, &AppSink_signal_new_preroll_info);
}


Glib::SignalProxy0< Gst::FlowReturn > AppSink::signal_new_sample()
{
  return Glib::SignalProxy0< Gst::FlowReturn >(this, &AppSink_signal_new_sample_info);
}


Glib::SignalProxy0< Glib::RefPtr<Gst::Sample> > AppSink::signal_pull_preroll()
{
  return Glib::SignalProxy0< Glib::RefPtr<Gst::Sample> >(this, &AppSink_signal_pull_preroll_info);
}


Glib::SignalProxy0< Glib::RefPtr<Gst::Sample> > AppSink::signal_pull_sample()
{
  return Glib::SignalProxy0< Glib::RefPtr<Gst::Sample> >(this, &AppSink_signal_pull_sample_info);
}


#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< Glib::RefPtr<Gst::Caps> > AppSink::property_caps() 
{
  return Glib::PropertyProxy< Glib::RefPtr<Gst::Caps> >(this, "caps");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gst::Caps> > AppSink::property_caps() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gst::Caps> >(this, "caps");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< bool > AppSink::property_eos() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "eos");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< bool > AppSink::property_emit_signals() 
{
  return Glib::PropertyProxy< bool >(this, "emit-signals");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< bool > AppSink::property_emit_signals() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "emit-signals");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< guint > AppSink::property_max_buffers() 
{
  return Glib::PropertyProxy< guint >(this, "max-buffers");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< guint > AppSink::property_max_buffers() const
{
  return Glib::PropertyProxy_ReadOnly< guint >(this, "max-buffers");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< bool > AppSink::property_drop() 
{
  return Glib::PropertyProxy< bool >(this, "drop");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< bool > AppSink::property_drop() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "drop");
}
#endif //GLIBMM_PROPERTIES_ENABLED


} // namespace Gst


