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


#include <gstreamermmconfig.h>
#ifndef GSTREAMERMM_DISABLE_DEPRECATED


#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);
    }
  }

  return type;
}

} // extern "C"

namespace Gst
{

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

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

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);
}

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

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

}

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;
  using SlotType = sigc::slot< Gst::FlowReturn >;

  auto obj = dynamic_cast<AppSink*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        return ((GstFlowReturn)((*static_cast<SlotType*>(slot))()));
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }

  using RType = GstFlowReturn;
  return RType();
}

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

  auto obj = dynamic_cast<AppSink*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))();
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
  }

  using RType = GstFlowReturn;
  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;
  using SlotType = sigc::slot< Gst::FlowReturn >;

  auto obj = dynamic_cast<AppSink*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        return ((GstFlowReturn)((*static_cast<SlotType*>(slot))()));
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }

  using RType = GstFlowReturn;
  return RType();
}

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

  auto obj = dynamic_cast<AppSink*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))();
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
  }

  using RType = GstFlowReturn;
  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;
  using SlotType = sigc::slot< Glib::RefPtr<Gst::Sample> >;

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

  using RType = GstSample*;
  return RType();
}

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

  auto obj = dynamic_cast<AppSink*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))();
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
  }

  using RType = GstSample*;
  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;
  using SlotType = sigc::slot< Glib::RefPtr<Gst::Sample> >;

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

  using RType = GstSample*;
  return RType();
}

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

  auto obj = dynamic_cast<AppSink*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))();
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
  }

  using RType = GstSample*;
  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 Glib
{

Glib::RefPtr<Gst::AppSink> wrap(GstAppSink* object, bool take_copy)
{
  return Glib::RefPtr<Gst::AppSink>( dynamic_cast<Gst::AppSink*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} /* namespace Glib */


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)
{
  const auto 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&& src) noexcept
: Gst::BaseSink(std::move(src))
  , Gst::URIHandler(std::move(src))
{}

AppSink& AppSink::operator=(AppSink&& src) noexcept
{
  Gst::BaseSink::operator=(std::move(src));
  Gst::URIHandler::operator=(std::move(src));
  return *this;
}


AppSink::~AppSink() noexcept
{}


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::SignalProxy< void > AppSink::signal_eos()
{
  return Glib::SignalProxy< void >(this, &AppSink_signal_eos_info);
}


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


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


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


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


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

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

Glib::PropertyProxy_ReadOnly< bool > AppSink::property_eos() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "eos");
}

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

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

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

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

Glib::PropertyProxy< bool > AppSink::property_drop() 
{
  return Glib::PropertyProxy< bool >(this, "drop");
}

Glib::PropertyProxy_ReadOnly< bool > AppSink::property_drop() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "drop");
}

Glib::PropertyProxy< bool > AppSink::property_wait_on_eos() 
{
  return Glib::PropertyProxy< bool >(this, "wait-on-eos");
}

Glib::PropertyProxy_ReadOnly< bool > AppSink::property_wait_on_eos() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "wait-on-eos");
}


} // namespace Gst

#endif // GSTREAMERMM_DISABLE_DEPRECATED


