/*
- * Farsight2 - Farsight Funnel element
+ * GStreamer Funnel element
*
* Copyright 2007 Collabora Ltd.
* @author: Olivier Crete <olivier.crete@collabora.co.uk>
* Copyright 2007 Nokia Corp.
*
- * fs-funnel.c: Simple Funnel element
+ * gstfunnel.c: Simple Funnel element
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*/
/**
- * SECTION:element-fsfunnel
+ * SECTION:element-funnel
* @short_description: N-to-1 simple funnel
*
* Takes packets from various input sinks into one output source
*/
#ifdef HAVE_CONFIG_H
-# include "config.h"
+#include "config.h"
#endif
-#include "fs-funnel.h"
+#include "gstfunnel.h"
-GST_DEBUG_CATEGORY_STATIC (fs_funnel_debug);
-#define GST_CAT_DEFAULT fs_funnel_debug
-
-static const GstElementDetails fs_funnel_details =
-GST_ELEMENT_DETAILS ("Farsight Funnel pipe fitting",
- "Generic",
- "N-to-1 pipe fitting",
- "Olivier Crete <olivier.crete@collabora.co.uk>");
+GST_DEBUG_CATEGORY_STATIC (gst_funnel_debug);
+#define GST_CAT_DEFAULT gst_funnel_debug
static GstStaticPadTemplate funnel_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink%d",
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
-
static void
_do_init (GType type)
{
- GST_DEBUG_CATEGORY_INIT (fs_funnel_debug, "fsfunnel", 0, "fsfunnel element");
+ GST_DEBUG_CATEGORY_INIT (gst_funnel_debug, "funnel", 0, "funnel element");
}
-GST_BOILERPLATE_FULL (FsFunnel, fs_funnel, GstElement, GST_TYPE_ELEMENT,
+GST_BOILERPLATE_FULL (GstFunnel, gst_funnel, GstElement, GST_TYPE_ELEMENT,
_do_init);
-
-
-static GstStateChangeReturn fs_funnel_change_state (GstElement * element,
+static GstStateChangeReturn gst_funnel_change_state (GstElement * element,
GstStateChange transition);
-static GstPad *fs_funnel_request_new_pad (GstElement * element,
+static GstPad *gst_funnel_request_new_pad (GstElement * element,
GstPadTemplate * templ, const gchar * name);
-static void fs_funnel_release_pad (GstElement * element, GstPad * pad);
+static void gst_funnel_release_pad (GstElement * element, GstPad * pad);
-static GstFlowReturn fs_funnel_buffer_alloc (GstPad * pad, guint64 offset,
+static GstFlowReturn gst_funnel_buffer_alloc (GstPad * pad, guint64 offset,
guint size, GstCaps * caps, GstBuffer ** buf);
-static GstFlowReturn fs_funnel_chain (GstPad * pad, GstBuffer * buffer);
-static gboolean fs_funnel_event (GstPad * pad, GstEvent * event);
-static gboolean fs_funnel_src_event (GstPad * pad, GstEvent * event);
-static GstCaps *fs_funnel_getcaps (GstPad * pad);
+static GstFlowReturn gst_funnel_chain (GstPad * pad, GstBuffer * buffer);
+static gboolean gst_funnel_event (GstPad * pad, GstEvent * event);
+static gboolean gst_funnel_src_event (GstPad * pad, GstEvent * event);
+static GstCaps *gst_funnel_getcaps (GstPad * pad);
typedef struct
{
GstSegment segment;
-} FsFunnelPadPrivate;
+} GstFunnelPadPrivate;
static void
-fs_funnel_base_init (gpointer g_class)
+gst_funnel_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
- gst_element_class_set_details (gstelement_class, &fs_funnel_details);
+ gst_element_class_set_details_simple (gstelement_class,
+ "Farsight Funnel pipe fitting", "Generic", "N-to-1 pipe fitting",
+ "Olivier Crete <olivier.crete@collabora.co.uk>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&funnel_sink_template));
static void
-fs_funnel_dispose (GObject * object)
+gst_funnel_dispose (GObject * object)
{
GList *item;
}
static void
-fs_funnel_class_init (FsFunnelClass * klass)
+gst_funnel_class_init (GstFunnelClass * klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
- gobject_class->dispose = GST_DEBUG_FUNCPTR (fs_funnel_dispose);
+ gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_funnel_dispose);
gstelement_class->request_new_pad =
- GST_DEBUG_FUNCPTR (fs_funnel_request_new_pad);
- gstelement_class->release_pad = GST_DEBUG_FUNCPTR (fs_funnel_release_pad);
- gstelement_class->change_state = GST_DEBUG_FUNCPTR (fs_funnel_change_state);
+ GST_DEBUG_FUNCPTR (gst_funnel_request_new_pad);
+ gstelement_class->release_pad = GST_DEBUG_FUNCPTR (gst_funnel_release_pad);
+ gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_funnel_change_state);
}
static void
-fs_funnel_init (FsFunnel * funnel, FsFunnelClass * g_class)
+gst_funnel_init (GstFunnel * funnel, GstFunnelClass * g_class)
{
funnel->srcpad = gst_pad_new_from_static_template (&funnel_src_template,
"src");
- gst_pad_set_event_function (funnel->srcpad, fs_funnel_src_event);
+ gst_pad_set_event_function (funnel->srcpad, gst_funnel_src_event);
gst_pad_use_fixed_caps (funnel->srcpad);
gst_element_add_pad (GST_ELEMENT (funnel), funnel->srcpad);
}
static GstFlowReturn
-fs_funnel_buffer_alloc (GstPad * pad, guint64 offset, guint size,
+gst_funnel_buffer_alloc (GstPad * pad, guint64 offset, guint size,
GstCaps * caps, GstBuffer ** buf)
{
- FsFunnel *funnel = FS_FUNNEL (gst_pad_get_parent_element (pad));
+ GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent_element (pad));
GstFlowReturn ret = GST_FLOW_OK;
ret = gst_pad_alloc_buffer (funnel->srcpad, offset, size, caps, buf);
static GstPad *
-fs_funnel_request_new_pad (GstElement * element, GstPadTemplate * templ,
+gst_funnel_request_new_pad (GstElement * element, GstPadTemplate * templ,
const gchar * name)
{
GstPad *sinkpad;
- FsFunnelPadPrivate *priv = g_slice_alloc0 (sizeof (FsFunnelPadPrivate));
+ GstFunnelPadPrivate *priv = g_slice_alloc0 (sizeof (GstFunnelPadPrivate));
GST_DEBUG_OBJECT (element, "requesting pad");
sinkpad = gst_pad_new_from_template (templ, name);
- gst_pad_set_chain_function (sinkpad, GST_DEBUG_FUNCPTR (fs_funnel_chain));
- gst_pad_set_event_function (sinkpad, GST_DEBUG_FUNCPTR (fs_funnel_event));
- gst_pad_set_getcaps_function (sinkpad, GST_DEBUG_FUNCPTR (fs_funnel_getcaps));
+ gst_pad_set_chain_function (sinkpad, GST_DEBUG_FUNCPTR (gst_funnel_chain));
+ gst_pad_set_event_function (sinkpad, GST_DEBUG_FUNCPTR (gst_funnel_event));
+ gst_pad_set_getcaps_function (sinkpad,
+ GST_DEBUG_FUNCPTR (gst_funnel_getcaps));
gst_pad_set_bufferalloc_function (sinkpad,
- GST_DEBUG_FUNCPTR (fs_funnel_buffer_alloc));
+ GST_DEBUG_FUNCPTR (gst_funnel_buffer_alloc));
gst_segment_init (&priv->segment, GST_FORMAT_UNDEFINED);
gst_pad_set_element_private (sinkpad, priv);
}
static void
-fs_funnel_release_pad (GstElement * element, GstPad * pad)
+gst_funnel_release_pad (GstElement * element, GstPad * pad)
{
- FsFunnel *funnel = FS_FUNNEL (element);
- FsFunnelPadPrivate *priv = gst_pad_get_element_private (pad);
+ GstFunnel *funnel = GST_FUNNEL (element);
+ GstFunnelPadPrivate *priv = gst_pad_get_element_private (pad);
GST_DEBUG_OBJECT (funnel, "releasing pad");
gst_pad_set_active (pad, FALSE);
if (priv)
- g_slice_free1 (sizeof (FsFunnelPadPrivate), priv);
+ g_slice_free1 (sizeof (GstFunnelPadPrivate), priv);
gst_element_remove_pad (GST_ELEMENT_CAST (funnel), pad);
}
static GstCaps *
-fs_funnel_getcaps (GstPad * pad)
+gst_funnel_getcaps (GstPad * pad)
{
- FsFunnel *funnel = FS_FUNNEL (gst_pad_get_parent (pad));
+ GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent (pad));
GstCaps *caps;
caps = gst_pad_peer_get_caps_reffed (funnel->srcpad);
}
static GstFlowReturn
-fs_funnel_chain (GstPad * pad, GstBuffer * buffer)
+gst_funnel_chain (GstPad * pad, GstBuffer * buffer)
{
GstFlowReturn res;
- FsFunnel *funnel = FS_FUNNEL (gst_pad_get_parent (pad));
- FsFunnelPadPrivate *priv = gst_pad_get_element_private (pad);
+ GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent (pad));
+ GstFunnelPadPrivate *priv = gst_pad_get_element_private (pad);
GstEvent *event = NULL;
GstClockTime newts;
GstCaps *padcaps;
}
static gboolean
-fs_funnel_event (GstPad * pad, GstEvent * event)
+gst_funnel_event (GstPad * pad, GstEvent * event)
{
- FsFunnel *funnel = FS_FUNNEL (gst_pad_get_parent (pad));
- FsFunnelPadPrivate *priv = gst_pad_get_element_private (pad);
+ GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent (pad));
+ GstFunnelPadPrivate *priv = gst_pad_get_element_private (pad);
gboolean forward = TRUE;
gboolean res = TRUE;
}
static gboolean
-fs_funnel_src_event (GstPad * pad, GstEvent * event)
+gst_funnel_src_event (GstPad * pad, GstEvent * event)
{
GstElement *funnel;
GstIterator *iter;
reset_pad (gpointer data, gpointer user_data)
{
GstPad *pad = data;
- FsFunnelPadPrivate *priv = gst_pad_get_element_private (pad);
+ GstFunnelPadPrivate *priv = gst_pad_get_element_private (pad);
GST_OBJECT_LOCK (pad);
gst_segment_init (&priv->segment, GST_FORMAT_UNDEFINED);
}
static GstStateChangeReturn
-fs_funnel_change_state (GstElement * element, GstStateChange transition)
+gst_funnel_change_state (GstElement * element, GstStateChange transition)
{
- FsFunnel *funnel = FS_FUNNEL (element);
+ GstFunnel *funnel = GST_FUNNEL (element);
GstStateChangeReturn ret;
switch (transition) {
return ret;
}
-
-
-static gboolean
-plugin_init (GstPlugin * plugin)
-{
- return gst_element_register (plugin, "fsfunnel",
- GST_RANK_NONE, FS_TYPE_FUNNEL);
-}
-
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- "fsfunnel",
- "Farsight Funnel plugin",
- plugin_init,
- VERSION, "LGPL", "Farsight", "http://farsight.freedesktop.org/")
/*
- * Farsight2 - Farsight Funnel element
+ * GStreamer Funnel element
*
* Copyright 2007 Collabora Ltd.
* @author: Olivier Crete <olivier.crete@collabora.co.uk>
* Copyright 2007 Nokia Corp.
*
- * fs-funnel.h: Simple Funnel element
+ * gstfunnel.h: Simple Funnel element
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*/
-#ifndef __FS_FUNNEL_H__
-#define __FS_FUNNEL_H__
+#ifndef __GST_FUNNEL_H__
+#define __GST_FUNNEL_H__
#include <gst/gst.h>
G_BEGIN_DECLS
-#define FS_TYPE_FUNNEL \
- (fs_funnel_get_type ())
-#define FS_FUNNEL(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),FS_TYPE_FUNNEL,FsFunnel))
-#define FS_FUNNEL_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),FS_TYPE_FUNNEL,FsFunnelClass))
-#define FS_IS_FUNNEL(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),FS_TYPE_FUNNEL))
-#define FS_IS_FUNNEL_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),FS_TYPE_FUNNEL))
+#define GST_TYPE_FUNNEL \
+ (gst_funnel_get_type ())
+#define GST_FUNNEL(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FUNNEL,GstFunnel))
+#define GST_FUNNEL_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FUNNEL,GstFunnelClass))
+#define GST_IS_FUNNEL(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FUNNEL))
+#define GST_IS_FUNNEL_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FUNNEL))
-typedef struct _FsFunnel FsFunnel;
-typedef struct _FsFunnelClass FsFunnelClass;
+typedef struct _GstFunnel GstFunnel;
+typedef struct _GstFunnelClass GstFunnelClass;
/**
- * FsFunnel:
+ * GstFunnel:
*
- * Opaque #FsFunnel data structure.
+ * Opaque #GstFunnel data structure.
*/
-struct _FsFunnel {
+struct _GstFunnel {
GstElement element;
/*< private >*/
gboolean has_segment;
};
-struct _FsFunnelClass {
+struct _GstFunnelClass {
GstElementClass parent_class;
};
-GType fs_funnel_get_type (void);
+GType gst_funnel_get_type (void);
G_END_DECLS
-#endif /* __FS_FUNNEL_H__ */
+#endif /* __GST_FUNNEL_H__ */