funnel: Integrate into the build system and rename the types

This commit is contained in:
Sebastian Dröge 2011-03-29 10:42:31 +02:00
parent e5a857e78a
commit 565efa30ea
11 changed files with 158 additions and 124 deletions

View file

@ -24,6 +24,7 @@
<xi:include href="xml/element-fdsrc.xml" />
<xi:include href="xml/element-filesrc.xml" />
<xi:include href="xml/element-filesink.xml" />
<xi:include href="xml/element-funnel.xml" />
<xi:include href="xml/element-identity.xml" />
<xi:include href="xml/element-input-selector.xml" />
<xi:include href="xml/element-multiqueue.xml" />

View file

@ -95,6 +95,21 @@ GST_IS_FILE_SINK_CLASS
gst_file_sink_get_type
</SECTION>
<SECTION>
<FILE>element-funnel</FILE>
<TITLE>funnel</TITLE>
GstFunnel
<SUBSECTION Standard>
GstFunnelClass
GST_FUNNEL
GST_IS_FUNNEL
GST_TYPE_FUNNEL
GST_FUNNEL_CLASS
GST_IS_FUNNEL_CLASS
<SUBSECTION Private>
gst_funnel_get_type
</SECTION>
<SECTION>
<FILE>element-capsfilter</FILE>
<TITLE>capsfilter</TITLE>

View file

@ -1,43 +1,44 @@
GObject
GstObject
GstBus
GstClock
GstPad
GstPadTemplate
GstPluginFeature
GstElementFactory
GstTypeFindFactory
GstIndexFactory
GstElement
GstBin
GstPipeline
GstBaseTransform
GstCapsFilter
GstIdentity
GstBaseSrc
GstFakeSrc
GstPushSrc
GstFdSrc
GstFileSrc
GstBaseSink
GstFakeSink
GstFdSink
GstFileSink
GstBaseSrc
GstFakeSrc
GstFileSrc
GstPushSrc
GstFdSrc
GstBaseTransform
GstCapsFilter
GstIdentity
GstBin
GstPipeline
GstFunnel
GstInputSelector
GstMultiQueue
GstOutputSelector
GstQueue
GstQueue2
GstTee
GstTypeFindElement
GstMultiQueue
GstValve
GstIndex
GstFileIndex
GstMemIndex
GstPad
GstPadTemplate
GstPlugin
GstPluginFeature
GstElementFactory
GstIndexFactory
GstTypeFindFactory
GstRegistry
GstBus
GstTask
GstTaskPool
GstClock
GstPlugin
GstRegistry
GstIndex
GstMemIndex
GstFileIndex
GstSignalObject
GInterface
GTypePlugin

View file

@ -120,6 +120,27 @@
</caps>
</pads>
</element>
<element>
<name>funnel</name>
<longname>Farsight Funnel pipe fitting</longname>
<class>Generic</class>
<description>N-to-1 pipe fitting</description>
<author>Olivier Crete &lt;olivier.crete@collabora.co.uk&gt;</author>
<pads>
<caps>
<name>sink%d</name>
<direction>sink</direction>
<presence>request</presence>
<details>ANY</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
<element>
<name>identity</name>
<longname>Identity</longname>

View file

@ -0,0 +1,12 @@
<plugin>
<name>staticelements</name> <description>core elements linked into the GStreamer library</description> <filename></filename> <basename></basename> <version>0.10.29.1</version> <license>LGPL</license> <source>gstreamer</source> <package>GStreamer git</package> <origin>Unknown package origin</origin> <elements>
<element>
<name>bin</name> <longname>Generic bin</longname> <class>Generic/Bin</class> <description>Simple container object</description> <author>Erik Walthinsen &lt;omega@cse.ogi.edu&gt;,Wim Taymans &lt;wim.taymans@gmail.com&gt;</author> <pads>
</pads>
</element>
<element>
<name>pipeline</name> <longname>Pipeline object</longname> <class>Generic/Bin</class> <description>Complete pipeline object</description> <author>Erik Walthinsen &lt;omega@cse.ogi.edu&gt;, Wim Taymans &lt;wim@fluendo.com&gt;</author> <pads>
</pads>
</element>
</elements>
</plugin>

View file

@ -11,6 +11,7 @@ libgstcoreelements_la_SOURCES = \
gstfdsink.c \
gstfilesink.c \
gstfilesrc.c \
gstfunnel.c \
gstidentity.c \
gstinputselector.c \
gstoutputselector.c \
@ -36,6 +37,7 @@ noinst_HEADERS = \
gstfdsink.h \
gstfilesink.h \
gstfilesrc.h \
gstfunnel.h \
gstidentity.h \
gstinputselector.h \
gstoutputselector.h \

View file

@ -34,6 +34,7 @@
#include "gstfdsink.h"
#include "gstfilesink.h"
#include "gstfilesrc.h"
#include "gstfunnel.h"
#include "gstidentity.h"
#include "gstinputselector.h"
#include "gstoutputselector.h"
@ -61,6 +62,7 @@ static struct _elements_entry _elements[] = {
{"fdsink", GST_RANK_NONE, gst_fd_sink_get_type},
#endif
{"filesrc", GST_RANK_PRIMARY, gst_file_src_get_type},
{"funnel", GST_RANK_NONE, gst_funnel_get_type},
{"identity", GST_RANK_NONE, gst_identity_get_type},
{"input-selector", GST_RANK_NONE, gst_input_selector_get_type},
{"output-selector", GST_RANK_NONE, gst_output_selector_get_type},

View file

@ -1,11 +1,11 @@
/*
* 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
@ -23,26 +23,20 @@
*/
/**
* 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",
@ -56,44 +50,43 @@ GST_STATIC_PAD_TEMPLATE ("src",
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));
@ -103,7 +96,7 @@ fs_funnel_base_init (gpointer g_class)
static void
fs_funnel_dispose (GObject * object)
gst_funnel_dispose (GObject * object)
{
GList *item;
@ -121,34 +114,34 @@ restart:
}
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);
@ -160,21 +153,22 @@ fs_funnel_buffer_alloc (GstPad * pad, guint64 offset, guint size,
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);
@ -187,25 +181,25 @@ fs_funnel_request_new_pad (GstElement * element, GstPadTemplate * templ,
}
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);
@ -218,11 +212,11 @@ fs_funnel_getcaps (GstPad * pad)
}
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;
@ -283,10 +277,10 @@ out:
}
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;
@ -334,7 +328,7 @@ fs_funnel_event (GstPad * pad, GstEvent * event)
}
static gboolean
fs_funnel_src_event (GstPad * pad, GstEvent * event)
gst_funnel_src_event (GstPad * pad, GstEvent * event)
{
GstElement *funnel;
GstIterator *iter;
@ -376,7 +370,7 @@ static void
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);
@ -385,9 +379,9 @@ reset_pad (gpointer data, gpointer user_data)
}
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) {
@ -418,18 +412,3 @@ fs_funnel_change_state (GstElement * element, GstStateChange 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/")

View file

@ -1,11 +1,11 @@
/*
* 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
@ -23,33 +23,33 @@
*/
#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 >*/
@ -58,12 +58,12 @@ struct _FsFunnel {
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__ */

View file

@ -77,6 +77,7 @@ REGISTRY_CHECKS = \
elements/fdsrc \
elements/filesink \
elements/filesrc \
elements/funnel \
elements/identity \
elements/multiqueue \
elements/selector \

View file

@ -1,4 +1,4 @@
/* Farsight 2 unit tests for the fsfunnel
/* GStreamer unit tests for the funnel
*
* Copyright (C) 2008 Collabora, Nokia
* @author: Olivier Crete <olivier.crete@collabora.co.uk>
@ -39,7 +39,7 @@ setup_test_objects (struct TestData *td, GstPadChainFunction chain_func,
{
td->mycaps = gst_caps_new_simple ("test/test", NULL);
td->funnel = gst_element_factory_make ("fsfunnel", NULL);
td->funnel = gst_element_factory_make ("funnel", NULL);
td->funnelsrc = gst_element_get_static_pad (td->funnel, "src");
fail_unless (td->funnelsrc != NULL);